Commit 9a9549d0 authored by duanruiming's avatar duanruiming

[update] 插入优化

parent d4204c78
......@@ -15,8 +15,8 @@
</resultMap>
<insert id="insertOne" keyProperty="id" useGeneratedKeys="true">
insert into t_cross_lights(lights_no,name,type,dir,turn,cross_id,in_out_type)
values (#{lightsNo},#{name},#{type},#{dir},#{turn},#{crossId},#{inOutType})
insert into t_cross_lights(id,lights_no,name,type,dir,turn,cross_id,in_out_type)
values (#{id},#{lightsNo},#{name},#{type},#{dir},#{turn},#{crossId},#{inOutType})
</insert>
<delete id="deleteOne">
......
......@@ -12,10 +12,10 @@
<!-- 批量新增数据 -->
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into t_cross_phase_lights(lights_id,phase_id,cross_id)
insert into t_cross_phase_lights(id,lights_id,phase_id,cross_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.lightsId},#{entity.phaseId},#{entity.crossId})
(#{entity.id},#{entity.lightsId},#{entity.phaseId},#{entity.crossId})
</foreach>
</insert>
......
......@@ -32,16 +32,16 @@
</sql>
<insert id="insertOne" keyProperty="id" useGeneratedKeys="true">
insert into t_cross_phase(phase_no,name,sort,cross_id,plan_id,ring_no,group_no,phase_type,control_mode,phase_time,green_time,green_flash_time,ped_flash_time,yellow_time,yellow_flash_time,red_time,red_flash_time,min_green_time,max_green_time)
values (#{phaseNo},#{name},#{sort},#{crossId},#{planId},#{ringNo},#{groupNo},#{phaseType},#{controlMode},#{phaseTime},#{greenTime},#{greenFlashTime},#{pedFlashTime},#{yellowTime},#{yellowFlashTime},#{redTime},#{redFlashTime},#{minGreenTime},#{maxGreenTime})
insert into t_cross_phase(id,phase_no,name,sort,cross_id,plan_id,ring_no,group_no,phase_type,control_mode,phase_time,green_time,green_flash_time,ped_flash_time,yellow_time,yellow_flash_time,red_time,red_flash_time,min_green_time,max_green_time)
values (#{id},#{phaseNo},#{name},#{sort},#{crossId},#{planId},#{ringNo},#{groupNo},#{phaseType},#{controlMode},#{phaseTime},#{greenTime},#{greenFlashTime},#{pedFlashTime},#{yellowTime},#{yellowFlashTime},#{redTime},#{redFlashTime},#{minGreenTime},#{maxGreenTime})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into t_cross_phase(phase_no,name,sort,cross_id,plan_id,ring_no,control_mode,phase_time,green_time,
insert into t_cross_phase(id,phase_no,name,sort,cross_id,plan_id,ring_no,control_mode,phase_time,green_time,
green_flash_time,ped_flash_time,yellow_time,red_time,min_green_time,max_green_time)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.phaseNo},#{entity.name},#{entity.sort},#{entity.crossId},#{entity.planId},#{entity.ringNo},
(#{entity.id},#{entity.phaseNo},#{entity.name},#{entity.sort},#{entity.crossId},#{entity.planId},#{entity.ringNo},
#{entity.controlMode},#{entity.phaseTime},#{entity.greenTime},#{entity.greenFlashTime},#{entity.pedFlashTime},
#{entity.yellowTime},#{entity.redTime},#{entity.minGreenTime},#{entity.maxGreenTime})
</foreach>
......
......@@ -12,15 +12,15 @@
<!--新增数据-->
<insert id="insertOne" keyProperty="id" useGeneratedKeys="true">
insert into t_cross_plan(plan_no,name,cross_id)
values (#{planNo},#{name},#{crossId})
insert into t_cross_plan(id,plan_no,name,cross_id)
values (#{id},#{planNo},#{name},#{crossId})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into t_cross_plan(plan_no,name,cross_id)
insert into t_cross_plan(id,plan_no,name,cross_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.planNo},#{entity.name},#{entity.crossId})
(#{entity.id},#{entity.planNo},#{entity.name},#{entity.crossId})
</foreach>
</insert>
......
......@@ -15,10 +15,10 @@
<!-- 批量新增数据 -->
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into t_cross_schedules(schedule_no,name,cross_id,plan_id,week,special_date)
insert into t_cross_schedules(id,schedule_no,name,cross_id,plan_id,week,special_date)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.scheduleNo},#{entity.name},#{entity.crossId},#{entity.planId},#{entity.week},#{entity.specialDate})
(#{entity.id},#{entity.scheduleNo},#{entity.name},#{entity.crossId},#{entity.planId},#{entity.week},#{entity.specialDate})
</foreach>
</insert>
......
......@@ -17,16 +17,16 @@
<!-- 批量新增数据 -->
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into t_cross_scheme(scheme_no,name,cross_id,cycle,coord_phase,offset,source,is_deleted)
insert into t_cross_scheme(id,scheme_no,name,cross_id,cycle,coord_phase,offset,source,is_deleted)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.schemeNo},#{entity.name},#{entity.crossId},#{entity.cycle},#{entity.coordPhase},#{entity.offset},#{entity.source},#{entity.isDeleted})
(#{entity.id},#{entity.schemeNo},#{entity.name},#{entity.crossId},#{entity.cycle},#{entity.coordPhase},#{entity.offset},#{entity.source},#{entity.isDeleted})
</foreach>
</insert>
<insert id="insertOne" keyProperty="id" useGeneratedKeys="true">
insert into t_cross_scheme(scheme_no,name,cross_id,cycle,coord_phase,offset,source,is_deleted)
values (#{schemeNo},#{name},#{crossId},#{cycle},#{coordPhase},#{offset},#{source},#{isDeleted})
insert into t_cross_scheme(id,scheme_no,name,cross_id,cycle,coord_phase,offset,source,is_deleted)
values (#{id},#{schemeNo},#{name},#{crossId},#{cycle},#{coordPhase},#{offset},#{source},#{isDeleted})
</insert>
<delete id="deleteOne">
......
......@@ -15,15 +15,15 @@
</resultMap>
<insert id="insertOne" keyProperty="id" useGeneratedKeys="true">
insert into t_cross_section(section_no, start_time, end_time, cross_id, plan_id, control_mode, scheme_id)
values (#{sectionNo}, #{startTime}, #{endTime}, #{crossId}, #{planId}, #{controlMode}, #{schemeId})
insert into t_cross_section(id,section_no, start_time, end_time, cross_id, plan_id, control_mode, scheme_id)
values (#{id},#{sectionNo}, #{startTime}, #{endTime}, #{crossId}, #{planId}, #{controlMode}, #{schemeId})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into t_cross_section(section_no,start_time,end_time,cross_id,plan_id,control_mode,scheme_id)
insert into t_cross_section(id,section_no,start_time,end_time,cross_id,plan_id,control_mode,scheme_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.sectionNo},#{entity.startTime},#{entity.endTime},#{entity.crossId},#{entity.planId},#{entity.controlMode},#{entity.schemeId})
(#{entity.id},#{entity.sectionNo},#{entity.startTime},#{entity.endTime},#{entity.crossId},#{entity.planId},#{entity.controlMode},#{entity.schemeId})
</foreach>
</insert>
......
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