Commit 23f2c29c authored by wang yecheng's avatar wang yecheng

干线问题发生路段

parent 6d1592b4
......@@ -49,5 +49,7 @@ public interface AnalysisProblemGreenHourMapper extends BaseMapper<AnalysisProbl
List<AnalysisProblemGreenHour> detailGreenByProblemTrend(Map<String, Object> map);
List<AnalysisProblemGreenHour> detailGreenByCrossProblem(Map<String, Object> map);
List<AnalysisProblemGreenHour> detailGreenByRoadLineProblem(Map<String, Object> map);
}
......@@ -89,4 +89,7 @@ public class AnalysisProblemGreenHour implements Serializable {
private String crossName;
//按小时开始时间
private String hours_window_start_time;
//路段name
private String roadName;
}
......@@ -150,10 +150,14 @@ import java.util.stream.Collectors;
//按照路口
List<AnalysisProblemGreenHour>listCross=analysisProblemGreenHourMapper.detailGreenByCrossProblem(map);
//查询路段
List<AnalysisProblemGreenHour> listCrossLine = analysisProblemGreenHourMapper.detailGreenByRoadLineProblem(map);
//所有时间段
Set<String> allHourset=new LinkedHashSet();
//所有路口
Set<String> allCorss=new LinkedHashSet();
//所有路段
List<String> listRoadLine=new ArrayList<>();
String eventTypeCross="";
String typeNameCross="";
......@@ -180,10 +184,16 @@ import java.util.stream.Collectors;
String crossName = singcorss.getCrossName();
allCorss.add(crossName);
}
//取出路段
for (AnalysisProblemGreenHour roadLine: listCrossLine){
String roadName = roadLine.getRoadName();
listRoadLine.add(roadName);
}
JSONObject jsonObject =new JSONObject();
jsonObject.put("eventLabel",typeNameCross);
jsonObject.put("eventType",eventTypeCross);
jsonObject.put("mainCongestCrossName",allCorss);
jsonObject.put("mainCongestRoadName",listRoadLine);
jsonObject.put("timeList",allHourset);
return jsonObject;
}
......
......@@ -258,4 +258,41 @@
ORDER BY event_number desc
limit 2
</select>
<select id="detailGreenByRoadLineProblem" parameterType="map" resultMap="AnalysisProblemGreenHourMap">
SELECT
t1.cross_id,
t3.name as roadName
FROM
t_greenwave_cross t1
JOIN (
SELECT
cross_id,
traffic_index,
dir_type
FROM
t_cross_dir_data_hist
WHERE
1=1
<if test="startTime!=null and endTime!=null">
AND dt>= #{startTime} and dt &lt;= #{endTime}
</if>
GROUP BY
cross_id,
dir_type
)sub_t2
ON t1.cross_id =sub_t2.cross_id
JOIN t_base_rid_info t3
ON sub_t2.cross_id=t3.end_cross_id
AND sub_t2.dir_type=t3.in_dir
WHERE
1=1
<if test="greenId!=null and greenId!=''">
AND t1.green_id=#{greenId}
</if>
ORDER BY
sub_t2.traffic_index DESC
limit 1
</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