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
signal
traffic-signal-platform
Commits
a95e90da
Commit
a95e90da
authored
Nov 08, 2023
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 添加绿波实时和历史表插入语法
parent
5d9c6328
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
1 deletion
+34
-1
GreenwaveHistMapper.java
...ava/net/wanji/databus/dao/mapper/GreenwaveHistMapper.java
+3
-0
GreenwaveRealtimeMapper.java
...net/wanji/databus/dao/mapper/GreenwaveRealtimeMapper.java
+5
-0
GreenwaveHistMapper.xml
wj-databus/src/main/resources/mapper/GreenwaveHistMapper.xml
+12
-0
GreenwaveRealtimeMapper.xml
...bus/src/main/resources/mapper/GreenwaveRealtimeMapper.xml
+14
-1
No files found.
wj-databus/src/main/java/net/wanji/databus/dao/mapper/GreenwaveHistMapper.java
View file @
a95e90da
...
...
@@ -2,6 +2,7 @@ package net.wanji.databus.dao.mapper;
import
net.wanji.databus.dao.entity.GreenwaveHistPO
;
import
net.wanji.databus.dao.entity.GreenwaveHistPOExt
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.Date
;
...
...
@@ -18,4 +19,6 @@ public interface GreenwaveHistMapper {
List
<
GreenwaveHistPO
>
selectByTimeSection
(
String
startTimeStr
,
String
endTimeStr
);
List
<
GreenwaveHistPO
>
selectByIdAndTimeSection
(
Integer
greenwaveId
,
String
startTimeStr
,
String
endTimeStr
);
int
insertBatch
(
@Param
(
"list"
)
List
<
GreenwaveHistPO
>
list
);
}
wj-databus/src/main/java/net/wanji/databus/dao/mapper/GreenwaveRealtimeMapper.java
View file @
a95e90da
package
net
.
wanji
.
databus
.
dao
.
mapper
;
import
feign.Param
;
import
net.wanji.databus.dao.entity.GreenwaveRealtimePO
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* @author Kent HAN
* @date 2022/10/31 11:03
...
...
@@ -10,4 +13,6 @@ import org.springframework.stereotype.Repository;
@Repository
public
interface
GreenwaveRealtimeMapper
{
GreenwaveRealtimePO
selectById
(
Integer
id
);
int
insertBatch
(
@Param
(
"list"
)
List
<
GreenwaveRealtimePO
>
list
);
}
wj-databus/src/main/resources/mapper/GreenwaveHistMapper.xml
View file @
a95e90da
...
...
@@ -41,4 +41,16 @@
and gmt_modified
<![CDATA[ >= ]]>
#{startTimeStr}
</select>
<insert
id=
"insertBatch"
parameterType=
"net.wanji.databus.dao.entity.GreenwaveHistPO"
>
insert into t_greenwave_realtime
<include
refid=
"baseColumnList"
></include>
values
<foreach
collection=
"list"
item=
"entity"
separator=
","
open=
"("
close=
")"
>
(#{entity.id}, #{entity.status}, #{entity.type}, #{entity.trafficIndex},#{entity.speed},
#{entity.trvalTime}, #{entity.stopTimes}, #{entity.queueLength}, #{entity.congRate},
#{entity.delayTime}, #{entity.noparkPassRate}, #{entity.cordReliability}, #{entity.cordQueueRatio},
#{entity.uncoordinatePhaseQueue})
</foreach>
</insert>
</mapper>
wj-databus/src/main/resources/mapper/GreenwaveRealtimeMapper.xml
View file @
a95e90da
...
...
@@ -8,9 +8,22 @@
</sql>
<select
id=
"selectById"
resultType=
"net.wanji.databus.dao.entity.GreenwaveRealtimePO"
>
select
<include
refid=
"baseColumnList"
/>
select
<include
refid=
"baseColumnList"
/>
from t_greenwave_realtime
where id = #{id}
</select>
<insert
id=
"insertBatch"
parameterType=
"net.wanji.databus.dao.entity.GreenwaveRealtimePO"
>
insert into t_greenwave_realtime
<include
refid=
"baseColumnList"
></include>
values
<foreach
collection=
"list"
item=
"entity"
separator=
","
open=
"("
close=
")"
>
(#{entity.id}, #{entity.status}, #{entity.type}, #{entity.trafficIndex},#{entity.speed},
#{entity.trvalTime}, #{entity.stopTimes}, #{entity.queueLength}, #{entity.congRate},
#{entity.delayTime}, #{entity.noparkPassRate}, #{entity.cordReliability}, #{entity.cordQueueRatio},
#{entity.uncoordinatePhaseQueue})
</foreach>
</insert>
</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