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_label IS NULL OR trim( wesi.value_label ) = '' THEN (CASE
...
@@ -127,7 +127,7 @@
...
@@ -127,7 +127,7 @@
ORDER BY wesi.update_date desc LIMIT 1),'--') AS status,
ORDER BY wesi.update_date desc LIMIT 1),'--') AS status,
'0' AS flow
'0' AS flow
FROM(
FROM(
SELECT wes.id,wes.name,
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
...
@@ -145,6 +145,7 @@
...
@@ -145,6 +145,7 @@
SELECT
SELECT
temp.id,
temp.id,
temp.name,
temp.name,
temp.code,
temp.nowLevel,
temp.nowLevel,
temp.volume,
temp.volume,
temp.unit,
temp.unit,
...
@@ -179,6 +180,7 @@
...
@@ -179,6 +180,7 @@
SELECT
SELECT
wes.id,
wes.id,
wes.name,
wes.name,
wes.code,
IFNULL( ( SELECT value FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'CAFS_FoamTank_FoamTankLevel' ), '--' ) AS nowLevel,
IFNULL( ( SELECT value FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'CAFS_FoamTank_FoamTankLevel' ), '--' ) AS nowLevel,
IFNULL( ( SELECT unit FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'CAFS_FoamTank_FoamTankLevel' ), '--' ) AS unit,
IFNULL( ( SELECT unit FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'CAFS_FoamTank_FoamTankLevel' ), '--' ) AS unit,
IFNULL(( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxLevel' ) , 0 )AS maxLevel,
IFNULL(( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxLevel' ) , 0 )AS maxLevel,
...
@@ -198,7 +200,7 @@
...
@@ -198,7 +200,7 @@
'1' as type,
'1' as type,
(SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi on wei.id = wesi.equipment_index_id
(SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi on wei.id = wesi.equipment_index_id
WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level,
WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level,
wes.equipment_code as code ,
wes.code as code ,
wes.name,
wes.name,
IFNULL(wes.realtime_iot_index_name,
IFNULL(wes.realtime_iot_index_name,
'暂无信号'
'暂无信号'
...
@@ -222,7 +224,7 @@
...
@@ -222,7 +224,7 @@
'2' as type,
'2' as type,
(SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi on wei.id = wesi.equipment_index_id
(SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi on wei.id = wesi.equipment_index_id
WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level,
WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level,
wes.equipment_code as code ,
wes.code as code ,
wes.name,
wes.name,
IFNULL(wes.realtime_iot_index_name,
IFNULL(wes.realtime_iot_index_name,
'暂无信号'
'暂无信号'
...
@@ -247,7 +249,7 @@
...
@@ -247,7 +249,7 @@
'3' as type,
'3' as type,
(SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi on wei.id = wesi.equipment_index_id
(SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi on wei.id = wesi.equipment_index_id
WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level,
WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level,
wes.equipment_code as code ,
wes.code as code ,
wes.name,
wes.name,
IFNULL(wes.realtime_iot_index_name,
IFNULL(wes.realtime_iot_index_name,
'暂无信号'
'暂无信号'
...
@@ -272,7 +274,7 @@
...
@@ -272,7 +274,7 @@
'4' as type,
'4' as type,
(SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi on wei.id = wesi.equipment_index_id
(SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi on wei.id = wesi.equipment_index_id
WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level,
WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level,
wes.equipment_code as code ,
wes.code as code ,
wes.name,
wes.name,
IFNULL(wes.realtime_iot_index_name,
IFNULL(wes.realtime_iot_index_name,
'暂无信号'
'暂无信号'
...
@@ -1170,6 +1172,7 @@
...
@@ -1170,6 +1172,7 @@
'未消除'
'未消除'
) cleanStatus,
) cleanStatus,
wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_code AS code,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName,