select t1.green_id as greenId, t1.control_time as endTime, t2.equip_code as equipCode, t2.id as induceId, t2.source_id as sourceId from
select t1.green_id as greenId,
(select green_id, max(control_time) control_time from t_strategy_green_opt_hist t1 where control_time > CURDATE() and control_method = -1 group by green_id) t1
t1.control_time as endTime,
left join t_greenwave_induces t2 on t1.green_id = t2.green_id
t2.equip_code as equipCode,
t2.id as induceId,
t2.source_id as sourceId
from (select green_id, max(control_time) control_time
from t_strategy_green_opt_hist t1
where control_time > CURDATE()
and control_method = -1
group by green_id) t1
left join t_greenwave_induces t2 on t1.green_id = t2.green_id
insert into t_analysis_green_wave_congest_time_span (green_id,road_direction,week_day,congest_start_time,congest_end_time,congest_index,status,travel_time,speed,peak_type,year_week,week_start_time,week_end_time,insert_time)
insert into t_analysis_green_wave_congest_time_span (green_id,road_direction,week_day,congest_start_time,congest_end_time,congest_index,status,travel_time,speed,peak_type,year_week,week_start_time,week_end_time,insert_time)
SELECT b.start_time as startTime,b.end_time as endTime,cycle from t_base_cross_section as b LEFT JOIN t_base_cross_scheme as c on b.scheme_id = c.id where b.cross_id = #{crossId} and b.plan_id = #{planId} ORDER BY start_time
SELECT b.start_time as startTime,b.end_time as endTime,cycle from t_base_cross_section as b LEFT JOIN t_base_cross_scheme as c on b.scheme_id = c.id where b.cross_id = #{crossId} and b.plan_id = #{planId} ORDER BY start_time
(select cross_id from t_greenwave_cross where green_id = #{greenId} and sort = 1) cross_data
(select cross_id from t_greenwave_cross where green_id = #{greenId} and is_key_route = 1) cross_data
left join
left join
(SELECT sum(flow) as flow,cross_id from t_cross_dir_data_hist where start_time BETWEEN #{startDate} AND #{endDate} AND TIME( start_time ) BETWEEN #{startTime} AND #{endTime} and dir_type = #{dir} GROUP BY cross_id) cross_flow on cross_data.cross_id = cross_flow.cross_id
(SELECT sum(flow) as flow,cross_id from t_cross_dir_data_hist where start_time BETWEEN #{startDate} AND #{endDate} AND TIME( start_time ) BETWEEN #{startTime} AND #{endTime} and dir_type = #{dir} GROUP BY cross_id) cross_flow on cross_data.cross_id = cross_flow.cross_id
</select>
</select>
...
@@ -83,4 +83,29 @@
...
@@ -83,4 +83,29 @@
and green_id = #{greenId}
and green_id = #{greenId}
and status >= 3 and road_direction = #{roadDirection} order by start_time
and status >= 3 and road_direction = #{roadDirection} order by start_time