Commit 3b712665 authored by hanbing's avatar hanbing

方案管理-方案配置,保存相位方案和配时方案,保存前清理数据库

parent acd2428d
...@@ -17,4 +17,6 @@ public interface CrossPhaseMapper { ...@@ -17,4 +17,6 @@ public interface CrossPhaseMapper {
@Param("coordPhaseNo") String coordPhaseNo); @Param("coordPhaseNo") String coordPhaseNo);
void insertOne(CrossPhasePO crossPhasePO); void insertOne(CrossPhasePO crossPhasePO);
void deleteByCrossId(@Param("crossId") String crossId);
} }
...@@ -126,7 +126,6 @@ public class CrossConfigServiceImpl implements CrossConfigService { ...@@ -126,7 +126,6 @@ public class CrossConfigServiceImpl implements CrossConfigService {
} }
} }
crossLaneLightsMapper.deleteByCrossId(crossId); crossLaneLightsMapper.deleteByCrossId(crossId);
crossPhaseLightsMapper.deleteByCrossId(crossId);
crossLaneLightsMapper.insertBatch(crossLaneLightsPOList); crossLaneLightsMapper.insertBatch(crossLaneLightsPOList);
} }
......
...@@ -74,6 +74,8 @@ public class SchemeConfigServiceImpl implements SchemeConfigService { ...@@ -74,6 +74,8 @@ public class SchemeConfigServiceImpl implements SchemeConfigService {
private void updateCrossPhase(SaveSchemeConfigDTO saveSchemeConfigDTO) { private void updateCrossPhase(SaveSchemeConfigDTO saveSchemeConfigDTO) {
String crossId = saveSchemeConfigDTO.getCrossId(); String crossId = saveSchemeConfigDTO.getCrossId();
crossPhaseMapper.deleteByCrossId(crossId);
crossPhaseLightsMapper.deleteByCrossId(crossId);
for (SaveSchemeConfigDTO.TimeScheme timeScheme : saveSchemeConfigDTO.getTimeSchemeList()) { for (SaveSchemeConfigDTO.TimeScheme timeScheme : saveSchemeConfigDTO.getTimeSchemeList()) {
String schemeNo = timeScheme.getSchemeNo(); String schemeNo = timeScheme.getSchemeNo();
List<SaveSchemeConfigDTO.TimeScheme.TimeRingListElement> ringList = timeScheme.getRingList(); List<SaveSchemeConfigDTO.TimeScheme.TimeRingListElement> ringList = timeScheme.getRingList();
......
...@@ -29,6 +29,11 @@ ...@@ -29,6 +29,11 @@
values (#{phaseNo},#{name},#{sort},#{crossId},#{planId},#{ringNo},#{controlMode},#{phaseTime},#{greenTime},#{greenFlashTime},#{pedFlashTime},#{yellowTime},#{redTime},#{minGreenTime},#{maxGreenTime}) values (#{phaseNo},#{name},#{sort},#{crossId},#{planId},#{ringNo},#{controlMode},#{phaseTime},#{greenTime},#{greenFlashTime},#{pedFlashTime},#{yellowTime},#{redTime},#{minGreenTime},#{maxGreenTime})
</insert> </insert>
<delete id="deleteByCrossId">
delete from t_base_cross_phase
where cross_id = #{crossId}
</delete>
<select id="selectIdByCrossIdAndPhaseNo" resultType="java.lang.Integer"> <select id="selectIdByCrossIdAndPhaseNo" resultType="java.lang.Integer">
select id from t_base_cross_phase select id from t_base_cross_phase
where cross_id = #{crossId} and plan_id = #{schemeId} and phase_no = #{coordPhaseNo} where cross_id = #{crossId} and plan_id = #{schemeId} and phase_no = #{coordPhaseNo}
......
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