|
|
@ -172,14 +172,26 @@ |
|
|
|
|
|
|
|
<select id="getAccidentVehicleAnalysis" resultType="java.util.Map"> |
|
|
|
select t1.id, |
|
|
|
case when ISNULL(end_time) then TIMESTAMPDIFF(MINUTE,start_time,now()) else TIMESTAMPDIFF(MINUTE,start_time,end_time) end minuteTime, |
|
|
|
case when ISNULL(t1.end_time) then TIMESTAMPDIFF(MINUTE,t1.start_time,now()) else TIMESTAMPDIFF(MINUTE,t1.start_time,t1.end_time) end minuteTime, |
|
|
|
ifNull(t2.small_car,0) smallCar, |
|
|
|
ifNull(t2.trucks,0) trucks, |
|
|
|
ifNull(t2.buses,0) buses, |
|
|
|
ifNull(t2.tankers,0) tankers |
|
|
|
from dc_event t1 |
|
|
|
left join dc_event_vehicle_accident t2 on t1.id = t2.id |
|
|
|
where event_type = '1' and date_format(start_time,'%Y-%m-%d') = current_date |
|
|
|
where t1.event_type = '1' and t1.direction = #{direction} |
|
|
|
<if test="type != null and type == '1'.toString"> |
|
|
|
and DATE_FORMAT(t1.start_time,'%Y%m%d') = DATE_FORMAT(#{startTime},'%Y%m%d') |
|
|
|
</if> |
|
|
|
<if test="type != null and type == '2'.toString"> |
|
|
|
and DATE_FORMAT(t1.start_time,'%Y%m') = DATE_FORMAT(#{startTime},'%Y%m') |
|
|
|
</if> |
|
|
|
<if test="type != null and type == '3'.toString"> |
|
|
|
and YEAR(t1.start_time) = YEAR(#{startTime}) and QUARTER(t1.start_time) = QUARTER(#{startTime}) |
|
|
|
</if> |
|
|
|
<if test="type != null and type == '4'.toString"> |
|
|
|
and YEAR(t1.start_time) = YEAR(#{startTime}) |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectTollStationAnalysis" resultType="java.util.Map"> |
|
|
|