Commit 29135069 authored by zhoushiguang's avatar zhoushiguang

研判分析-区域/路口排查缓行事件,定时计算的路口缓行事件只用于干线路口排名趋势使用

parent 9acb81ab
...@@ -274,7 +274,7 @@ ...@@ -274,7 +274,7 @@
a.category, a.category,
a.type, a.type,
count(1) as event_number , sum( TIMESTAMPDIFF(SECOND, a.start_time , a.end_time) ) as duration , count(1) as event_number , sum( TIMESTAMPDIFF(SECOND, a.start_time , a.end_time) ) as duration ,
DATE_FORMAT(DATE_SUB(now(),INTERVAL 1 DAY),'%Y%m%d') as dt , now(), dt , now(),
SUBSTRING_INDEX( SUBSTRING_INDEX(
GROUP_CONCAT( GROUP_CONCAT(
CONCAT( CONCAT(
...@@ -316,7 +316,6 @@ ...@@ -316,7 +316,6 @@
count(*)>=2 count(*)>=2
) a ) a
left join t_base_cross_info b on a.cross_id = b.id left join t_base_cross_info b on a.cross_id = b.id
where a.dt = DATE_FORMAT(DATE_SUB(now(),INTERVAL 1 DAY),'%Y%m%d')
group by a.cross_id, b.area_id,a.category,a.type group by a.cross_id, b.area_id,a.category,a.type
ON DUPLICATE KEY UPDATE ON DUPLICATE KEY UPDATE
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
<if test="areaId != null and areaId != ''"> <if test="areaId != null and areaId != ''">
and tapcd.area_id = #{areaId} and tapcd.area_id = #{areaId}
</if> </if>
and tapcd.event_type != 708
GROUP BY tapcd.event_type GROUP BY tapcd.event_type
union union
SELECT sum(event_number) as event_number, SELECT sum(event_number) as event_number,
...@@ -53,6 +54,7 @@ ...@@ -53,6 +54,7 @@
<if test="areaId != null and areaId != ''"> <if test="areaId != null and areaId != ''">
and t1.area_id = #{areaId} and t1.area_id = #{areaId}
</if> </if>
and t1.event_type != 708
GROUP BY dt, t1.event_type GROUP BY dt, t1.event_type
UNION UNION
SELECT SELECT
......
...@@ -321,6 +321,7 @@ ...@@ -321,6 +321,7 @@
<if test="crossId!=null and crossId!=''"> <if test="crossId!=null and crossId!=''">
and tapcd.cross_id = #{crossId} and tapcd.cross_id = #{crossId}
</if> </if>
and tapcd.event_type != 708
GROUP BY tapcd.event_type GROUP BY tapcd.event_type
</select> </select>
...@@ -341,6 +342,7 @@ ...@@ -341,6 +342,7 @@
<if test="crossId != null and crossId != ''"> <if test="crossId != null and crossId != ''">
and t1.cross_id = #{crossId} and t1.cross_id = #{crossId}
</if> </if>
and t1.event_type != 708
GROUP BY dt, t1.event_type GROUP BY dt, t1.event_type
ORDER BY dt ORDER BY dt
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment