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
4f3e75e9
Commit
4f3e75e9
authored
Apr 11, 2025
by
wangyecheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
方案评价优化sql
parent
acb9dc95
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
45 deletions
+44
-45
CrossProblemEvaluationMapper.xml
...ources/mapper/evaluation/CrossProblemEvaluationMapper.xml
+44
-45
No files found.
signal-optimize-service/src/main/resources/mapper/evaluation/CrossProblemEvaluationMapper.xml
View file @
4f3e75e9
...
...
@@ -11,75 +11,74 @@
</select>
<select
id=
"getOverflow"
parameterType=
"net.wanji.opt.po.trend.EventInfoSimplePo"
resultType=
"net.wanji.opt.po.trend.EventInfoSimplePo"
>
SELECT count(*) as event_count,
sum(duration) duration,
count(t2.
event_id) as optimizecount
sum(duration) duration,
count(
event_id) as optimizecount
FROM
(
SELECT t1.cross_id,t1.event_serial_number,t1.type,TIMESTAMPDIFF(SECOND,t1.start_time,t1.end_time) duration from t_event_info t1
Where 1=1
(
SELECT t1.cross_id,t1.event_serial_number,t1.type,
TIMESTAMPDIFF(SECOND,t1.start_time,t1.end_time) duration,
t2.event_id
from t_event_info t1
left JOIN
t_strategy_cross_result t2
on t1.event_serial_number=t2.event_id
<if
test=
"crossId!=null and crossId!=''"
>
AND t1
.cross_id=#{crossId}
AND t2
.cross_id=#{crossId}
</if>
<if
test=
"startTime!=null
and endTime!=null"
>
AND
start_time>=#{startTime} and start
_time
<
=#{endTime}
<if
test=
"startTime!=null and endTime!=null"
>
AND
t2.issue_time>=#{startTime} and t2.issue
_time
<
=#{endTime}
</if>
<if
test=
"
evenType!=null
"
>
AND t
1.type=#{evenType
}
<if
test=
"
currentAlgo!=null and currentAlgo!=''
"
>
AND t
2.current_algo=#{currentAlgo
}
</if>
) t1
left JOIN
(
SELECT t1.cross_id,t1.event_id from t_strategy_cross_result t1
WHERE
1=1
Where 1=1
<if
test=
"crossId!=null and crossId!=''"
>
AND t1.cross_id=#{crossId}
</if>
<if
test=
"startTime!=null and endTime!=null"
>
AND
issue_time>=#{startTime} and issue
_time
<
=#{endTime}
<if
test=
"startTime!=null
and endTime!=null"
>
AND
t1.start_time>=#{startTime} and t1.start
_time
<
=#{endTime}
</if>
<if
test=
"
currentAlgo!=null
"
>
AND t1.
current_algo=#{currentAlgo
}
<if
test=
"
evenType!=null and evenType!=''
"
>
AND t1.
type=#{evenType
}
</if>
) t2
on t1.event_serial_number=t2.event_id
GROUP BY t1.cross_id,t1.type
)t
GROUP BY cross_id,type
</select>
<select
id=
"getContrastOverflow"
parameterType=
"net.wanji.opt.po.trend.EventInfoSimplePo"
resultType=
"net.wanji.opt.po.trend.EventInfoSimplePo"
>
SELECT count(*) as event_count,
sum(duration) duration,
count(
t2.
event_id) as optimizecount
count(event_id) as optimizecount
FROM
(
SELECT t1.cross_id,t1.event_serial_number,t1.type,TIMESTAMPDIFF(SECOND,t1.start_time,t1.end_time) duration from t_event_info t1
Where 1=1
SELECT t1.cross_id,t1.event_serial_number,
t1.type,TIMESTAMPDIFF(SECOND,t1.start_time,t1.end_time) duration,
t2.event_id
from t_event_info t1
left JOIN
t_strategy_cross_result t2
on t1.event_serial_number=t2.event_id
<if
test=
"crossId!=null and crossId!=''"
>
AND
t1
.cross_id=#{crossId}
AND
t2
.cross_id=#{crossId}
</if>
<if
test=
"contrastStartTime!=null
and constrastEndTime!=null"
>
AND start_time>=#{contrastStartTime} and start
_time
<
=#{constrastEndTime}
<if
test=
"contrastStartTime!=null and constrastEndTime!=null"
>
AND t2.issue_time>=#{contrastStartTime} and t2.issue
_time
<
=#{constrastEndTime}
</if>
<if
test=
"evenType
!=null"
>
AND t1.type=#{evenType
}
<if
test=
"currentAlgo
!=null"
>
AND t2.current_algo=#{currentAlgo
}
</if>
) t1
left JOIN
(
SELECT t1.cross_id,t1.event_id from t_strategy_cross_result t1
WHERE
1=1
1=1
<if
test=
"crossId!=null and crossId!=''"
>
AND t1.cross_id=#{crossId}
</if>
<if
test=
"contrastStartTime!=null and constrastEndTime!=null"
>
AND
issue_time>=#{contrastStartTime} and issue
_time
<
=#{constrastEndTime}
AND
t1.cross_id=#{crossId}
</if>
<if
test=
"contrastStartTime!=null
and constrastEndTime!=null"
>
AND
t1.start_time>=#{contrastStartTime} and t1.start
_time
<
=#{constrastEndTime}
</if>
<if
test=
"
currentAlgo
!=null"
>
AND t1.
current_algo=#{currentAlgo
}
<if
test=
"
evenType
!=null"
>
AND t1.
type=#{evenType
}
</if>
) t2
on t1.event_serial_number=t2.event_id
GROUP BY t1.cross_id,t1.type
)t
GROUP BY cross_id,type
</select>
...
...
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