Commit 6879bee8 authored by 黄伟铭's avatar 黄伟铭

修正干线路口问题列表状态

parent d728164e
...@@ -40,10 +40,14 @@ public class TrunkLineImpl implements TrunkLineService { ...@@ -40,10 +40,14 @@ public class TrunkLineImpl implements TrunkLineService {
vo.setCrossID(e.getCrossID()); vo.setCrossID(e.getCrossID());
vo.setName(e.getName()); vo.setName(e.getName());
vo.setWkt(e.getWkt());
if (e.getDirection() != null) { if (e.getDirection() != null) {
String temp = e.getDirection().substring(1, e.getDirection().length() - 1);
temp = temp.replace("\"", "");
String[] temp1 = temp.split(",");
Map<String, Integer> directionMap = new HashMap<>(); Map<String, Integer> directionMap = new HashMap<>();
for (String s : e.getDirection()) { for (String s : temp1) {
directionMap.put(s, directionMap.getOrDefault(s, 0) + 1); directionMap.put(s, directionMap.getOrDefault(s, 0) + 1);
} }
......
...@@ -9,6 +9,7 @@ public class TrunkLineCrossProblemEntity { ...@@ -9,6 +9,7 @@ public class TrunkLineCrossProblemEntity {
private Integer inDir; private Integer inDir;
private Integer outDir; private Integer outDir;
private Integer status; private Integer status;
private String[] direction; private String direction;
private String startTime; private String startTime;
private String wkt;
} }
...@@ -23,6 +23,7 @@ public class TrunkLineCrossProblemVO { ...@@ -23,6 +23,7 @@ public class TrunkLineCrossProblemVO {
private String dir_1_name; private String dir_1_name;
@ApiModelProperty(value = "方向2") @ApiModelProperty(value = "方向2")
private String dir_2_name; private String dir_2_name;
@ApiModelProperty(value = "路口坐标")
private String wkt;
} }
...@@ -74,30 +74,17 @@ ...@@ -74,30 +74,17 @@
) b ) b
</select> </select>
<select id="getTrunkLineCrossProblem" parameterType="map" resultType="net.wanji.opt.synthesis.pojo.TrunkLineCrossProblemEntity"> <select id="getTrunkLineCrossProblem" parameterType="map" resultType="net.wanji.opt.synthesis.pojo.TrunkLineCrossProblemEntity">
select select a.cross_id,b.name,SUBSTR(b.location , 7 , LENGTH(b.location) - 7) as wkt,a.status,a.direction , a.start_time
a.cross_id, from t_cross_data_hist a
b.name, left join t_base_cross_info b on a.cross_id = b.id
a.`status`, where a.cross_id in (select cross_id from t_greenwave_cross where green_id = 1)
a.direction , <if test="time == null or time == '' ">
MAX(a.start_time) as start_time and DATE_FORMAT(a.start_time, '%Y-%m-%d %H:%i:00')= DATE_FORMAT(FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(DATE_SUB(now(),INTERVAL 5 MINUTE)) / 300 ) * 300), '%Y-%m-%d %H:%i:00')
from </if>
t_cross_data_hist a <if test="time != null and time != '' ">
left join t_base_cross_info b on and DATE_FORMAT(a.start_time, '%Y-%m-%d %H:%i:00')= DATE_FORMAT(FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(#{time}) / 300 ) * 300), '%Y-%m-%d %H:%i:00')
a.cross_id = b.id </if>
where
a.cross_id in (
select
cross_id
from
t_greenwave_cross
where
green_id = #{greenID})
<if test="time != null and time != ''">
and DATE_FORMAT(a.start_time, '%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> DATE_FORMAT(#{time}, '%Y-%m-%d %H:%i:%s')
</if>
group by
a.cross_id
</select> </select>
<select id="getIODir" parameterType="map" resultType="net.wanji.opt.synthesis.pojo.TrunkLineCrossProblemEntity"> <select id="getIODir" parameterType="map" resultType="net.wanji.opt.synthesis.pojo.TrunkLineCrossProblemEntity">
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