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