Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
traffic-signal-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jinan
traffic-signal-platform
Commits
4780005e
Commit
4780005e
authored
Apr 30, 2025
by
wangyecheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
研判路口原因分析
parent
3628c3d9
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
1023 additions
and
188 deletions
+1023
-188
AnalysisProblemCrossDirHour.java
...opt/entity/judgeanalysis/AnalysisProblemCrossDirHour.java
+6
-3
AnalysisProblemCrossDirHourMapper.java
...pper/judgeanalysis/AnalysisProblemCrossDirHourMapper.java
+20
-0
AnalysisCrossHourOverFlowTask.java
...t/entity/judgeanalysis/AnalysisCrossHourOverFlowTask.java
+59
-0
AnalysisProblemCrossDirHour.java
...opt/entity/judgeanalysis/AnalysisProblemCrossDirHour.java
+13
-3
CrossCongestionLaneReasonInfo.java
...t/entity/judgeanalysis/CrossCongestionLaneReasonInfo.java
+13
-0
AnalysisProblemCrossDirHourServiceImpl.java
...analysis/impl/AnalysisProblemCrossDirHourServiceImpl.java
+761
-181
AnalysisProblemCrossDirHourMapper.xml
...apper/judgeanalysis/AnalysisProblemCrossDirHourMapper.xml
+151
-1
No files found.
signal-optimize-data-compute/src/main/java/net/wanji/opt/entity/judgeanalysis/AnalysisProblemCrossDirHour.java
View file @
4780005e
package
net
.
wanji
.
opt
.
entity
.
judgeanalysis
;
import
com.baomidou.mybatisplus.annotation.
TableName
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.
*
;
import
java.time.LocalDateTime
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.io.Serializable
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
...
...
@@ -79,12 +78,16 @@ public class AnalysisProblemCrossDirHour implements Serializable {
/***非数据库字段****/
//类型名称
@TableField
(
exist
=
false
)
private
String
typeName
;
//数量统计
@TableField
(
exist
=
false
)
private
String
countNumber
;
//按小时开始时间
@TableField
(
exist
=
false
)
private
String
hours_window_start_time
;
//开始时间 年月日时分秒
@TableField
(
exist
=
false
)
private
String
winStartTime
;
}
signal-optimize-service/src/main/java/net/wanji/opt/dao/mapper/judgeanalysis/AnalysisProblemCrossDirHourMapper.java
View file @
4780005e
package
net
.
wanji
.
opt
.
dao
.
mapper
.
judgeanalysis
;
import
net.wanji.databus.po.CrossDirDataHistPO
;
import
net.wanji.databus.po.CrossLaneDataHistPO
;
import
net.wanji.databus.po.CrossTurnDataHistPO
;
import
net.wanji.opt.entity.judgeanalysis.AnalysisCrossHourOverFlowTask
;
import
net.wanji.opt.entity.judgeanalysis.AnalysisProblemCrossDirHour
;
import
java.util.List
;
import
java.util.Map
;
import
net.wanji.opt.entity.judgeanalysis.CrossCongestionLaneReasonInfo
;
import
net.wanji.opt.entity.report.ConfigPeakHours
;
import
org.apache.ibatis.annotations.Param
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
...
...
@@ -50,5 +56,19 @@ public interface AnalysisProblemCrossDirHourMapper extends BaseMapper<AnalysisPr
List
<
AnalysisProblemCrossDirHour
>
selectDirectByProblemTrend
(
Map
<
String
,
Object
>
Map
);
List
<
AnalysisCrossHourOverFlowTask
>
getOverFolowInfo
(
@Param
(
"crossId"
)
String
crossId
,
@Param
(
"startTime"
)
Integer
startTime
,
@Param
(
"endTime"
)
Integer
endTime
);
List
<
CrossTurnDataHistPO
>
getEmptyCrossTurnInfo
(
@Param
(
"dir"
)
Integer
dir
,
@Param
(
"turn"
)
Integer
turn
,
@Param
(
"startTimeAll"
)
String
startTimeAll
,
@Param
(
"endTimeALL"
)
String
endTimeALL
);
List
<
ConfigPeakHours
>
getpeakHours
();
List
<
AnalysisProblemCrossDirHour
>
getunBalanceProblem
(
Map
<
String
,
Object
>
happyParamMap
);
List
<
CrossDirDataHistPO
>
getunBalancePeakFlow
(
@Param
(
"dir1"
)
Integer
dir1
,
@Param
(
"crossId"
)
String
crossId
,
@Param
(
"moningPeakStartAll"
)
String
moningPeakStartAll
,
@Param
(
"moningPeakEndAll"
)
String
moningPeakEndAll
);
List
<
AnalysisProblemCrossDirHour
>
getCongestionProblem
(
Map
<
String
,
Object
>
happyParamMap
);
List
<
CrossCongestionLaneReasonInfo
>
getCongestionReasoninfo
(
@Param
(
"crossId"
)
String
crossId
,
@Param
(
"dir"
)
Integer
dir
,
@Param
(
"startTimeAll"
)
String
startTimeAll
,
@Param
(
"endTimeALL"
)
String
endTimeALL
);
}
signal-optimize-service/src/main/java/net/wanji/opt/entity/judgeanalysis/AnalysisCrossHourOverFlowTask.java
0 → 100644
View file @
4780005e
package
net
.
wanji
.
opt
.
entity
.
judgeanalysis
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@TableName
(
"t_analysis_cross_overflow_reason"
)
public
class
AnalysisCrossHourOverFlowTask
{
private
static
final
long
serialVersionUID
=
1L
;
// 路口ID
private
String
crossId
;
// 主要溢出方向
private
int
overflowDir
;
// 出口道总流量
private
Integer
outFlowSum
;
// 平均流量/5min
private
Integer
outFlowAvg
;
// 出口道方向下一个路口进口车道数量
private
Integer
nextCrossLaneNum
;
// 下个路口通行能力
private
Integer
nextCrossCapacity
;
// 到下一个路口之间间距,单位米
private
Integer
lengthToNextCross
;
// 主要溢出时段开始时间
private
String
overflowStartTime
;
// 主要溢出时段截止时间
private
String
overflowEndTime
;
// 主要溢出时段内溢出事件数量
private
Integer
overflowNum
;
// 日期,格式yyyyMMdd
private
int
dt
;
// 数据插入时间
private
Date
insertTime
;
/*
非数据库字段
* */
//溢出开始时间小时
private
String
overflowStartTimeHours
;
//溢出结束时间小时
private
String
overflowEndTimeHours
;
}
signal-optimize-service/src/main/java/net/wanji/opt/entity/judgeanalysis/AnalysisProblemCrossDirHour.java
View file @
4780005e
package
net
.
wanji
.
opt
.
entity
.
judgeanalysis
;
import
com.baomidou.mybatisplus.annotation.
TableName
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.
*
;
import
java.time.LocalDateTime
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.io.Serializable
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
...
...
@@ -77,11 +76,22 @@ public class AnalysisProblemCrossDirHour implements Serializable {
*/
private
LocalDateTime
insertTime
;
/*
* 问题发生的转向
* */
private
Integer
turn
;
/***非数据库字段****/
//类型名称
@TableField
(
exist
=
false
)
private
String
typeName
;
//数量统计
@TableField
(
exist
=
false
)
private
String
countNumber
;
//按小时开始时间
@TableField
(
exist
=
false
)
private
String
hours_window_start_time
;
//开始时间 年月日时分秒
@TableField
(
exist
=
false
)
private
String
winStartTime
;
}
signal-optimize-service/src/main/java/net/wanji/opt/entity/judgeanalysis/CrossCongestionLaneReasonInfo.java
0 → 100644
View file @
4780005e
package
net
.
wanji
.
opt
.
entity
.
judgeanalysis
;
import
lombok.Data
;
/*
路口拥堵原因返回
* */
@Data
public
class
CrossCongestionLaneReasonInfo
{
private
String
crossId
;
// 对应 cross_id
private
Integer
dir
;
// 对应 dir
private
String
id
;
// 对应 id
private
Double
sturation
;
// 对应 avg(sturation)
}
signal-optimize-service/src/main/java/net/wanji/opt/servicev2/judgeanalysis/impl/AnalysisProblemCrossDirHourServiceImpl.java
View file @
4780005e
This diff is collapsed.
Click to expand it.
signal-optimize-service/src/main/resources/mapper/judgeanalysis/AnalysisProblemCrossDirHourMapper.xml
View file @
4780005e
...
...
@@ -99,6 +99,7 @@
<result
column=
"dir"
property=
"dir"
/>
<result
column=
"dt"
property=
"dt"
/>
<result
column=
"insert_time"
property=
"insertTime"
/>
<result
column=
"turn"
property=
"turn"
/>
<result
column=
"hours_window_start_time"
property=
"hours_window_start_time"
/>
<!-- 添加此行 -->
</resultMap>
...
...
@@ -200,9 +201,11 @@
SELECT
dt,
dir,
turn,
t1.cross_id,
sum(event_number)AS event_number ,
DATE_FORMAT(t1.window_start_time,'%H:%i') AS hours_window_start_time ,
DATE_FORMAT(t1.window_start_time, '%Y-%m-%d %H:%i:%s') AS winStartTime,
t1.event_type,
t2.label AS typeName
FROM t_analysis_problem_cross_dir_hour t1
...
...
@@ -221,7 +224,7 @@
GROUP BY
DATE_FORMAT(t1.window_start_time,'%H:%i')
ORDER BY event_number desc
limit
2
limit
1
</select>
<select
id=
"selectDirectByProblemTrend"
parameterType=
"map"
resultMap=
"AnalysisProblemCrossDirHourMap"
>
...
...
@@ -249,7 +252,154 @@
GROUP BY
dir
ORDER BY event_number desc
limit 1
</select>
<select
id=
"getOverFolowInfo"
parameterType=
"map"
resultType=
"net.wanji.opt.entity.judgeanalysis.AnalysisCrossHourOverFlowTask"
>
select
cross_id,overflow_dir,out_flow_sum,out_flow_avg,next_cross_lane_num,
next_cross_capacity,length_to_next_cross,overflow_num,
dt,
DATE_FORMAT(t1.overflow_start_time,'%H:%i') as overflowStartTimeHours,
DATE_FORMAT(t1.overflow_end_time,'%H:%i') as overflowEndTimeHours
FROM t_analysis_cross_overflow_reason t1
WHERE
1=1
<if
test=
"startTime != null and endTime != ''"
>
and t1.dt >= #{startTime} AND t1.dt
<
= #{endTime}
</if>
<if
test=
"crossId != null and crossId != ''"
>
and t1.cross_id = #{crossId}
</if>
ORDER BY overflow_num desc
limit 1
</select>
<select
id=
"getEmptyCrossTurnInfo"
parameterType=
"map"
resultType=
"net.wanji.databus.po.CrossTurnDataHistPO"
>
SELECT
id,turn_type,in_dir,cross_id,
avg(flow) as flow
FROM
t_cross_turn_data_hist t1
WHERE
1=1
<if
test=
"dir != null and dir != ''"
>
and t1.in_dir = #{dir}
</if>
<if
test=
"turn != null and turn != ''"
>
and t1.turn_type = #{turn}
</if>
<if
test=
"startTimeAll != null and endTimeALL != ''"
>
and t1.start_time >= #{startTimeAll} AND t1.start_time
<
= #{endTimeALL}
</if>
</select>
<select
id=
"getpeakHours"
resultType=
"net.wanji.opt.entity.report.ConfigPeakHours"
>
select
id,city_code,peak_type,day_type,start_time,end_time
from t_config_peak_hours
</select>
<select
id=
"getunBalanceProblem"
parameterType=
"map"
resultMap=
"AnalysisProblemCrossDirHourMap"
>
SELECT
dt,
dir,
turn,
t1.cross_id,
event_number,
DATE_FORMAT(t1.window_start_time,'%H:%i') AS hours_window_start_time ,
DATE_FORMAT(t1.window_start_time, '%Y-%m-%d %H:%i:%s') AS winStartTime,
t1.event_type,
t2.label AS typeName
FROM t_analysis_problem_cross_dir_hour t1
JOIN t_config_event_category t2 ON t1.event_type = t2.event_type
WHERE
1=1
<if
test=
"startTime != null and endTime != ''"
>
and dt >= #{startTime} AND dt
<
= #{endTime}
</if>
<if
test=
"crossId != null and crossId != ''"
>
and t1.cross_id = #{crossId}
</if>
<if
test=
"eventType != null and eventType != ''"
>
and t1.event_type = #{eventType}
</if>
ORDER BY event_number desc
limit 2
</select>
<select
id=
"getunBalancePeakFlow"
parameterType=
"map"
resultType=
"net.wanji.databus.po.CrossDirDataHistPO"
>
SELECT
avg(flow) as flow,
cross_id,
dir_type
FROM
t_cross_dir_data_hist t1
WHERE
1=1
<if
test=
"dir1 != null and dir1 != ''"
>
and t1.dir_type = #{dir1}
</if>
<if
test=
"crossId != null and crossId != ''"
>
and t1.cross_id = #{crossId}
</if>
<if
test=
"moningPeakStartAll != null and moningPeakEndAll != null "
>
and t1.start_time >= #{moningPeakStartAll} AND t1.start_time
<
= #{moningPeakEndAll}
</if>
</select>
<select
id=
"getCongestionProblem"
parameterType=
"map"
resultMap=
"AnalysisProblemCrossDirHourMap"
>
SELECT
dt,
dir,
turn,
t1.cross_id,
event_number,
DATE_FORMAT(t1.window_start_time,'%H:%i') AS hours_window_start_time ,
DATE_FORMAT(t1.window_start_time, '%Y-%m-%d %H:%i:%s') AS winStartTime,
t1.event_type,
t2.label AS typeName
FROM t_analysis_problem_cross_dir_hour t1
JOIN t_config_event_category t2 ON t1.event_type = t2.event_type
WHERE
1=1
<if
test=
"startTime != null and endTime != ''"
>
and dt >= #{startTime} AND dt
<
= #{endTime}
</if>
<if
test=
"crossId != null and crossId != ''"
>
and t1.cross_id = #{crossId}
</if>
<if
test=
"eventType != null and eventType != ''"
>
and t1.event_type = #{eventType}
</if>
ORDER BY event_number desc
limit 1
</select>
<select
id=
"getCongestionReasoninfo"
parameterType=
"map"
resultType=
"CrossCongestionLaneReasonInfo"
>
SELECT a.cross_id,a.dir,a.id,avg(b.sturation) sturation
from t_base_lane_info a
LEFT JOIN
(
SELECT id,sturation
from t_lane_data_hist
where
1=1
<if
test=
"crossId != null and crossId != ''"
>
and cross_id = #{crossId}
</if>
<if
test=
"startTimeAll != null and endTimeALL != ''"
>
and start_time BETWEEN #{startTimeAll} AND #{endTimeALL}
</if>
) b
on a.id=b.id
where
1=1
and a.type=2
<if
test=
"crossId != null and crossId != ''"
>
and a.cross_id = #{crossId}
</if>
<if
test=
"dir != null and dir != ''"
>
and t1.dir = #{dir}
</if>
GROUP BY a.cross_id,a.dir,a.id
</select>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment