Commit 3f5c9534 authored by hanbing's avatar hanbing

[update] 新信号评价-方案评价-修改SQL语法

parent b73d2e44
......@@ -440,9 +440,6 @@ public class SchemeEvaluateServiceImpl implements SchemeEvaluateService {
.mapToDouble(CrossTurnDataHistPO::getSturation)
.max()
.orElse(0);
metricsMap.put(StrategyAndMetricsEnum.Metrics.SATURATION.getCode(),
maxSaturation + StrategyAndMetricsEnum.Metrics.SATURATION.getUnit());
// 计算指标是否合格
boolean isQualified = calcSecurity(maxSaturation, OptionalDouble.of(clearRateMax));
if (!isQualified) {
......
......@@ -39,16 +39,24 @@
</select>
<select id="selectDirEmergencyCount" resultType="java.lang.Integer">
<choose>
<when test="laneIds != null and laneIds.size() > 0">
SELECT COUNT(*)
FROM holo_roadnet_jinan.t_event_info
WHERE type IN ('33', '34', '35', '6')
AND UNIX_TIMESTAMP(start_time) <![CDATA[ >= ]]> #{startStamp}
AND UNIX_TIMESTAMP(start_time) <![CDATA[ <= ]]> #{endStamp}
AND UNIX_TIMESTAMP(start_time) <![CDATA[ >= ]]> #{startTimeStamp}
AND UNIX_TIMESTAMP(start_time) <![CDATA[ <= ]]> #{endTimeStamp}
AND cross_id = #{crossId}
AND lane_id in
<foreach collection="laneIds" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</when>
<otherwise>
SELECT 0
</otherwise>
</choose>
</select>
</mapper>
......@@ -19,17 +19,25 @@
</select>
<select id="selectTurnEmergencyCount" resultType="java.lang.Integer">
<choose>
<when test="laneIds != null and laneIds.size() > 0">
SELECT COUNT(*)
FROM holo_roadnet_jinan.t_event_info
WHERE type IN ('33', '34', '35', '6')
AND UNIX_TIMESTAMP(start_time) <![CDATA[ >= ]]> #{startStamp}
AND UNIX_TIMESTAMP(start_time) <![CDATA[ <= ]]> #{endStamp}
AND UNIX_TIMESTAMP(start_time) <![CDATA[ >= ]]> #{startTimeStamp}
AND UNIX_TIMESTAMP(start_time) <![CDATA[ <= ]]> #{endTimeStamp}
AND cross_id = #{crossId}
AND lane_id in
<foreach collection="laneIds" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</when>
<otherwise>
SELECT 0
</otherwise>
</choose>
</select>
</mapper>
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