Browse Source

管控事件分析接口修改

develop
lau572 10 months ago
parent
commit
c145fc5224
  1. 14
      zc-business/src/main/resources/mapper/business/DcTrafficIncidentsMapper.xml

14
zc-business/src/main/resources/mapper/business/DcTrafficIncidentsMapper.xml

@ -186,7 +186,7 @@
ifNull(t2.buses,0) buses, ifNull(t2.buses,0) buses,
ifNull(t2.tankers,0) tankers ifNull(t2.tankers,0) tankers
from dc_event t1 from dc_event t1
left join dc_event_vehicle_accident t2 on t1.id = t2.id left join dc_event_accident t2 on t1.id = t2.id
where t1.event_type = '1' and t1.direction = #{direction} where t1.event_type = '1' and t1.direction = #{direction}
<if test="type != null and type == '1'.toString"> <if test="type != null and type == '1'.toString">
and DATE_FORMAT(t1.start_time,'%Y%m%d') = DATE_FORMAT(#{startTime},'%Y%m%d') and DATE_FORMAT(t1.start_time,'%Y%m%d') = DATE_FORMAT(#{startTime},'%Y%m%d')
@ -326,13 +326,13 @@
where where
t1.event_type = '1' and t1.direction = #{direction} t1.event_type = '1' and t1.direction = #{direction}
<if test="type != null and type == '1'.toString"> <if test="type != null and type == '1'.toString">
and DATE_FORMAT(t1.start_time,'%Y%m%d') = DATE_FORMAT(DATE_SUB(#{startTime},INTERVAL 1 DAY),'%Y%m%d') and DATE_FORMAT(t1.start_time,'%Y%m%d') = DATE_FORMAT(DATE_SUB(#{startTime},INTERVAL 1 YEAR),'%Y%m%d')
</if> </if>
<if test="type != null and type == '2'.toString"> <if test="type != null and type == '2'.toString">
and DATE_FORMAT(t1.start_time,'%Y%m') = DATE_FORMAT(DATE_SUB(#{startTime},INTERVAL 1 MONTH),'%Y%m') and DATE_FORMAT(t1.start_time,'%Y%m') = DATE_FORMAT(DATE_SUB(#{startTime},INTERVAL 1 YEAR),'%Y%m')
</if> </if>
<if test="type != null and type == '3'.toString"> <if test="type != null and type == '3'.toString">
and YEAR(t1.start_time) = YEAR(DATE_SUB(#{startTime},INTERVAL 1 QUARTER)) and QUARTER(t1.start_time) = QUARTER(DATE_SUB(#{startTime},INTERVAL 1 QUARTER)) and YEAR(t1.start_time) = YEAR(DATE_SUB(#{startTime},INTERVAL 1 YEAR)) and QUARTER(t1.start_time) = QUARTER(#{startTime})
</if> </if>
<if test="type != null and type == '4'.toString"> <if test="type != null and type == '4'.toString">
and YEAR(t1.start_time) = YEAR(DATE_SUB(#{startTime},INTERVAL 1 YEAR)) and YEAR(t1.start_time) = YEAR(DATE_SUB(#{startTime},INTERVAL 1 YEAR))
@ -384,13 +384,13 @@
from dc_event from dc_event
where event_type = '1' and direction = #{direction} where event_type = '1' and direction = #{direction}
<if test="type != null and type == '1'.toString"> <if test="type != null and type == '1'.toString">
and DATE_FORMAT(start_time,'%Y%m%d') = DATE_FORMAT(DATE_SUB(#{startTime},INTERVAL 1 DAY),'%Y%m%d') and DATE_FORMAT(start_time,'%Y%m%d') = DATE_FORMAT(DATE_SUB(#{startTime},INTERVAL 1 YEAR),'%Y%m%d')
</if> </if>
<if test="type != null and type == '2'.toString"> <if test="type != null and type == '2'.toString">
and DATE_FORMAT(start_time,'%Y%m') = DATE_FORMAT(DATE_SUB(#{startTime},INTERVAL 1 MONTH),'%Y%m') and DATE_FORMAT(start_time,'%Y%m') = DATE_FORMAT(DATE_SUB(#{startTime},INTERVAL 1 YEAR),'%Y%m')
</if> </if>
<if test="type != null and type == '3'.toString"> <if test="type != null and type == '3'.toString">
and YEAR(start_time) = YEAR(DATE_SUB(#{startTime},INTERVAL 1 QUARTER)) and QUARTER(start_time) = QUARTER(DATE_SUB(#{startTime},INTERVAL 1 QUARTER)) and YEAR(start_time) = YEAR(DATE_SUB(#{startTime},INTERVAL 1 YEAR)) and QUARTER(start_time) = QUARTER(#{startTime})
</if> </if>
<if test="type != null and type == '4'.toString"> <if test="type != null and type == '4'.toString">
and YEAR(start_time) = YEAR(DATE_SUB(#{startTime},INTERVAL 1 YEAR)) and YEAR(start_time) = YEAR(DATE_SUB(#{startTime},INTERVAL 1 YEAR))

Loading…
Cancel
Save