Commit aad0a4ad authored by duanruiming's avatar duanruiming

[add] AI路口列表查询优化

parent 16d28797
...@@ -9,9 +9,10 @@ ...@@ -9,9 +9,10 @@
<select id="selectAICrossList" resultType="net.wanji.opt.synthesis.pojo.StrategyCrossResultEntity"> <select id="selectAICrossList" resultType="net.wanji.opt.synthesis.pojo.StrategyCrossResultEntity">
select t1.id as crossId, t1.name as crossName, t2.issue_time, t2.current_algo, t2.response_code, t1.location as responseContent from select t1.id as crossId, t1.name as crossName, t2.issue_time, t2.current_algo, t2.response_code, t1.location as responseContent from
(select id, name, location from t_base_cross_info where is_signal = 1) t1 (select id, name, location from t_base_cross_info where is_signal = 1) t1
left join (select cross_id, max(issue_time) issue_time, current_algo, response_code from t_strategy_cross_result group by cross_id) t2 left join (select cross_id, max(issue_time) issue_time, current_algo,
response_code from t_strategy_cross_result where issue_time > CURDATE() group by cross_id) t2
on t1.id = t2.cross_id on t1.id = t2.cross_id
and t2.issue_time > DATE_FORMAT(now(),'%Y-%m-%d 00:00:00') and t2.issue_time > CURDATE()
order by t2.issue_time desc order by t2.issue_time desc
<!-- select t1.id as cross_id, t1.name as cross_name, t2.current_algo, t2.issue_time--> <!-- select t1.id as cross_id, t1.name as cross_name, t2.current_algo, t2.issue_time-->
<!-- from t_base_cross_info t1 left join--> <!-- from t_base_cross_info t1 left join-->
......
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