Commit c0ae476d authored by maoying's avatar maoying

修改排油系统数据查询

parent b0fa47e2
......@@ -222,21 +222,9 @@
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.name,
IFNULL(
(
SELECT
wesi.equipment_index_name
FROM
wl_equipment_specific_index wesi
WHERE
wesi.equipment_specific_id = wes.id
AND wesi.is_alarm = 1 AND wesi.`value` is not NULL
ORDER BY
wesi.update_date DESC
LIMIT 1
),
'--'
) AS status,
IFNULL(wes.realtime_iot_index_name,
'--'
) AS status,
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
......@@ -258,21 +246,9 @@
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.name,
IFNULL(
(
SELECT
wesi.equipment_index_name
FROM
wl_equipment_specific_index wesi
WHERE
wesi.equipment_specific_id = wes.id
AND wesi.is_alarm = 1 AND wesi.`value` is not NULL
ORDER BY
wesi.update_date DESC
LIMIT 1
),
'--'
) AS status,
IFNULL(wes.realtime_iot_index_name,
'--'
) AS status,
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
......@@ -295,21 +271,9 @@
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.name,
IFNULL(
(
SELECT
wesi.equipment_index_name
FROM
wl_equipment_specific_index wesi
WHERE
wesi.equipment_specific_id = wes.id
AND wesi.is_alarm = 1 AND wesi.`value` is not NULL
ORDER BY
wesi.update_date DESC
LIMIT 1
),
'--'
) AS status,
IFNULL(wes.realtime_iot_index_name,
'--'
) AS status,
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
......@@ -332,19 +296,7 @@
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.name,
IFNULL(
(
SELECT
wesi.equipment_index_name
FROM
wl_equipment_specific_index wesi
WHERE
wesi.equipment_specific_id = wes.id
AND wesi.is_alarm = 1 AND wesi.`value` is not NULL
ORDER BY
wesi.update_date DESC
LIMIT 1
),
IFNULL(wes.realtime_iot_index_name,
'--'
) AS status,
CASE
......
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