and alert_id in (SELECT sequence_nbr from tz_alert_called where alarm_type_code = '960' and call_time between #{startDate} and #{endDate})
and alert_id in (SELECT sequence_nbr from tz_alert_called where alarm_type_code = '960' and call_time between #{startDate} and #{endDate} and father_alert is null)
(select count(1) from tz_alert_called where alarm_type_code = '961' and call_time between #{startDate} and #{endDate}) as faultNum,
(select count(1) from tz_alert_called where alarm_type_code = '961' and call_time between #{startDate} and #{endDate} and father_alert is null) as faultNum,
(select count(1) from tz_alert_called where alarm_type_code = '960' and call_time between #{startDate} and #{endDate} ) as trappedNum
(select count(1) from tz_alert_called where alarm_type_code = '960' and call_time between #{startDate} and #{endDate} and father_alert is null ) as trappedNum
LEFT JOIN idx_biz_jg_use_info t2 ON t1.equipment_id = t2.RECORD WHERE t2.USE_PLACE = #{placeCode} and t1.alarm_type_code = '960' and t1.call_time between #{startDate} and #{endDate}) as trappedNum,
LEFT JOIN idx_biz_jg_use_info t2 ON t1.equipment_id = t2.RECORD WHERE t2.USE_PLACE = #{placeCode} and t1.alarm_type_code = '960' and t1.call_time between #{startDate} and #{endDate} and father_alert is null) as trappedNum,
(SELECT count(1) FROM
(SELECT count(1) FROM
tz_alert_called t1
tz_alert_called t1
LEFT JOIN idx_biz_jg_use_info t2 ON t1.equipment_id = t2.RECORD WHERE t2.USE_PLACE = #{placeCode} and t1.alarm_type_code = '961' and t1.call_time between #{startDate} and #{endDate}) as faultNum
LEFT JOIN idx_biz_jg_use_info t2 ON t1.equipment_id = t2.RECORD WHERE t2.USE_PLACE = #{placeCode} and t1.alarm_type_code = '961' and t1.call_time between #{startDate} and #{endDate} and father_alert is null) as faultNum
where alert_id in (SELECT sequence_nbr from tz_alert_called where biz_org_code like concat(#{orgCode}, '%') and call_time BETWEEN #{startDate} and #{endDate} and alarm_type_code = '960')
where alert_id in (SELECT sequence_nbr from tz_alert_called where biz_org_code like concat(#{orgCode}, '%') and call_time BETWEEN #{startDate} and #{endDate} and alarm_type_code = '960' and father_alert is null)
and org_type_code = 'levelOneUnit') as levelOne,
and org_type_code = 'levelOneUnit') as levelOne,
(select count(1)
(select count(1)
from tz_dispatch_task
from tz_dispatch_task
where alert_id in (SELECT sequence_nbr from tz_alert_called where biz_org_code like concat(#{orgCode}, '%') and call_time BETWEEN #{startDate} and #{endDate} and alarm_type_code = '960')
where alert_id in (SELECT sequence_nbr from tz_alert_called where biz_org_code like concat(#{orgCode}, '%') and call_time BETWEEN #{startDate} and #{endDate} and alarm_type_code = '960' and father_alert is null)
and org_type_code = 'levelTwoUnit') as levelTwo,
and org_type_code = 'levelTwoUnit') as levelTwo,
(select count(1)
(select count(1)
from tz_dispatch_task
from tz_dispatch_task
where alert_id in (SELECT sequence_nbr from tz_alert_called where biz_org_code like concat(#{orgCode}, '%') and call_time BETWEEN #{startDate} and #{endDate} and alarm_type_code = '960')
where alert_id in (SELECT sequence_nbr from tz_alert_called where biz_org_code like concat(#{orgCode}, '%') and call_time BETWEEN #{startDate} and #{endDate} and alarm_type_code = '960' and father_alert is null)
and org_type_code = '953') as levelThree,
and org_type_code = '953') as levelThree,
(select count(DISTINCT (response_org_id))
(select count(DISTINCT (response_org_id))
from tz_dispatch_task
from tz_dispatch_task
where alert_id in (SELECT sequence_nbr from tz_alert_called where biz_org_code like concat(#{orgCode}, '%') and call_time BETWEEN #{startDate} and #{endDate} and alarm_type_code = '960')
where alert_id in (SELECT sequence_nbr from tz_alert_called where biz_org_code like concat(#{orgCode}, '%') and call_time BETWEEN #{startDate} and #{endDate} and alarm_type_code = '960' and father_alert is null)
and org_type_code = 'levelOneUnit') as maintenanceUnit,
and org_type_code = 'levelOneUnit') as maintenanceUnit,
( SELECT count(1) from (
( SELECT count(1) from (
...
@@ -28,11 +28,11 @@
...
@@ -28,11 +28,11 @@
(SELECT min(dispatch_time) from tz_dispatch_task where alert_id = t1.sequence_nbr and dispatch_time is not null ) as dis
(SELECT min(dispatch_time) from tz_dispatch_task where alert_id = t1.sequence_nbr and dispatch_time is not null ) as dis
from tz_alert_called t1 where t1.biz_org_code like concat(#{orgCode}, '%') and t1.alarm_type_code = '960' and call_time BETWEEN #{startDate} and #{endDate}
from tz_alert_called t1 where t1.biz_org_code like concat(#{orgCode}, '%') and t1.alarm_type_code = '960' and call_time BETWEEN #{startDate} and #{endDate} and father_alert is null
) where extract(epoch from arr - dis ) < 1800
) where extract(epoch from arr - dis ) < 1800
) as lessNum,
) as lessNum,
(SELECT count(1) from tz_alert_called where biz_org_code like concat(#{orgCode}, '%') and alarm_type_code = '960' and call_time BETWEEN #{startDate} and #{endDate}) as greaterNum,
(SELECT count(1) from tz_alert_called where biz_org_code like concat(#{orgCode}, '%') and alarm_type_code = '960' and call_time BETWEEN #{startDate} and #{endDate} and father_alert is null) as greaterNum,
(
(
SELECT sum(extract(epoch from arr - dis )) from
SELECT sum(extract(epoch from arr - dis )) from
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
(SELECT min(dispatch_time) from tz_dispatch_task where alert_id = t1.sequence_nbr and dispatch_time is not null ) as dis
(SELECT min(dispatch_time) from tz_dispatch_task where alert_id = t1.sequence_nbr and dispatch_time is not null ) as dis
from tz_alert_called t1 where t1.biz_org_code like concat('50', '%') and t1.alarm_type_code = '960' and call_time BETWEEN #{startDate} and #{endDate}
from tz_alert_called t1 where t1.biz_org_code like concat('50', '%') and t1.alarm_type_code = '960' and t1.call_time BETWEEN #{startDate} and #{endDate} and t1.father_alert is null