left join t_base_cross_info b on a.cross_id = b.id
where DATE_FORMAT(a.start_time,'%Y-%m-%d') = DATE_FORMAT(DATE_SUB(now(),INTERVAL 1 DAY),'%Y-%m-%d') and a.type in (701,702,703,707)
where dt = DATE_FORMAT(DATE_SUB(now(),INTERVAL 1 DAY),'%Y%m%d') and a.type in (701,702,703,707)
group by a.cross_id, b.area_id,a.category,a.type
ON DUPLICATE KEY UPDATE
id=VALUES(id),
cross_id=VALUES(cross_id),
...
...
@@ -221,10 +252,15 @@
window_start_time=VALUES(window_start_time),
window_end_time=VALUES(window_end_time),
dt=VALUES(dt),
insert_time=VALUES(insert_time)
</insert>
insert_time=VALUES(insert_time),
serious_time_span=VALUES(serious_time_span),
serious_duration=VALUES(serious_duration),
time_span_list=VALUES(time_span_list),
week_day=VALUES(week_day),
year_week=VALUES(year_week)
</insert>
<!-- 新增表t_analysis_problem_cross_dir_hour信息 -->
<!-- 新增表t_analysis_problem_cross_dir_hour信息 -->
<insertid="insertAnalysisProblemCrossHour">
insert into t_analysis_problem_cross_dir_hour (id,cross_id,area_id,event_category,event_type,dir,event_number,event_total_time,window_start_time,window_end_time,dt,insert_time)
select uuid(), d.cross_id, e.area_id,d.category,d.type,d.dir,count(1) as event_number , sum( TIMESTAMPDIFF(SECOND, d.start_time , d.end_time) ) as duration ,