|
@ -242,7 +242,11 @@ |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<select id="selectTollStationAnalysisByFacility" resultType="java.util.Map"> |
|
|
<select id="selectTollStationAnalysisByFacility" resultType="java.util.Map"> |
|
|
select |
|
|
SELECT t1.id,t1.facility_name facilityName,IFNULL(t2.facilityClose,0) facilityClose, |
|
|
|
|
|
IFNULL(t2.facilityInterval,0) facilityInterval,IFNULL(t2.facilityRestriction,0) facilityRestriction |
|
|
|
|
|
from dc_facility t1 |
|
|
|
|
|
LEFT JOIN |
|
|
|
|
|
(select |
|
|
t2.facility_id facilityId,t3.facility_name facilityName,classify, |
|
|
t2.facility_id facilityId,t3.facility_name facilityName,classify, |
|
|
SUM(case when t2.classify = '6' then 1 else 0 end) facilityClose, |
|
|
SUM(case when t2.classify = '6' then 1 else 0 end) facilityClose, |
|
|
SUM(case when t2.classify = '7' then 1 else 0 end) facilityRestriction, |
|
|
SUM(case when t2.classify = '7' then 1 else 0 end) facilityRestriction, |
|
@ -250,19 +254,21 @@ |
|
|
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 |
|
|
LEFT JOIN dc_facility t3 on t3.id = t2.facility_id |
|
|
LEFT JOIN dc_facility t3 on t3.id = t2.facility_id |
|
|
<where> |
|
|
where |
|
|
t1.event_type = '3' and t1.event_subclass = '3-2' |
|
|
t1.event_type = '3' and t1.event_subclass = '3-2' |
|
|
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)) |
|
|
and t2.classify in ('6','7','9') |
|
|
and t2.classify in ('6','7','9') |
|
|
|
|
|
GROUP BY t2.facility_id) t2 on t1.id = t2.facilityId |
|
|
|
|
|
<where> |
|
|
|
|
|
t1.facility_type = '1' |
|
|
<if test="facilityIdList != null and facilityIdList.length > 0"> |
|
|
<if test="facilityIdList != null and facilityIdList.length > 0"> |
|
|
AND t2.facility_id in |
|
|
AND t1.id in |
|
|
<foreach collection="facilityIdList" item="facilityId" open="(" separator="," close=")"> |
|
|
<foreach collection="facilityIdList" item="facilityId" open="(" separator="," close=")"> |
|
|
#{facilityId} |
|
|
#{facilityId} |
|
|
</foreach> |
|
|
</foreach> |
|
|
</if> |
|
|
</if> |
|
|
</where> |
|
|
</where> |
|
|
GROUP BY t2.facility_id |
|
|
|
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<select id="getTollStationAnalysis" resultType="java.util.Map"> |
|
|
<select id="getTollStationAnalysis" resultType="java.util.Map"> |
|
|