|
@ -226,7 +226,13 @@ |
|
|
UNION ALL select 5 control_cause,'' cause_type,'警备任务' controlCauseName,'' causeTypeName |
|
|
UNION ALL select 5 control_cause,'' cause_type,'警备任务' controlCauseName,'' causeTypeName |
|
|
UNION ALL select 6 control_cause,'' cause_type,'其他' controlCauseName,'' causeTypeName) t3 |
|
|
UNION ALL select 6 control_cause,'' cause_type,'其他' controlCauseName,'' causeTypeName) t3 |
|
|
LEFT JOIN |
|
|
LEFT JOIN |
|
|
(select t2.control_type,t2.control_cause,ifnull(t2.cause_type,'') cause_type,count(*) num,sum( |
|
|
(select t2.control_type,t2.control_cause, |
|
|
|
|
|
case when t2.cause_type = '4-1' then '' |
|
|
|
|
|
when t2.cause_type = '4-2' then '' |
|
|
|
|
|
when t2.cause_type = '4-3' then '' |
|
|
|
|
|
when ISNULL(t2.cause_type) then '' |
|
|
|
|
|
else cause_type end causeType, |
|
|
|
|
|
count(*) num,sum( |
|
|
case when date_format(#{startTime},'%Y-%m-%d %H:%i:%s') >= date_format(t1.start_time,'%Y-%m-%d %H:%i:%s') |
|
|
case when date_format(#{startTime},'%Y-%m-%d %H:%i:%s') >= date_format(t1.start_time,'%Y-%m-%d %H:%i:%s') |
|
|
and (DATE_FORMAT(t1.end_time,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(#{endTime},'%Y-%m-%d %H:%i:%s') or ISNULL(t1.end_time)) |
|
|
and (DATE_FORMAT(t1.end_time,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(#{endTime},'%Y-%m-%d %H:%i:%s') or ISNULL(t1.end_time)) |
|
|
then TIMESTAMPDIFF(MINUTE,t1.start_time,now()) |
|
|
then TIMESTAMPDIFF(MINUTE,t1.start_time,now()) |
|
@ -252,8 +258,8 @@ |
|
|
and date_format(t1.start_time,'%Y-%m-%d %H:%i:%s') <= date_format(#{endTime},'%Y-%m-%d %H:%i:%s') |
|
|
and date_format(t1.start_time,'%Y-%m-%d %H:%i:%s') <= date_format(#{endTime},'%Y-%m-%d %H:%i:%s') |
|
|
and (date_format(t1.end_time,'%Y-%m-%d %H:%i:%s') > date_format(#{startTime},'%Y-%m-%d %H:%i:%s') or ISNULL(t1.end_time)) |
|
|
and (date_format(t1.end_time,'%Y-%m-%d %H:%i:%s') > date_format(#{startTime},'%Y-%m-%d %H:%i:%s') or ISNULL(t1.end_time)) |
|
|
</where> |
|
|
</where> |
|
|
GROUP BY t2.control_cause,t2.cause_type) t4 |
|
|
GROUP BY t2.control_cause,causeType) t4 |
|
|
on t3.control_cause = t4.control_cause and t3.cause_type = t4.cause_type |
|
|
on t3.control_cause = t4.control_cause and t3.cause_type = t4.causeType |
|
|
ORDER BY t3.control_cause, t3.cause_type |
|
|
ORDER BY t3.control_cause, t3.cause_type |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
@ -406,7 +412,7 @@ |
|
|
|
|
|
|
|
|
<select id="selectTrafficControlAnalysis" resultType="java.util.Map"> |
|
|
<select id="selectTrafficControlAnalysis" resultType="java.util.Map"> |
|
|
select t1.controlCause,t1.controlCauseName,IFNULL(t2.facilityClose,0) facilityClose, |
|
|
select t1.controlCause,t1.controlCauseName,IFNULL(t2.facilityClose,0) facilityClose, |
|
|
IFNULL(t2.facilityRestriction,0) facilityRestriction,IFNULL(t2.facilityInterval,0) facilityInterval |
|
|
IFNULL(t2.facilityRestriction,0) facilityRestriction |
|
|
from |
|
|
from |
|
|
(select '1' controlCause,'车流量大' controlCauseName |
|
|
(select '1' controlCause,'车流量大' controlCauseName |
|
|
union all select '2' controlCause,'交通事故' controlCauseName |
|
|
union all select '2' controlCause,'交通事故' controlCauseName |
|
@ -418,9 +424,8 @@ |
|
|
left join |
|
|
left join |
|
|
(select |
|
|
(select |
|
|
t2.control_cause, |
|
|
t2.control_cause, |
|
|
SUM(case when t2.classify = '6' then 1 else 0 end) facilityClose, |
|
|
SUM(case when t2.control_type = '1' then 1 else 0 end) facilityClose, |
|
|
SUM(case when t2.classify = '7' then 1 else 0 end) facilityRestriction, |
|
|
SUM(case when t2.control_type = '2' then 1 else 0 end) facilityRestriction |
|
|
SUM(case when t2.classify = '9' then 1 else 0 end) facilityInterval |
|
|
|
|
|
from dc_event t1 |
|
|
from dc_event t1 |
|
|
LEFT JOIN dc_event_traffic_control t2 on t1.id = t2.id |
|
|
LEFT JOIN dc_event_traffic_control t2 on t1.id = t2.id |
|
|
where |
|
|
where |
|
|