Commit 79450144 authored by zhoushiguang's avatar zhoushiguang

SQL优化

parent 8fa379ad
......@@ -260,6 +260,7 @@
round(AVG(queue_length)) avg_queue_length,
round(AVG(stop_times),2) stop_times,
round(AVG(delay_time),2) delay_time,
round(AVG(traffic_index),2) traffic_index,
round(AVG(sturation),4) sturation,
group_concat(service_level) service_level
FROM
......@@ -282,6 +283,7 @@
null as lane_no,
null as turn_type,
null as service_level,
traffic_index,
</when>
<!-- 转向级 -->
<when test="objectType==2">
......@@ -289,6 +291,7 @@
t.turn_type,
null as lane_no,
null as service_level,
traffic_index,
</when>
<!-- 车道级 -->
<when test="objectType==3">
......@@ -296,6 +299,7 @@
t2.dir as dir_type,
t2.turn as turn_type,
null as service_level,
null as traffic_index,
</when>
<!-- 路口级 -->
<when test="objectType==4">
......@@ -303,6 +307,7 @@
null as dir_type,
null as turn_type,
ifnull(service_level,'A') service_level,
traffic_index,
</when>
<otherwise>
</otherwise>
......@@ -339,7 +344,8 @@
and t.cross_id = #{crossId}
</if>
<if test="startDate !=null and endDate !=null">
AND start_time >= #{startDate} and start_time &lt; #{endDate}
<!-- AND start_time >= #{startDate} and start_time &lt; #{endDate} -->
and batch_time between UNIX_TIMESTAMP(#{startDate}) and UNIX_TIMESTAMP(#{endDate})
</if>
) t
<choose>
......
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