Commit 0138e702 authored by KeYong's avatar KeYong

修改给水系统bug

parent 462a1045
...@@ -327,6 +327,8 @@ ...@@ -327,6 +327,8 @@
temp.name, temp.name,
temp.nowPressure, temp.nowPressure,
temp.area, temp.area,
temp.minPressure AS `minValue`,
temp.maxPressure AS `maxValue`,
CASE CASE
WHEN temp.nowPressure = '--' THEN WHEN temp.nowPressure = '--' THEN
'--' '--'
...@@ -334,13 +336,9 @@ ...@@ -334,13 +336,9 @@
'--' '--'
WHEN temp.minPressure = '' THEN WHEN temp.minPressure = '' THEN
'--' '--'
WHEN ( temp.maxPressure = 0 ) THEN WHEN (temp.nowPressure - temp.maxPressure) > 0 THEN
'--'
WHEN ( temp.minPressure = 0 ) THEN
'--'
WHEN temp.nowPressure - temp.maxPressure > 0 THEN
'压力高' '压力高'
WHEN temp.minPressure - temp.nowPressure > 0 THEN WHEN (temp.minPressure - temp.nowPressure) > 0 THEN
'压力低' ELSE '正常' '压力低' ELSE '正常'
END AS status, END AS status,
1 AS type 1 AS type
...@@ -351,8 +349,8 @@ ...@@ -351,8 +349,8 @@
wes.name, wes.name,
concat_ws( '-', ws.full_name, ed.area ) area, concat_ws( '-', ws.full_name, ed.area ) area,
IFNULL( ( SELECT VALUE FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'FHS_PipePressureDetector_PipePressure' ), '--' ) AS nowPressure, IFNULL( ( SELECT VALUE FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'FHS_PipePressureDetector_PipePressure' ), '--' ) AS nowPressure,
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxPressure' ), 0 ) AS maxPressure, IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxPressure' AND field_value <![CDATA[<>]]> '' ), 1.5 ) AS maxPressure,
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'minPressure' ), 0 ) AS minPressure IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'minPressure' AND field_value <![CDATA[<>]]> '' ), 0.5 ) AS minPressure
FROM FROM
wl_equipment_specific wes wl_equipment_specific wes
LEFT JOIN wl_equipment_detail ed ON wes.equipment_detail_id = ed.id LEFT JOIN wl_equipment_detail ed ON wes.equipment_detail_id = ed.id
...@@ -368,22 +366,20 @@ ...@@ -368,22 +366,20 @@
temp.name, temp.name,
temp.nowFlow, temp.nowFlow,
temp.area, temp.area,
temp.minFlow AS `minValue`,
temp.maxFlow AS `maxValue`,
CASE CASE
WHEN temp.nowFlow = '--' THEN WHEN temp.nowFlow = '--' THEN
'--' '--'
WHEN temp.maxFlow = '' THEN WHEN temp.maxFlow = '' THEN
'--' '--'
WHEN temp.minFlow = '' THEN WHEN temp.minFlow = '' THEN
'--' '--'
WHEN ( temp.maxFlow = 0 ) THEN WHEN (temp.nowFlow - IFNULL(temp.maxFlow, 0)) > 0 THEN
'--' '流量高'
WHEN ( temp.minFlow = 0 ) THEN WHEN (IFNULL(temp.minFlow, 0) - temp.nowFlow) > 0 THEN
'--' '流量低' ELSE '正常'
WHEN temp.nowFlow - temp.maxFlow > 0 THEN END AS status,
'流量高'
WHEN temp.minFlow - temp.nowFlow > 0 THEN
'流量低' ELSE '正常'
END AS status,
2 AS type 2 AS type
FROM FROM
( (
...@@ -392,8 +388,8 @@ ...@@ -392,8 +388,8 @@
wes.NAME, wes.NAME,
concat_ws( '-', ws.full_name, ed.area ) area, concat_ws( '-', ws.full_name, ed.area ) area,
IFNULL( ( SELECT VALUE FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'FHS_FirePoolDevice_InfluentFlow' ), '--' ) AS nowFlow, IFNULL( ( SELECT VALUE FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'FHS_FirePoolDevice_InfluentFlow' ), '--' ) AS nowFlow,
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxFlow' ), 0 ) AS maxFlow, IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxFlow' AND field_value <![CDATA[<>]]> '' ), 2.4 ) AS maxFlow,
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'minFlow' ), 0 ) AS minFlow IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'minFlow' AND field_value <![CDATA[<>]]> '' ), 0.5 ) AS minFlow
FROM FROM
wl_equipment_specific wes wl_equipment_specific wes
LEFT JOIN wl_equipment_detail ed ON wes.equipment_detail_id = ed.id LEFT JOIN wl_equipment_detail ed ON wes.equipment_detail_id = ed.id
......
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