Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
b0ee7052
Commit
b0ee7052
authored
May 25, 2023
by
KeYong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
96f5032c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
159 additions
and
14 deletions
+159
-14
FireFightingSystemMapper.java
.../yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
+4
-0
FireFightingSystemServiceImpl.java
...uipmanage/service/impl/FireFightingSystemServiceImpl.java
+29
-1
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+7
-6
PlanTaskServiceImpl.java
...mos/patrol/business/service/impl/PlanTaskServiceImpl.java
+1
-5
wl-3.6.0.xml
...ot-system-equip/src/main/resources/changelog/wl-3.6.0.xml
+48
-0
EquipmentSpecificAlarmMapper.xml
...rc/main/resources/mapper/EquipmentSpecificAlarmMapper.xml
+1
-1
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+69
-1
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
View file @
b0ee7052
...
@@ -108,6 +108,10 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
...
@@ -108,6 +108,10 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
*/
*/
List
<
SpeIndexVo
>
getSpeIndex
(
Long
id
);
List
<
SpeIndexVo
>
getSpeIndex
(
Long
id
);
Map
<
String
,
Object
>
judgeIsTrend
(
Long
id
);
List
<
SpeIndexVo
>
getYaoCeSpeIndex
(
Long
id
);
/**
/**
* 按照组态格式获取系统详情
* 按照组态格式获取系统详情
*
*
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
View file @
b0ee7052
...
@@ -443,8 +443,14 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
...
@@ -443,8 +443,14 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override
@Override
public
List
<
SpeIndexVo
>
getSpeIndex
(
Long
id
,
int
flag
)
{
public
List
<
SpeIndexVo
>
getSpeIndex
(
Long
id
,
int
flag
)
{
// 因此处代码其他地方有调用 增加表示判断 flag == 1 为 消防点位图处需要iot编码所用
// 因此处代码其他地方有调用 增加表示判断 flag == 1 为 消防点位图处需要iot编码所用
Map
<
String
,
Object
>
obj
=
fireFightingSystemMapper
.
judgeIsTrend
(
id
);
if
(
flag
==
1
)
{
if
(
flag
==
1
)
{
List
<
SpeIndexVo
>
speIndexVos
=
makeStatus
(
fireFightingSystemMapper
.
getSpeIndex
(
id
));
List
<
SpeIndexVo
>
speIndexVos
=
new
ArrayList
<>();
if
(
String
.
valueOf
(
obj
.
get
(
"isTrend"
)).
equals
(
"1"
))
{
speIndexVos
=
makeYaoCeStatus
(
fireFightingSystemMapper
.
getYaoCeSpeIndex
(
id
));
}
else
{
speIndexVos
=
makeStatus
(
fireFightingSystemMapper
.
getSpeIndex
(
id
));
}
if
(!
ValidationUtil
.
isEmpty
(
speIndexVos
))
{
if
(!
ValidationUtil
.
isEmpty
(
speIndexVos
))
{
EquipmentSpecific
equipmentSpecific
=
equipmentSpecificSerivce
.
getBaseMapper
().
selectById
(
id
);
EquipmentSpecific
equipmentSpecific
=
equipmentSpecificSerivce
.
getBaseMapper
().
selectById
(
id
);
if
(!
ValidationUtil
.
isEmpty
(
equipmentSpecific
))
{
if
(!
ValidationUtil
.
isEmpty
(
equipmentSpecific
))
{
...
@@ -456,6 +462,9 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
...
@@ -456,6 +462,9 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
}
return
speIndexVos
;
return
speIndexVos
;
}
}
if
(
String
.
valueOf
(
obj
.
get
(
"isTrend"
)).
equals
(
"1"
))
{
return
makeYaoCeStatus
(
fireFightingSystemMapper
.
getYaoCeSpeIndex
(
id
));
}
return
makeStatus
(
fireFightingSystemMapper
.
getSpeIndex
(
id
));
return
makeStatus
(
fireFightingSystemMapper
.
getSpeIndex
(
id
));
}
}
...
@@ -769,6 +778,25 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
...
@@ -769,6 +778,25 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
return
statusList
;
return
statusList
;
}
}
private
List
<
SpeIndexVo
>
makeYaoCeStatus
(
List
<
SpeIndexVo
>
list
)
{
if
(
list
==
null
||
list
.
size
()
==
0
)
{
return
new
ArrayList
<>();
}
List
<
SpeIndexVo
>
statusList
=
new
ArrayList
<>();
SpeIndexVo
spe
=
new
SpeIndexVo
();
spe
.
setKey
(
EquipmentSpeIndexEnum
.
YXZT
.
getCode
());
SpeIndexVo
latestVo
=
list
.
get
(
0
);
org
.
springframework
.
beans
.
BeanUtils
.
copyProperties
(
latestVo
,
spe
);
spe
.
setName
(
"当前状态"
);
Map
<
String
,
String
>
map
=
getStatus
(
list
);
spe
.
setValue
(
map
.
get
(
"runStatus"
));
spe
.
setColor
(
map
.
get
(
"color"
));
statusList
.
clear
();
statusList
.
add
(
spe
);
statusList
.
addAll
(
list
);
return
statusList
;
}
/**
/**
* 判断 装备状态
* 判断 装备状态
*
*
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
b0ee7052
...
@@ -620,6 +620,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -620,6 +620,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
}
else
if
(
nowValue
.
compareTo
(
maxValue
)
>
0
)
{
}
else
if
(
nowValue
.
compareTo
(
maxValue
)
>
0
)
{
body
=
"当前数值 "
+
nowValue
+
" 超过最高报警阈值 "
+
maxValue
;
body
=
"当前数值 "
+
nowValue
+
" 超过最高报警阈值 "
+
maxValue
;
}
}
messageBody
.
put
(
"messageBody"
,
equipmentSpecificIndex
.
getEquipmentSpecificName
()
+
"-"
+
body
);
String
bodyMain
=
String
.
format
(
"%s,- 当前数值%s,%s ,请及时查看处理。"
,
String
bodyMain
=
String
.
format
(
"%s,- 当前数值%s,%s ,请及时查看处理。"
,
equipmentSpecificIndex
.
getEquipmentSpecificName
()
+
"-"
+
equipmentSpecificIndex
.
getLocation
(),
equipmentSpecificIndex
.
getEquipmentSpecificName
()
+
"-"
+
equipmentSpecificIndex
.
getLocation
(),
nowValue
,
nowValue
,
...
@@ -649,7 +650,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -649,7 +650,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
// }
// }
// log.info(String.format("调用平台消息服务成功:%s", JSON.toJSONString(model)));
// log.info(String.format("调用平台消息服务成功:%s", JSON.toJSONString(model)));
alarmFlag
=
true
;
alarmFlag
=
true
;
messageBody
.
put
(
"messageBody"
,
equipmentSpecificIndex
.
getEquipmentSpecificName
()
+
"-"
+
body
);
}
}
return
alarmFlag
;
return
alarmFlag
;
}
}
...
@@ -1020,7 +1020,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -1020,7 +1020,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
* @return
* @return
*/
*/
private
List
<
EquipmentSpecificAlarm
>
addEquipmentSpecificAlarm
(
List
<
EquipmentSpecificAlarm
>
equipmentSpecificAlarms
,
private
List
<
EquipmentSpecificAlarm
>
addEquipmentSpecificAlarm
(
List
<
EquipmentSpecificAlarm
>
equipmentSpecificAlarms
,
EquipmentSpecificIndex
equipmentSpecificIndex
,
EquipmentSpecificAlarm
equipmentSpecificAlarm
)
{
EquipmentSpecificIndex
equipmentSpecificIndex
,
EquipmentSpecificAlarm
equipmentSpecificAlarm
,
Map
<
String
,
String
>
messageBody
)
{
BeanUtils
.
copyProperties
(
equipmentSpecificIndex
,
equipmentSpecificAlarm
);
BeanUtils
.
copyProperties
(
equipmentSpecificIndex
,
equipmentSpecificAlarm
);
equipmentSpecificAlarm
.
setId
(
null
);
equipmentSpecificAlarm
.
setId
(
null
);
equipmentSpecificAlarm
.
setFrequency
(
1
);
equipmentSpecificAlarm
.
setFrequency
(
1
);
...
@@ -1040,6 +1040,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -1040,6 +1040,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
equipmentSpecificAlarm
.
setEmergencyLevelDescribe
(
equipmentSpecificIndex
.
getEmergencyLevelDescribe
());
equipmentSpecificAlarm
.
setEmergencyLevelDescribe
(
equipmentSpecificIndex
.
getEmergencyLevelDescribe
());
equipmentSpecificAlarm
.
setBizOrgCode
(
equipmentSpecificIndex
.
getBizOrgCode
());
equipmentSpecificAlarm
.
setBizOrgCode
(
equipmentSpecificIndex
.
getBizOrgCode
());
equipmentSpecificAlarm
.
setBizOrgName
(
equipmentSpecificIndex
.
getBizOrgName
());
equipmentSpecificAlarm
.
setBizOrgName
(
equipmentSpecificIndex
.
getBizOrgName
());
equipmentSpecificAlarm
.
setMessageBody
(!
ObjectUtils
.
isEmpty
(
messageBody
)
?
messageBody
.
get
(
"messageBody"
)
:
""
);
//调整为按照设备归属(可归属公司或者部门
//调整为按照设备归属(可归属公司或者部门
Map
<
String
,
Object
>
mapd
=
iEquipmentSpecificSerivce
.
getStationCode
(
equipmentSpecificIndex
.
getEquipmentSpecificId
());
Map
<
String
,
Object
>
mapd
=
iEquipmentSpecificSerivce
.
getStationCode
(
equipmentSpecificIndex
.
getEquipmentSpecificId
());
...
@@ -1060,10 +1061,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -1060,10 +1061,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
// NB装备告警
// NB装备告警
private
List
<
EquipmentSpecificAlarm
>
getNbEquipAlarmList
(
List
<
EquipmentSpecificAlarm
>
indexAlarms
,
private
List
<
EquipmentSpecificAlarm
>
getNbEquipAlarmList
(
List
<
EquipmentSpecificAlarm
>
indexAlarms
,
EquipmentSpecificIndex
equipmentSpecificIndex
,
EquipmentSpecificAlarm
equipmentSpecificAlarm
)
{
EquipmentSpecificIndex
equipmentSpecificIndex
,
EquipmentSpecificAlarm
equipmentSpecificAlarm
,
Map
<
String
,
String
>
messageBody
)
{
List
<
EquipmentSpecificAlarm
>
equipmentSpecificAlarmList
=
new
ArrayList
<>();
List
<
EquipmentSpecificAlarm
>
equipmentSpecificAlarmList
=
new
ArrayList
<>();
if
(
ValidationUtil
.
isEmpty
(
indexAlarms
))
{
// 告警表为空,新增告警数据
if
(
ValidationUtil
.
isEmpty
(
indexAlarms
))
{
// 告警表为空,新增告警数据
addEquipmentSpecificAlarm
(
equipmentSpecificAlarmList
,
equipmentSpecificIndex
,
equipmentSpecificAlarm
);
addEquipmentSpecificAlarm
(
equipmentSpecificAlarmList
,
equipmentSpecificIndex
,
equipmentSpecificAlarm
,
messageBody
);
if
(!
checkStateIsNormal
(
equipmentSpecificAlarm
,
equipmentSpecificIndex
))
{
if
(!
checkStateIsNormal
(
equipmentSpecificAlarm
,
equipmentSpecificIndex
))
{
return
equipmentSpecificAlarmList
;
return
equipmentSpecificAlarmList
;
}
else
{
}
else
{
...
@@ -1347,11 +1348,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -1347,11 +1348,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
equipmentSpcIndex
.
getEquipmentSpecificId
(),
equipmentSpcIndex
.
getEquipmentIndexId
());
equipmentSpcIndex
.
getEquipmentSpecificId
(),
equipmentSpcIndex
.
getEquipmentIndexId
());
// NB设备告警
// NB设备告警
if
(
verifyNB
(
equipmentSpcIndex
.
getNameKey
()))
{
if
(
verifyNB
(
equipmentSpcIndex
.
getNameKey
()))
{
return
getNbEquipAlarmList
(
indexAlarms
,
equipmentSpcIndex
,
equipmentSpecificAlarm
);
return
getNbEquipAlarmList
(
indexAlarms
,
equipmentSpcIndex
,
equipmentSpecificAlarm
,
messageBody
);
}
}
// 报警表新增信息
// 报警表新增信息
if
(
ObjectUtils
.
isEmpty
(
indexAlarms
)
&&
(
TrueOrFalseEnum
.
real
.
value
.
equals
(
equipmentSpcIndex
.
getValue
())))
{
if
(
ObjectUtils
.
isEmpty
(
indexAlarms
)
&&
(
TrueOrFalseEnum
.
real
.
value
.
equals
(
equipmentSpcIndex
.
getValue
())))
{
equipmentSpecificAlarms
=
addEquipmentSpecificAlarm
(
equipmentSpecificAlarms
,
equipmentSpcIndex
,
equipmentSpecificAlarm
);
equipmentSpecificAlarms
=
addEquipmentSpecificAlarm
(
equipmentSpecificAlarms
,
equipmentSpcIndex
,
equipmentSpecificAlarm
,
messageBody
);
}
else
{
}
else
{
// 报警表更新信息
// 报警表更新信息
for
(
EquipmentSpecificAlarm
action
:
indexAlarms
)
{
for
(
EquipmentSpecificAlarm
action
:
indexAlarms
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/PlanTaskServiceImpl.java
View file @
b0ee7052
...
@@ -68,7 +68,6 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -68,7 +68,6 @@ import org.springframework.web.multipart.MultipartFile;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
...
@@ -76,14 +75,11 @@ import java.io.File;
...
@@ -76,14 +75,11 @@ import java.io.File;
import
java.io.FileInputStream
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
java.text.DateFormat
;
import
java.text.DateFormat
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.ZoneId
;
import
java.time.ZoneId
;
import
java.time.ZonedDateTime
;
import
java.util.*
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -1930,7 +1926,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -1930,7 +1926,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
List
<
DefectVo
>
res
=
new
ArrayList
();
List
<
DefectVo
>
res
=
new
ArrayList
();
if
(
0
<
result
.
size
())
{
if
(
result
!=
null
&&
0
<
result
.
size
())
{
for
(
Object
object
:
result
)
{
for
(
Object
object
:
result
)
{
DefectVo
vo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
object
),
DefectVo
.
class
);
DefectVo
vo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
object
),
DefectVo
.
class
);
res
.
add
(
vo
);
res
.
add
(
vo
);
...
...
amos-boot-system-equip/src/main/resources/changelog/wl-3.6.0.xml
View file @
b0ee7052
...
@@ -796,4 +796,51 @@
...
@@ -796,4 +796,51 @@
</sql>
</sql>
</changeSet>
</changeSet>
<changeSet
author=
"keyong"
id=
"1684921528"
>
<preConditions
onFail=
"MARK_RAN"
>
<tableExists
tableName=
"wl_signal_classify"
/>
</preConditions>
<comment>
更改属性值
</comment>
<sql>
UPDATE wl_signal_classify wsc SET wsc.is_alarm = true, wsc.emergency_level_color = '#E8D639', wsc.emergency_level = '3', wsc.emergency_level_describe = '轻微' WHERE wsc.id IN (20220241, 20220243);
UPDATE wl_equipment_index wei
SET wei.emergency_level_color = (
SELECT
emergency_level_color
FROM
wl_signal_classify wsc
WHERE
upper( wsc.type_code ) = upper( wei.type_code )
),
wei.is_alarm = (
SELECT
is_alarm
FROM
wl_signal_classify wsc
WHERE
upper( wsc.type_code ) = upper( wei.type_code )
),
wei.emergency_level = (
SELECT
emergency_level
FROM
wl_signal_classify wsc
WHERE
upper( wsc.type_code ) = upper( wei.type_code )
),
wei.emergency_level_describe = (
SELECT
emergency_level_describe
FROM
wl_signal_classify wsc
WHERE
upper( wsc.type_code ) = upper( wei.type_code )
);
UPDATE wl_equipment_specific_index esi
SET esi.emergency_level_color = ( SELECT emergency_level_color FROM wl_equipment_index wei WHERE esi.equipment_index_id = wei.id ),
esi.is_alarm = ( SELECT is_alarm FROM wl_equipment_index wei WHERE esi.equipment_index_id = wei.id ),
esi.emergency_level = ( SELECT emergency_level FROM wl_equipment_index wei WHERE esi.equipment_index_id = wei.id ),
esi.emergency_level_describe = ( SELECT emergency_level_describe FROM wl_equipment_index wei WHERE esi.equipment_index_id = wei.id );
</sql>
</changeSet>
</databaseChangeLog>
</databaseChangeLog>
\ No newline at end of file
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificAlarmMapper.xml
View file @
b0ee7052
...
@@ -1385,7 +1385,7 @@
...
@@ -1385,7 +1385,7 @@
LEFT JOIN `wl_equipment_specific_alarm` wesa ON wesa.id = wlesal.equipment_specific_alarm_id
LEFT JOIN `wl_equipment_specific_alarm` wesa ON wesa.id = wlesal.equipment_specific_alarm_id
LEFT JOIN `wl_equipment_specific` `wles` ON `wlesal`.`equipment_specific_id` = `wles`.`id`
LEFT JOIN `wl_equipment_specific` `wles` ON `wlesal`.`equipment_specific_id` = `wles`.`id`
<where>
<where>
wesa.`status` = 1
wesa.`status` = 1
AND wlesal.clean_time IS NULL
<if
test=
"param.system != null and param.system != ''"
>
<if
test=
"param.system != null and param.system != ''"
>
AND find_in_set( #{param.system}, `wlesal`.`system_codes` )
AND find_in_set( #{param.system}, `wlesal`.`system_codes` )
</if>
</if>
...
...
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
b0ee7052
...
@@ -519,7 +519,7 @@
...
@@ -519,7 +519,7 @@
FROM
FROM
p_point p
p_point p
</select>
</select>
<select
id=
"getSpeIndex"
resultType=
"com.yeejoin.equipmanage.common.vo.SpeIndexVo"
>
<select
id=
"get
YaoCe
SpeIndex"
resultType=
"com.yeejoin.equipmanage.common.vo.SpeIndexVo"
>
SELECT
SELECT
*
*
FROM
FROM
...
@@ -5799,5 +5799,73 @@
...
@@ -5799,5 +5799,73 @@
AND e.report_date >= DATE_FORMAT(#{startDate},'%y-%m-%d')
AND e.report_date >= DATE_FORMAT(#{startDate},'%y-%m-%d')
AND e.report_date
<
= DATE_FORMAT(#{endDate},'%y-%m-%d')
AND e.report_date
<
= DATE_FORMAT(#{endDate},'%y-%m-%d')
</select>
</select>
<select
id=
"judgeIsTrend"
resultType=
"Map"
>
SELECT
wei.is_trend AS isTrend
FROM
wl_equipment_specific_index AS wesi
LEFT JOIN wl_equipment_specific AS wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_index AS wei ON wei.id = wesi.equipment_index_id
WHERE
wes.id = #{id}
AND wei.is_iot = true
</select>
<select
id=
"getSpeIndex"
resultType=
"com.yeejoin.equipmanage.common.vo.SpeIndexVo"
>
SELECT
*
FROM
(
SELECT
eqin.name_key AS `key`,
eqin.`name` AS `name`,
eqin.type_code,
spein.update_date AS updateDate,
spein.equipment_specific_id as equipmentSpecificId,
IF (
eqin.unit IS NULL,
IF (
(
ISNULL(spein.value_label)
OR spein.value_label = ''
),
spein.`value`,
spein.value_label
),
concat(
IF (
(
ISNULL(spein.value_label)
OR spein.value_label = ''
),
spein.`value`,
spein.value_label
),
' ',
eqin.unit
)
) AS `value`,
spein.emergency_level_color AS color,
spein.is_alarm AS isAlarm,
spein.emergency_level AS emergencyLevel,
spein.emergency_level_describe AS emergencyLevelDescribe,
IF(SUM(IF(wesa.equipment_specific_index_value = 'true', 1, 0 ) ) > 0, 'true', 'false' ) AS indexValue,
spein.equipment_index_name AS indexName,
wes.qr_code AS qrCode
FROM
wl_equipment_specific_index AS spein
LEFT JOIN wl_equipment_index AS eqin ON spein.equipment_index_id = eqin.id
LEFT JOIN wl_equipment_specific AS wes ON wes.id = spein.equipment_specific_id
LEFT JOIN wl_equipment_specific_alarm wesa ON wesa.equipment_specific_id = wes.id
WHERE
spein.equipment_specific_id = #{id}
ORDER BY
eqin.sort_num
) AS dat
WHERE
`key` IS NOT NULL
AND `key` != ''
ORDER BY
dat.updateDate DESC
</select>
</mapper>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment