LEFT JOIN dc_event_traffic_control t2 on t1.id = t2.id
LEFT JOIN dc_facility t3 on t3.id = t2.facility_id
where
t1.event_type = '3' and t1.event_subclass = '3-2'
t1.event_type = '3' and t1.event_subclass = '3-2' and t1.event_state != '0'
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 t2.classify in ('6','7','9')
@ -288,7 +288,7 @@
sum(case when t2.control_type = '2' then 1 else 0 end) trafficRestriction
from dc_event t1 left join dc_event_traffic_control t2 on t1.id = t2.id
where (DATE_FORMAT(t1.start_time,'%Y-%m') = DATE_FORMAT(now(),'%Y-%m') or DATE_FORMAT(t1.end_time,'%Y-%m') = DATE_FORMAT(now(),'%Y-%m') or ISNULL(t1.end_time))
and t1.event_type = '3' and t1.event_subclass = '3-2'
and t1.event_type = '3' and t1.event_subclass = '3-2' and t1.event_state != '0'