Commit 72bc7534 authored by duanruiming's avatar duanruiming

[add] 路口检测优化

parent 99cc37b2
...@@ -53,7 +53,7 @@ public class CrossController { ...@@ -53,7 +53,7 @@ public class CrossController {
date = DateUtil.now().substring(0, 10); date = DateUtil.now().substring(0, 10);
} }
Map<String, Object> result = crossService.getCrossStatusDistribution(crossID, date, groupType, objectType, condition); Map<String, Object> result = crossService.getCrossStatusDistribution(crossID, date, groupType, objectType, condition);
List<CrossStatusDisOptTimeEntity> optTimes = crossService.getOptTimeList(crossID); List<CrossStatusDisOptTimeEntity> optTimes = crossService.getOptTimeList(crossID, date);
List<CrossOrGreenWaveTypeEntity> typeList = crossService.getCrossTypeList(crossID, date); List<CrossOrGreenWaveTypeEntity> typeList = crossService.getCrossTypeList(crossID, date);
result.put("optTimesList", optTimes); result.put("optTimesList", optTimes);
result.put("typeList", typeList); result.put("typeList", typeList);
......
...@@ -18,7 +18,7 @@ public interface CrossMapper { ...@@ -18,7 +18,7 @@ public interface CrossMapper {
* 监测详情-路口事件详情-路口状态分布趋势-优化时间 * 监测详情-路口事件详情-路口状态分布趋势-优化时间
* @param crossID 路口ID * @param crossID 路口ID
*/ */
List<CrossStatusDisOptTimeEntity> getOptTimes(String crossID); List<CrossStatusDisOptTimeEntity> getOptTimes(String crossID, String date);
/** /**
* 监测详情-路口事件详情-路口实时告警 * 监测详情-路口事件详情-路口实时告警
......
...@@ -54,7 +54,7 @@ public interface CrossService { ...@@ -54,7 +54,7 @@ public interface CrossService {
* @param crossID 路口ID * @param crossID 路口ID
* @return * @return
*/ */
List<CrossStatusDisOptTimeEntity> getOptTimeList(String crossID); List<CrossStatusDisOptTimeEntity> getOptTimeList(String crossID, String date);
/** /**
* 获取路口基础信息————方向、转向、车道信息 * 获取路口基础信息————方向、转向、车道信息
......
...@@ -209,8 +209,9 @@ public class CrossServiceImpl implements CrossService { ...@@ -209,8 +209,9 @@ public class CrossServiceImpl implements CrossService {
} }
@Override @Override
public List<CrossStatusDisOptTimeEntity> getOptTimeList(String crossID) { public List<CrossStatusDisOptTimeEntity> getOptTimeList(String crossID, String date) {
return crossMapper.getOptTimes(crossID); String dt = date.substring(0, 10).replaceAll("-", "");
return crossMapper.getOptTimes(crossID, dt);
} }
/** /**
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
and a.cross_id = #{crossID} and a.cross_id = #{crossID}
and sign(a.rtn_type) = -1 and sign(a.rtn_type) = -1
and a.current_algo = 1 and a.current_algo = 1
and a.issue_time >= CURDATE() and a.dt = #{date}
union union
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
and a.cross_id = #{crossID} and a.cross_id = #{crossID}
and a.current_algo = 2 and a.current_algo = 2
and a.response_code = 200 and a.response_code = 200
and a.issue_time >= CURDATE() and a.dt = #{date}
union union
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
and a.cross_id = #{crossID} and a.cross_id = #{crossID}
and a.current_algo = 3 and a.current_algo = 3
and a.response_code = 200 and a.response_code = 200
and a.issue_time >= CURDATE() and a.dt = #{date}
) b ) b
order by b.issue_time order by b.issue_time
</select> </select>
......
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