Commit 512673fb authored by wuxiaokai's avatar wuxiaokai

控制指令接口-方案下发、计划下发、时间表下发

parent 75c8d89f
......@@ -65,6 +65,10 @@ public class Result<T> implements Serializable {
return Result.response(SUCCESS.getResultCode(), SUCCESS.getResultMsg(), content);
}
public static <T> Result<T> success(String message) {
return Result.response(SUCCESS.getResultCode(), message, null);
}
public static <T> Result<T> error(Integer state, String message, T content) {
return Result.response(state, message, content);
}
......
......@@ -7,10 +7,10 @@ import net.wanji.utc.common.Result;
import net.wanji.utc.service.control.ControlCommandService;
import net.wanji.utc.vo.PhaseLockVO;
import net.wanji.utc.vo.PlanSendVO;
import net.wanji.utc.vo.schedulesend.ScheduleSendVO;
import net.wanji.utc.vo.SchemeSendVO;
import net.wanji.utc.vo.ScheduleSendVO;
import net.wanji.utc.vo.timeplan.TimePlanVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import java.util.List;
......@@ -29,28 +29,25 @@ import static net.wanji.utc.common.constant.Constants.*;
@Api(value = "控制指令接口", description = "控制指令接口", tags = "控制指令接口")
public class ControlCommandController {
@Value("${signal.mock}")
private boolean mock;
@Autowired
private ControlCommandService hkControlCommandService;
/**
* 信号机方案下发
*
* @param planSendVO 方案下发VO
* @param schemeSendVO 方案下发VO
* @return {@link Result}<{@link T}>
*/
@ApiOperation(value = "方案下发-基础方案下发", notes = "方案下发-基础方案下发")
@ApiOperation(value = "信号机方案下发-基础方案下发", notes = "信号机方案下发-基础方案下发")
@PostMapping("/schemeSend")
public <T> Result<T> schemeSend(@RequestBody PlanSendVO planSendVO) throws Exception {
return hkControlCommandService.planSend(planSendVO);
public <T> Result<T> schemeSend(@RequestBody SchemeSendVO schemeSendVO) throws Exception {
return hkControlCommandService.schemeSend(schemeSendVO);
}
/**
* todo
* 相位配时下发?
* 下发信号机方案?
* 相位配时下发?
* 下发信号机方案?
*
* @param code 信号机id
* @param timePlans 配时方案实体类
......
package net.wanji.utc.dto.hk;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
/**
* 海康下发信号机方案DTO
*
* @author wuxiaokai
* @date 2022/12/6 16:49:23
*/
@Setter
@Getter
public class DownloadPlanSpandsDTO {
private String crossCode;
private List<Pattern> patternList;
@Setter
@Getter
public static class Pattern {
private String patternNo;
private String patternName;
private String coordPhase;
private String offset;
private String cycle;
private List<Ring> rings;
@Setter
@Getter
public static class Ring {
private String ringNo;
private List<Phase> phaseList;
@Setter
@Getter
public static class Phase {
private String phaseNo;
private String phaseName;
private String phaseLength;
private String phaseSequence;
private List<Lane> lanes;
@Setter
@Getter
public static class Lane {
private String laneNo;
private String direction;
private String turn;
}
}
}
}
}
package net.wanji.utc.dto.hk;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
/**
* 海康下发信号机日期DTO
*
* @author wuxiaokai
* @date 2022/11/23 14:11:09
*/
@Setter
@Getter
public class DownloadScheduleDTO {
private String crossCode;
private List<Schedule> schedules;
@Setter
@Getter
public static class Schedule {
private Integer scheduleNo;
private Integer isPeriod;
private List<String> dates;
private List<String> weeks;
private Integer planNo;
}
}
package net.wanji.utc.dto.hk;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
/**
* 海康信号机计划下发DTO
*
* @author wuxiaokai
* @date 2022/12/8 10:49:29
*/
@Setter
@Getter
public class DownloadTimeSpandsDTO {
private List<Data> data;
@Setter
@Getter
public static class Data {
private String crossCode;
private List<Plan> planList;
@Setter
@Getter
public static class Plan {
/**
* 计划号
*/
private String planNo;
/**
* 时段列表
*/
private List<Section> sectionList;
@Setter
@Getter
public static class Section {
/**
* 时段号
*/
private String timeSecNo;
/**
* 方案号
*/
private String patternNo;
/**
* 控制模式:1定周期;2绿灯;3黄灯;4红灯;5关灯;6绿闪;7黄闪;8红闪
*/
private String controlType;
/**
* 开始时间
*/
private String beginTime;
}
}
}
}
......@@ -12,6 +12,8 @@ import java.util.List;
public interface CrossPhaseMapper {
void deleteBatch(@Param("crossId") String crossId, @Param("schemeId") String schemeId);
void insertBatch(@Param("entities") List<CrossPhasePO> crossPhasePOList);
void insertOne(CrossPhasePO crossPhasePO);
List<CrossPhasePO> selectByCrossIdAndPlanId(@Param("crossId") String crossId, @Param("planId") String planId);
......
......@@ -14,6 +14,8 @@ public interface CrossPlanMapper {
void insertOne(CrossPlanPO crossPlanPO);
void insertBatch(@Param("entities") List<CrossPlanPO> crossPlanPOList);
Integer selectIdByNo(@Param("crossId") String crossId, @Param("planNo")Integer planNo);
List<CrossPlanPO> selectByCrossId(@Param("crossId") String crossId);
......
......@@ -15,6 +15,8 @@ public interface CrossSectionMapper {
void insertOne(CrossSectionPO crossSectionPO);
void insertBatch(@Param("entities") List<CrossSectionPO> crossSectionPOList);
List<CrossSectionPO> selectByCrossId(@Param("crossId") String crossId);
List<CrossSectionPO> selectByCrossIdAndPlanId(@Param("crossId") String crossId,
......
......@@ -3,7 +3,8 @@ package net.wanji.utc.service.control;
import net.wanji.utc.common.Result;
import net.wanji.utc.vo.PhaseLockVO;
import net.wanji.utc.vo.PlanSendVO;
import net.wanji.utc.vo.schedulesend.ScheduleSendVO;
import net.wanji.utc.vo.SchemeSendVO;
import net.wanji.utc.vo.ScheduleSendVO;
import net.wanji.utc.vo.timeplan.TimePlanVO;
import java.util.List;
......@@ -19,7 +20,7 @@ public interface ControlCommandService {
/**
* 方案下发
*/
<T> Result<T> schemeSend();
<T> Result<T> schemeSend(SchemeSendVO schemeSendVO) throws Exception;
/**
* 计划下发
......
package net.wanji.utc.util;
import com.alibaba.fastjson.JSON;
import net.wanji.utc.vo.PlanSendVO;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
......
package net.wanji.utc.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import net.wanji.utc.common.baseentity.BaseCrossInfo;
......@@ -7,34 +8,67 @@ import net.wanji.utc.common.baseentity.BaseCrossInfo;
import java.util.List;
/**
* 信号机计划下发VO
*
* @author wuxiaokai
* @date 2022/11/24 15:55:08
*/
@Setter
@Getter
public class PlanSendVO extends BaseCrossInfo {
public class PlanSendVO {
private List<Data> data;
@ApiModelProperty(value = "路口编号", notes = "路口编号")
private String crossCode;
@ApiModelProperty(value = "计划列表", notes = "计划列表")
private List<Plan> planList;
@Setter
@Getter
private static class Data {
private String crossCode;
private List<Plan> planList;
public static class Plan {
/**
* 计划号
*/
@ApiModelProperty(value = "计划号", notes = "计划号")
private String planNo;
/**
* 计划描述
*/
@ApiModelProperty(value = "计划描述", notes = "计划描述")
private String planDescribe;
/**
* 时段列表
*/
@ApiModelProperty(value = "时段列表", notes = "时段列表")
private List<Section> sectionList;
@Setter
@Getter
private static class Plan {
private String planNo;
private List<Section> sectionList;
@Setter
@Getter
private static class Section {
private String timeSecNo;
private String patternNo;
private String beginTime;
}
public static class Section {
/**
* 时段号
*/
@ApiModelProperty(value = "时段号", notes = "时段号")
private String sectionNo;
/**
* 开始时间
*/
@ApiModelProperty(value = "开始时间", notes = "开始时间")
private String beginTime;
/**
* 结束时间
*/
@ApiModelProperty(value = "结束时间", notes = "结束时间")
private String endTime;
/**
* 控制模式:1定周期;2绿灯;3黄灯;4红灯;5关灯;6绿闪;7黄闪;8红闪
*/
@ApiModelProperty(value = "控制模式:1定周期;2绿灯;3黄灯;4红灯;5关灯;6绿闪;7黄闪;8红闪", notes = "")
private String controlMode;
/**
* 方案号
*/
@ApiModelProperty(value = "方案号", notes = "")
private String patternNo;
}
}
}
package net.wanji.utc.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
/**
* 时间表下发VO
*
* @author wuxiaokai
* @date 2022/11/23 14:11:09
*/
@Setter
@Getter
public class ScheduleSendVO {
@ApiModelProperty(value = "路口编号", notes = "路口编号")
private String crossCode;
@ApiModelProperty(value = "时间表", notes = "时间表")
private List<Schedule> schedules;
@Setter
@Getter
public static class Schedule {
/**
* 星期列表
*/
@ApiModelProperty(value = "星期列表", notes = "星期列表")
private List<Week> weeks;
/**
* 特殊日期列表
*/
@ApiModelProperty(value = "特殊日期列表", notes = "特殊日期列表")
private List<SpecialDay> specialDays;
@Setter
@Getter
public static class Week {
@ApiModelProperty(value = "星期", notes = "星期")
private Integer weekNum;
@ApiModelProperty(value = "计划号", notes = "计划号")
private Integer planNo;
}
@Setter
@Getter
public static class SpecialDay {
/**
* 日期 2019-05-01
*/
@ApiModelProperty(value = "日期", notes = "日期")
private String dateStr;
/**
* 计划号
*/
@ApiModelProperty(value = "计划号", notes = "计划号")
private Integer planNo;
}
}
}
package net.wanji.utc.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
/**
* 信号机方案下发VO
*
* @author wuxiaokai
* @date 2022/12/6 16:14:27
*/
@Setter
@Getter
public class SchemeSendVO {
@ApiModelProperty(value = "路口编号", notes = "路口编号")
private String crossCode;
@ApiModelProperty(value = "方案列表", notes = "方案列表")
private List<Pattern> patternList;
/**
* 方案
*/
@Setter
@Getter
public static class Pattern {
/**
* 方案号
*/
@ApiModelProperty(value = "方案号", notes = "")
private String patternNo;
/**
* 方案名称
*/
@ApiModelProperty(value = "方案名称", notes = "")
private String patternName;
/**
* 方案周期
*/
@ApiModelProperty(value = "方案周期", notes = "")
private String cycle;
/**
* 协调相位号
*/
@ApiModelProperty(value = "协调相位号", notes = "")
private String coordPhase;
/**
* 协调相位差
*/
@ApiModelProperty(value = "协调相位差", notes = "协调相位差")
private String offset;
@ApiModelProperty(value = "环列表", notes = "环列表")
private List<Ring> rings;
@Setter
@Getter
public static class Ring {
@ApiModelProperty(value = "环号", notes = "环号")
private String ringNo;
@ApiModelProperty(value = "相位列表", notes = "相位列表")
private List<Phase> phaseList;
/**
* 相位
*/
@Setter
@Getter
public static class Phase {
/**
* 相位号
*/
@ApiModelProperty(value = "相位号", notes = "")
private String phaseNo;
/**
* 相位名称
*/
@ApiModelProperty(value = "相位名称", notes = "")
private String phaseName;
/**
* 相位序号
*/
@ApiModelProperty(value = "相位序号", notes = "")
private String sort;
/**
* 控制模式:1定周期;2绿灯;3黄灯;4红灯;5关灯;6绿闪;7黄闪;8红闪
*/
@ApiModelProperty(value = "控制模式:1定周期;2绿灯;3黄灯;4红灯;5关灯;6绿闪;7黄闪;8红闪", notes = "")
private String controlMode;
/**
* 最小绿灯时间
*/
@ApiModelProperty(value = "最小绿灯时间", notes = "")
private String minGreenTime;
/**
* 最大绿灯时间
*/
@ApiModelProperty(value = "最大绿灯时间", notes = "")
private String maxGreenTime;
/**
* 相位时间
*/
@ApiModelProperty(value = "相位时间", notes = "")
private String phaseTime;
/**
* 绿灯时间
*/
@ApiModelProperty(value = "绿灯时间", notes = "")
private String greenTime;
/**
* 绿闪时间
*/
@ApiModelProperty(value = "绿闪时间", notes = "")
private String greenFlashTime;
/**
* 行闪时间
*/
@ApiModelProperty(value = "行闪时间", notes = "")
private String pedFlashTime;
/**
* 黄灯时间
*/
@ApiModelProperty(value = "黄灯时间", notes = "")
private String yellowTime;
/**
* 红灯时间
*/
@ApiModelProperty(value = "红灯时间", notes = "")
private String redTime;
}
@Setter
@Getter
public static class Lights {
/**
* 灯组号
*/
@ApiModelProperty(value = "灯组号", notes = "")
private String lightsNo;
/**
* 灯组名称
*/
@ApiModelProperty(value = "灯组名称", notes = "")
private String name;
/**
* 灯组类型:1箭头;2圆饼,3行人
*/
@ApiModelProperty(value = "灯组类型:1箭头2圆饼3行人", notes = "")
private String type;
/**
* 灯组方向:1北;2东北;3东;4东南;5南;6西南;7西;8西北
*/
@ApiModelProperty(value = "灯组方向:1北;2东北;3东;4东南;5南;6西南;7西;8西北", notes = "")
private String dir;
/**
* 灯组转向:1左转;2右转;3直行;4左掉头;5直左;6直右;7右掉头;8向左合流;9向右合流;10左转加掉头;11右转加掉头;12直行加左掉头;13直行加右掉头;14左转右转;15左直右;16左转右转加掉头;17左直掉头;18左直右掉头;20行人
*/
@ApiModelProperty(value = "灯组转向:1左转;2右转;3直行;4左掉头;5直左;6直右;7右掉头;8向左合流;9向右合流;10左转加掉头;11右转加掉头;12直行加左掉头;13直行加右掉头;14左转右转;15左直右;16左转右转加掉头;17左直掉头;18左直右掉头;20行人", notes = "")
private String turn;
/**
* 行人进出口:1进口;2出口,3进出口
*/
@ApiModelProperty(value = "行人进出口:1进口2出口,3进出口", notes = "")
private String inOutType;
}
}
}
}
package net.wanji.utc.vo.plansend;
import lombok.Data;
import net.wanji.utc.common.baseentity.BaseCrossInfo;
import java.util.List;
/**
* 计划下发VO
*
* @author wuxiaokai
* @date 2022/11/21 17:10:43
*/
@Data
public class PlanSendVO extends BaseCrossInfo {
/**
* 星期
*/
private List<Week> weeks;
/**
* 特殊日期
*/
private List<SpecialDay> specialDays;
/**
* 日时段方案数据对象列表
*/
private List<SectionPlan> sectionPlans;
}
package net.wanji.utc.vo.plansend;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author wanji
* @version 1.0
* @Description: [路口时段方案实体]
* Created on 2019/4/22 16:20
*/
@Data
@ApiModel(value = "SectionPlan", description = "路口时段方案实体")
public class SectionPlan {
/**
* 时段方案编号
*/
@ApiModelProperty(value = "时段方案编号")
private String sectionPlanId;
/**
* 时段方案描述
*/
@ApiModelProperty(value = "时段方案描述")
private String sectionPlanDesc;
/**
* 时段数据列表
*/
@ApiModelProperty(value = "时段数据列表")
private List<TimeSlice> timeSlices;
}
package net.wanji.utc.vo.plansend;
import lombok.Data;
import net.wanji.utc.common.baseentity.BaseCrossInfo;
import java.util.List;
/**
* @author wanji
* @version 1.0
* @Description: [路口时段方案Vo]
* Created on 2019/4/22 16:17
*/
@Data
public class SectionPlanVo extends BaseCrossInfo {
//日时段方案数据对象列表
private List<SectionPlan> sectionPlans;
}
package net.wanji.utc.vo.plansend;
import lombok.Data;
/**
* 特殊日期
*
* @author wuxiaokai
* @date 2022/11/21 17:13:08
*/
@Data
public class SpecialDay {
/**
* 日期 2019-05-01
*/
private String dateStr;
/**
* 时段方案编号
*/
private Integer sectionPlanId;
/**
* 星期
*/
private Integer weekNum;
}
package net.wanji.utc.vo.plansend;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author wanji
* @version 1.0
* @Description: [时段数据实体]
* Created on 2019/4/22 16:22
*/
@Data
@ApiModel(value = "Timeslice", description = "时段数据实体")
public class TimeSlice {
/**
* 时段编号
*/
@ApiModelProperty(value = "时段编号")
private String timeSliceId;
/**
* 时段描述
*/
@ApiModelProperty(value = "时段描述")
private String timeSliceDesc;
/**
* 时段顺序号
*/
@ApiModelProperty(value = "时段顺序号")
private Integer timeSliceOrderId;
/**
* 开始时间,格式 HH:MI:00
*/
@ApiModelProperty(value = "开始时间,格式 HH:MI:00")
private String startTime;
/**
* 配时方案编号
*/
@ApiModelProperty(value = "配时方案编号")
private String timePlanId;
}
package net.wanji.utc.vo.plansend;
import lombok.Data;
/**
* @author wuxiaokai
* @date 2022/11/21 17:12:33
*/
@Data
public class Week {
private Integer weekNum;
private Integer sectionPlanId;
}
package net.wanji.utc.vo.schedulesend;
import lombok.Data;
import net.wanji.utc.common.baseentity.BaseCrossInfo;
import net.wanji.utc.vo.plansend.SpecialDay;
import net.wanji.utc.vo.plansend.Week;
import java.util.List;
/**
* 时间表下发VO
*
* @author wuxiaokai
* @date 2022/11/23 14:11:09
*/
@Data
public class ScheduleSendVO extends BaseCrossInfo {
/**
* 星期
*/
private List<Week> weeks;
/**
* 特殊日期
*/
private List<SpecialDay> specialDays;
}
package net.wanji.utc.vo.signal;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import net.wanji.utc.common.baseentity.BaseCrossInfo;
import java.util.List;
import java.util.Map;
/**
* 信号灯态基础信息实体
*/
@Data
public class SignalLightStateVo extends BaseCrossInfo {
/**
* 运行模式
*/
@ApiModelProperty(value = "运行模式 `2=手动锁定当前相位`,`3=手动全红`,`4=手动黄闪`,`5=手动关灯`," +
"`6=全红闪控制`,`7=全黄控制`,`8=正常按计划运行`,`9=手动步进控制`,`10=自动步进控制`,`11=恢复时间表`,`255=临时控制方案`")
private String runMode;
/**
* 控制模式
*/
@ApiModelProperty(value = "控制模式")
private String controlMode;
/**
* 相位方案号
*/
@ApiModelProperty(value = "相位方案号")
private String phasePlanId;
/**
* 相位配时方案
*/
@ApiModelProperty(value = "相位配时方案")
private String timePlanId;
/**
* 方案开始时间
*/
@ApiModelProperty(value = "方案开始时间")
private String planStartTime;
/**
* 方案运行时间
*/
@ApiModelProperty(value = "方案运行时间")
private Integer runTime;
/**
* 相位周期剩余时长
*/
@ApiModelProperty(value = "相位周期剩余时长")
private Integer cycleCountDown;
/**
* 相位周期时长
*/
@ApiModelProperty(value = "相位周期时长")
private Integer cycleLen;
/**
* 运行环数组
*/
private List<SignalRingVo> rings;
/**
* 当前相位号
*/
@ApiModelProperty(value = "当前相位号")
private String phaseId;
/**
* 当前方案号
*/
@ApiModelProperty(value = "当前方案号")
private String planId;
/**
* 灯组状态
*/
@ApiModelProperty(value = "灯组状态")
private Map<String, Object> dirLampGroupMap;
/**
* 相位对象:key:相位编号,value:绿灯时长
*/
@ApiModelProperty(value = "相位对象:key相位编号,value绿灯时长")
private Map<String, Object> phaseMap;
public void setCycleCountDown(Integer cycleCountDown) {
if (null == cycleCountDown) {
this.cycleCountDown = -1;
} else {
this.cycleCountDown = cycleCountDown;
}
}
public Integer getCycleCountDown() {
if (null == cycleCountDown) {
return -1;
}
return cycleCountDown;
}
}
package net.wanji.utc.vo.signal;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 信号机运行环数实体
*/
@Data
@ApiModel(value = "SignalRingVo", description = "信号机运行环数实体")
public class SignalRingVo {
//绿灯1
@ApiModelProperty(value = "绿灯1时长")
private Integer oneTime;
//绿灯2
@ApiModelProperty(value = "绿灯2时长")
private Integer twoTime;
//绿灯3
@ApiModelProperty(value = "绿灯3时长")
private Integer threeTime;
//黄灯4
@ApiModelProperty(value = "黄灯4时长")
private Integer fourTime;
//红灯5
@ApiModelProperty(value = "红灯5时长")
private Integer fiveTime;
//环号
@ApiModelProperty(value = "环号")
private String ringNo;
//当前相位编号
@ApiModelProperty(value = "当前相位编号")
private String phaseId;
//相位时长
@ApiModelProperty(value = "相位时长")
private Integer phaseLen;
//相位剩余时长
@ApiModelProperty(value = "相位剩余时长")
private Integer phaseLeft;
//当前步号
@ApiModelProperty(value = "当前步号")
private Integer stepNo;
//当前步类型
@ApiModelProperty(value = "当前步类型")
private Integer stepType;
//当前步长
@ApiModelProperty(value = "当前步长")
private Integer stepLen;
//当前步剩余时间
@ApiModelProperty(value = "当前步剩余时间")
private Integer stepLeft;
//下一相位id
@ApiModelProperty(value = "下一相位id")
private String nextPhaseId;
//相位顺序号
@ApiModelProperty(value = "相位顺序号")
private Integer phaseOrderId;
/**
* 当前灯色
*/
@ApiModelProperty(value = "当前灯色")
private Integer lampStatus;
/**
* 当前说明
* 11 灭灯
* 21 红灯
* 22 黄灯
* 23 绿灯
* 31 红黄
*/
@ApiModelProperty(value = "当前灯色")
private String lampStatusName;
}
......@@ -27,6 +27,17 @@
values (#{phaseNo},#{name},#{sort},#{crossId},#{planId},#{ringNo},#{controlMode},#{phaseTime},#{greenTime},#{greenFlashTime},#{pedFlashTime},#{yellowTime},#{redTime},#{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,
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.controlMode},#{entity.phaseTime},#{entity.greenTime},#{entity.greenFlashTime},#{entity.pedFlashTime},
#{entity.yellowTime},#{entity.redTime},#{entity.minGreenTime},#{entity.maxGreenTime})
</foreach>
</insert>
<delete id="deleteBatch">
delete from t_cross_phase
where cross_id = #{crossId} and plan_id = #{schemeId}
......
......@@ -16,6 +16,14 @@
values (#{planNo},#{name},#{crossId})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into t_cross_plan(plan_no,name,cross_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.planNo},#{entity.name},#{entity.crossId})
</foreach>
</insert>
<delete id="deleteOne">
delete from t_cross_plan
where cross_id = #{crossId} and plan_no = #{planNo}
......
......@@ -19,6 +19,14 @@
values (#{sectionNo},#{startTime},#{endTime},#{crossId},#{planId},#{controlMode},#{scemeId})
</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,sceme_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.sectionNo},#{entity.startTime},#{entity.endTime},#{entity.crossId},#{entity.planId},#{entity.controlMode},#{entity.scemeId})
</foreach>
</insert>
<delete id="deleteOne">
delete from t_cross_section
where cross_id = #{crossId} and section_no = #{timeSecNo}
......
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