CASE when 'false' = spe.realtime_iot_index_value or spe.realtime_iot_index_value is null or spe.realtime_iot_index_value = '' then '正常' ELSE spe.realtime_iot_index_name END as status,
IFNULL((SELECT CASE
WHEN wesi.value = 'true' THEN
'开启'
WHEN (wesi.value = 'false') THEN
'关闭'
ELSE '--'
END AS systemStatus FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = spe.id AND equipment_index_key = 'WSS_DelugeValve_Start' ), '--' ) AS status,
wle.shbz_img shbzImg,
ei.is_alarm AS type,
IFNULL( spe.realtime_iot_index_value, '--' ) AS realtimeValue,
...
...
@@ -7854,10 +7861,119 @@
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'volume' ), 0 ) AS volume
FROM
wl_equipment_specific wes
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, wes.system_id )
WHERE
wes.equipment_code LIKE concat( '920319', '%' )
fs.system_type_code IS NOT NULL
<iftest="bizOrgCode != null and bizOrgCode != ''">
AND wes.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
<iftest="code != null and code != ''">
AND fs.code = #{code}
</if>
<iftest="typeCode != null and typeCode != ''">
AND fs.system_type_code = #{typeCode}
</if>
<iftest="linkedEquipmentCode != null and linkedEquipmentCode != ''">
AND wes.equipment_code LIKE concat(#{linkedEquipmentCode}, '%' )
WHEN (wesi.value = 'false' and wesi.equipment_index_key = 'FFS_Host_SystemHalt') or (wesi.value = 'true' and wesi.equipment_index_key = 'FFS_Host_SystemActions') THEN
'开启'
WHEN (wesi.value = 'true' and wesi.equipment_index_key = 'FFS_Host_SystemHalt') or (wesi.value = 'false' and wesi.equipment_index_key = 'FFS_Host_SystemActions') THEN
'关闭'
ELSE
'--'
END AS systemStatus,
wesi.update_date,
ROW_NUMBER() OVER ( PARTITION BY wesi.equipment_specific_id ORDER BY wesi.update_date DESC ) AS rn
FROM
wl_equipment_specific_index wesi
JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, wes.system_id )
<where>
fs.system_type_code IS NOT NULL
<iftest="bizOrgCode != null and bizOrgCode != ''">
AND wes.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
<iftest="code != null and code != ''">
AND fs.code = #{code}
</if>
<iftest="typeCode != null and typeCode != ''">
AND fs.system_type_code = #{typeCode}
</if>
<!-- <if test="indexKeyForStart != null and indexKeyForStart != ''">-->
<!-- AND wesi.equipment_index_key = #{indexKeyForStart}-->
<!-- </if>-->
<iftest="equipmentCodeForStart != null and equipmentCodeForStart != ''">
AND LOCATE(#{equipmentCodeForStart}, wes.equipment_code) > 0
</if>
AND wesi.equipment_index_key IN ('FFS_Host_SystemHalt', 'FFS_Host_SystemActions')
WHEN (wesi.value = 'false' and wesi.equipment_index_key = 'FFS_Host_AutomaticStatus') or (wesi.value = 'true' and wesi.equipment_index_key = 'FFS_Host_ManualState') THEN
'手动'
WHEN (wesi.value = 'true' and wesi.equipment_index_key = 'FFS_Host_AutomaticStatus') or (wesi.value = 'false' and wesi.equipment_index_key = 'FFS_Host_ManualState') THEN
'自动'
ELSE
'--'
END AS systemStatus,
wesi.update_date,
ROW_NUMBER() OVER ( PARTITION BY wesi.equipment_specific_id ORDER BY wesi.update_date DESC ) AS rn
FROM
wl_equipment_specific_index wesi
JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, wes.system_id )
<where>
fs.system_type_code IS NOT NULL
<iftest="bizOrgCode != null and bizOrgCode != ''">
AND wes.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
<iftest="code != null and code != ''">
AND fs.code = #{code}
</if>
<iftest="typeCode != null and typeCode != ''">
AND fs.system_type_code = #{typeCode}
</if>
<iftest="equipmentCodeForStart != null and equipmentCodeForStart != ''">
AND LOCATE(#{equipmentCodeForStart}, wes.equipment_code) > 0
</if>
AND wesi.equipment_index_key IN ('FFS_Host_AutomaticStatus', 'FFS_Host_ManualState')