(SELECT supervise_org_name from tz_base_enterprise_info where use_unit_code = use.USE_UNIT_CREDIT_CODE) as supervisoryUnitName,
(SELECT supervise_org_name from tz_base_enterprise_info where use_unit_code = use.USE_UNIT_CREDIT_CODE) as supervisoryUnitName,
(SELECT supervise_org_code from tz_base_enterprise_info where use_unit_code = use.USE_UNIT_CREDIT_CODE) as supervisoryUnitOrgCode
(SELECT supervise_org_code from tz_base_enterprise_info where use_unit_code = use.USE_UNIT_CREDIT_CODE) as supervisoryUnitOrgCode
from tz_alert_called tac
from tz_alert_called tac
LEFT JOIN idx_biz_jg_use_info use on tac.equipment_id = use.RECORD
LEFT JOIN idx_biz_jg_use_info use on tac.equipment_id = use.RECORD
left join tz_base_unit_licence ul ON use.USE_UNIT_CREDIT_CODE = ul.unit_code
WHERE tac.alarm_type_code != '962'
WHERE tac.alarm_type_code != '962'
and tac.equipment_id is not null
and tac.equipment_id is not null
and use.ADDRESS is not null
and use.ADDRESS is not null
...
@@ -40,7 +42,14 @@
...
@@ -40,7 +42,14 @@
SELECT count(1) from tz_alert_called where alarm_type_code = '960' and equipment_id = #{equipmentId} and call_time between #{startDate} and #{endDate}
SELECT count(1) from tz_alert_called where alarm_type_code = '960' and equipment_id = #{equipmentId} and call_time between #{startDate} and #{endDate}
and father_alert is null
and father_alert is null
) as trappedNum,
) as trappedNum,
(
SELECT equipment_classification_code from tz_alert_called where alarm_type_code = '960' and equipment_id = #{equipmentId} and call_time between #{startDate} and #{endDate}
and father_alert is null group by equipment_id limit 1
) as equipmentClassificationCode,
(
SELECT equipment_classification from tz_alert_called where alarm_type_code = '960' and equipment_id = #{equipmentId} and call_time between #{startDate} and #{endDate}
and father_alert is null group by equipment_id limit 1
) as equipmentClassification,
(
(
SELECT count(1) from tz_alert_called where alarm_type_code = '961' and equipment_id = #{equipmentId} and call_time between #{startDate} and #{endDate}
SELECT count(1) from tz_alert_called where alarm_type_code = '961' and equipment_id = #{equipmentId} and call_time between #{startDate} and #{endDate}