Commit bd0bb7c8 authored by KeYong's avatar KeYong

修改消防炮状态和流量取值问题

parent 4e249086
...@@ -246,27 +246,20 @@ ...@@ -246,27 +246,20 @@
wel.warehouse_structure_id ,wel.equipment_code wel.warehouse_structure_id ,wel.equipment_code
</select> </select>
<select id="selectFireMonitor" resultType="java.util.Map"> <select id="selectFireMonitor" resultType="java.util.Map">
SELECT temp.name, temp.alarm ,temp.id, temp.code, SELECT
temp.name,
temp.alarm,
temp.id,
temp.code,
IFNULL((SELECT wesi.value FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = temp.id AND wesi.equipment_index_key = 'CAFS_CAFSFireGun_FireGunPressure' IFNULL((SELECT wesi.value FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = temp.id AND wesi.equipment_index_key = 'CAFS_CAFSFireGun_FireGunPressure'
ORDER BY wesi.update_date desc LIMIT 1),0) AS value, ORDER BY wesi.update_date desc LIMIT 1), 0) AS value,
IFNULL((SELECT CASE WHEN wesi.value_label IS NULL OR trim( wesi.value_label ) = '' THEN (CASE IFNULL((SELECT CASE WHEN wesi.`value` = 'true' THEN wesi.equipment_index_name ELSE '关到位' END FROM wl_equipment_specific_index wesi
wesi.`value` WHERE wesi.equipment_specific_id = temp.id AND wesi.equipment_index_key = 'CAFS_GunValve_Open' ORDER BY wesi.update_date DESC LIMIT 1),'关到位') AS status,
WHEN 'true' THEN IFNULL((SELECT wesi.`value` FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = temp.id AND wesi.equipment_index_key = 'CAFS_GunValve_Flow' ORDER BY wesi.update_date DESC LIMIT 1), 0) AS flow
concat( wesi.equipment_index_name, '(是)' ) FROM
WHEN 'false' THEN (
concat( wesi.equipment_index_name, '(否)' )
ELSE
wesi.equipment_index_name
END) ELSE wesi.value_label END FROM wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_index wei on wesi.equipment_index_id = wei.id
WHERE wesi.equipment_specific_id = temp.id AND wei.is_trend = 0
AND wesi.value is NOT NULL AND wesi.value <![CDATA[<>]]> ''
ORDER BY wesi.update_date desc LIMIT 1),'--') AS status,
'0' AS flow
FROM(
SELECT wes.id,wes.name,wes.code, SELECT wes.id,wes.name,wes.code,
CASE CASE WHEN (SELECT is_alarm FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key ) = 1
WHEN ( SELECT is_alarm FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key ) = 1
AND wes.realtime_iot_index_value = 'true' THEN AND wes.realtime_iot_index_value = 'true' THEN
1 ELSE 0 1 ELSE 0
END AS alarm END AS alarm
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment