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
49511a9c
Commit
49511a9c
authored
May 11, 2023
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 优化持久层
parent
c7aeef29
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
0 deletions
+77
-0
BaseCrossPhaseLightsMapper.xml
.../src/main/resources/mapper/BaseCrossPhaseLightsMapper.xml
+77
-0
No files found.
wj-databus/src/main/resources/mapper/BaseCrossPhaseLightsMapper.xml
0 → 100644
View file @
49511a9c
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"net.wanji.databus.dao.mapper.BaseCrossPhaseLightsMapper"
>
<!-- 通用查询映射结果 -->
<resultMap
type=
"net.wanji.databus.dao.entity.CrossPhaseLightsPO"
id=
"BaseResultMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"lightsId"
column=
"lights_id"
/>
<result
property=
"phaseId"
column=
"phase_id"
/>
<result
property=
"crossId"
column=
"cross_id"
/>
<result
property=
"gmtCreate"
column=
"gmt_create"
/>
<result
property=
"gmtModified"
column=
"gmt_modified"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, lights_id, phase_id, cross_id, gmt_create, gmt_modified
</sql>
<select
id=
"listCrossPhaseLightsPO"
resultMap=
"BaseResultMap"
parameterType=
"net.wanji.databus.dao.entity.CrossPhaseLightsPO"
>
select
<include
refid=
"Base_Column_List"
></include>
from t_base_cross_phase_lights
<where>
<if
test=
"entity.crossId != null and entity.crossId != ''"
>
and cross_id = #{entity.crossId}
</if>
<if
test=
"entity.phaseId != null and entity.phaseId != ''"
>
and phase_id = #{entity.phaseId}
</if>
</where>
</select>
<insert
id=
"insertBatch"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into t_base_cross_phase_lights(lights_id,phase_id,cross_id)
values
<foreach
collection=
"entities"
item=
"entity"
separator=
","
>
(#{entity.lightsId},#{entity.phaseId},#{entity.crossId})
</foreach>
</insert>
<insert
id=
"insertOne"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into t_base_cross_phase_lights(lights_id,phase_id,cross_id)
values (#{lightsId},#{phaseId},#{crossId})
</insert>
<update
id=
"updateLightsId"
>
update t_base_cross_phase_lights
set lights_id = #{newId}
where lights_id = #{oldId}
</update>
<delete
id=
"deleteByCrossId"
>
delete from t_base_cross_phase_lights
where cross_id = #{crossId}
</delete>
<select
id=
"selectByPhaseId"
resultMap=
"BaseResultMap"
>
select
id,lights_id,phase_id,cross_id,gmt_create,gmt_modified
from t_base_cross_phase_lights
where phase_id = #{phaseId}
</select>
<select
id=
"selectByLightsId"
resultMap=
"BaseResultMap"
>
select
id,lights_id,phase_id,cross_id,gmt_create,gmt_modified
from t_base_cross_phase_lights
where lights_id = #{lightsId}
</select>
<select
id=
"selectIdByThreeIds"
resultType=
"java.lang.Integer"
>
SELECT id from t_base_cross_phase_lights
WHERE cross_id = #{crossId} and lights_id = #{lightsId} and phase_id = #{phaseId}
</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