privatefinalstaticStringINSERT_FLOW_EVENT="insert into d_flow_event ("+"task_id,event_type,event_time,event_id,device_code,device_name,location_code,location_name,json_data,pics,video_name,channel_unid) values("+":taskId,:eventType,:eventTime,:eventId,:deviceCode,:deviceName,:locationCode,:locationName,:jsonData,:pics,:videoName,:channelUnid)";
privatefinalstaticStringINSERT_FLOW_DATA="insert into d_flow_data ("+"flow_event_id,task_id,detection_type,road_code,direction_code,sample_dura,sample_num,velocity,velocity_unit,occupy,distance,queue_length,region_id,region_name,position_content,head_content,area,density,sample_num_in,sample_num_out,event_time,dist_time,time_occupy) values ("+":flowEventId,:taskId,:detectionType,:roadCode,:directionCode,:sampleDura,:sampleNum,:velocity,:velocityUnit,:occupy,:distance,:queueLength,:regionId,:regionName,:positionContent,:headContent,:area,:density,:sampleNumIn,:sampleNumOut,:eventTime,:distTime,:timeOccupy)";
privatefinalstaticStringINSERT_TRAFFIC="insert into d_traffic ("+"task_id,event_cate,event_type,event_time,channel_unid,plate_color,plate_number,location_code,location_name,lane_code,direction_code,vehicle_type,vehicle_color,vehicle_logo,illegal_code,illegal_state,feature_annual_inspection_mark,feature_pendant,feature_decoration,feature_sun_shield,xcycle_type,event_id,special_type,with_helmet,json_data,pics,video_name,company) values("+":taskId,:eventCate,:eventType,:eventTime,:channelUnid,:plateColor,:plateNumber,:locationCode,:locationName,:laneCode,:directionCode,:vehicleType,:vehicleColor,:vehicleLogo,:illegalCode,:illegalState,:featureAnnualInspectionMark,:featurePendant,:featureDecoration,:featureSunShield,:xcycleType,:eventId,:specialType,:withHelmet,:jsonData,:pics,:videoName,:company)";
privatefinalstaticStringINSERT_TRAFFIC_FACE="insert into d_traffic_face ("+"traffic_id,state,sex,upper_color,lower_color,event_time) values (:trafficId,:state,:sex,:upperColor,:lowerColor,:eventTime)";
jdbcTemplate.update("update d_data_statistic set traffic=?,flow=?,behavior=? where date=? and task_id=? and hour=?",traffic,flow,behavior,localDate,taskId,hour);
List<DataStatistic>query=jdbcTemplate.query("select * from d_data_statistic where date=? and task_id=?",newBeanPropertyRowMapper<>(DataStatistic.class),localDate,hour);
dataStatisticExample.createColumns().hasTaskIdColumn().addColumnStr("sum(traffic) as dataStatistic_traffic,sum(flow) as dataStatistic_flow,sum(behavior) as dataStatistic_behavior,max(task_name) as dataStatistic_task_name");
jdbcTemplate.query("select '过车数据' as dataType ,adddate(max(event_time), interval 8 hour) maxTime,adddate(min(event_time),interval 8 hour) minTime,count(pics) as picCount,count(video_name) as videoCount from d_traffic where event_type='vehicle' and illegal_state=0\n"+
"union\n"+
"select '违法数据' as dataType ,adddate(max(event_time), interval 8 hour) maxTime,adddate(min(event_time),interval 8 hour) minTime,count(pics) as picCount,count(video_name) as videoCount from d_traffic where event_type='vehicle' and illegal_state=1\n"+
"union\n"+
"select '非机动车数据' as dataType ,adddate(max(event_time), interval 8 hour) maxTime,adddate(min(event_time),interval 8 hour) minTime,count(pics) as picCount,count(video_name) as videoCount from d_traffic where event_type='xcycle'\n"+
"union\n"+
"select '行人数据' as dataType ,adddate(max(event_time), interval 8 hour) maxTime,adddate(min(event_time),interval 8 hour) minTime,count(pics) as picCount,count(video_name) as videoCount from d_traffic where event_type='pedestrian'\n"+
"union\n"+
"select '事件数据' as dataType ,adddate(max(event_time), interval 8 hour) maxTime,adddate(min(event_time),interval 8 hour) minTime,count(pics) as picCount,count(video) as videoCount from d_behavior",rs->{
jdbcTemplate.query("select '过车数据' as dataType ,adddate(max(event_time), interval 8 hour) maxTime,adddate(min(event_time),interval 8 hour) minTime,count(pics) as picCount,count(video_name) as videoCount from d_traffic where event_type='vehicle' and illegal_state=0\n"+"union\n"+"select '违法数据' as dataType ,adddate(max(event_time), interval 8 hour) maxTime,adddate(min(event_time),interval 8 hour) minTime,count(pics) as picCount,count(video_name) as videoCount from d_traffic where event_type='vehicle' and illegal_state=1\n"+"union\n"+"select '非机动车数据' as dataType ,adddate(max(event_time), interval 8 hour) maxTime,adddate(min(event_time),interval 8 hour) minTime,count(pics) as picCount,count(video_name) as videoCount from d_traffic where event_type='xcycle'\n"+"union\n"+"select '行人数据' as dataType ,adddate(max(event_time), interval 8 hour) maxTime,adddate(min(event_time),interval 8 hour) minTime,count(pics) as picCount,count(video_name) as videoCount from d_traffic where event_type='pedestrian'\n"+"union\n"+"select '事件数据' as dataType ,adddate(max(event_time), interval 8 hour) maxTime,adddate(min(event_time),interval 8 hour) minTime,count(pics) as picCount,count(video) as videoCount from d_behavior",rs->{