diff --git a/pom.xml b/pom.xml index d24f9f17a..95d18597f 100644 --- a/pom.xml +++ b/pom.xml @@ -171,24 +171,7 @@ - - - org.mybatis.generator - mybatis-generator-maven-plugin - 1.4.0 - - true - true - - - - - mysql - mysql-connector-java - 8.0.27 - - - + diff --git a/src/main/java/club/joylink/rtss/controller/training2/TrainingV2Controller.java b/src/main/java/club/joylink/rtss/controller/training2/TrainingDraftV2Controller.java similarity index 56% rename from src/main/java/club/joylink/rtss/controller/training2/TrainingV2Controller.java rename to src/main/java/club/joylink/rtss/controller/training2/TrainingDraftV2Controller.java index 1f7c5a89c..ed319f8ce 100644 --- a/src/main/java/club/joylink/rtss/controller/training2/TrainingV2Controller.java +++ b/src/main/java/club/joylink/rtss/controller/training2/TrainingDraftV2Controller.java @@ -1,40 +1,52 @@ -package club.joylink.rtss.controller.training2; - -import club.joylink.rtss.services.training2.Training2DraftService; -import club.joylink.rtss.vo.client.training2.Step2VO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * 实训数据管理接口 - */ -@RestController -@RequestMapping("/api/v2/training") -public class TrainingV2Controller { - @Autowired - private Training2DraftService training2DraftService; - - - /** - * 查询步骤列表 - */ - @GetMapping("/{trainingId}/step/list") - public List stepList(@PathVariable("trainingId") Long trainingId) { - return training2DraftService.stepList(trainingId); - } - - /** - * 修改实训所有步骤 - */ - @PutMapping("/{trainingId}/step/update") - public void updateSteps(@PathVariable("trainingId") String trainingId, @RequestBody List step2VOList) { - training2DraftService.updateSteps(trainingId, step2VOList); - } - - @DeleteMapping("/{trainingId}/step/clear") - public void clearStep(@PathVariable("trainingId") String trainingId) { - - } -} +package club.joylink.rtss.controller.training2; + +import club.joylink.rtss.services.training2.Training2DraftService; +import club.joylink.rtss.vo.AccountVO; +import club.joylink.rtss.vo.client.training2.Step2VO; +import club.joylink.rtss.vo.training2.draft.CreateTraining2ReqVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 实训草稿管理接口 + */ +@RestController +@RequestMapping("/api/v2/draft/training") +public class TrainingDraftV2Controller { + @Autowired + private Training2DraftService training2DraftService; + + /** + * 创建实训草稿 + */ + @PostMapping("/create") + public void create(@RequestBody CreateTraining2ReqVo req, @RequestAttribute AccountVO user) { + + } + + /** + * 查询步骤列表 + */ + @GetMapping("/{trainingId}/step/list") + public List stepList(@PathVariable("trainingId") Long trainingId) { + return training2DraftService.stepList(trainingId); + } + + /** + * 修改实训所有步骤 + */ + @PutMapping("/{trainingId}/step/update") + public void updateSteps(@PathVariable("trainingId") Long trainingId, @RequestBody List step2VOList) { + training2DraftService.updateSteps(trainingId, step2VOList); + } + + /** + * 清空步骤 + */ + @DeleteMapping("/{trainingId}/step/clear") + public void clearStep(@PathVariable("trainingId") Long trainingId) { + training2DraftService.clearStep(trainingId); + } +} diff --git a/src/main/java/club/joylink/rtss/dao/DraftTraining2DAO.java b/src/main/java/club/joylink/rtss/dao/DraftTraining2DAO.java index 6c4928ba0..0fc4f6e69 100644 --- a/src/main/java/club/joylink/rtss/dao/DraftTraining2DAO.java +++ b/src/main/java/club/joylink/rtss/dao/DraftTraining2DAO.java @@ -3,11 +3,12 @@ package club.joylink.rtss.dao; import club.joylink.rtss.entity.training2.DraftTraining2; import club.joylink.rtss.entity.training2.DraftTraining2Example; import club.joylink.rtss.entity.training2.DraftTraining2WithBLOBs; -import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; +import java.util.List; + @Mapper @Repository public interface DraftTraining2DAO { @@ -38,4 +39,6 @@ public interface DraftTraining2DAO { int updateByPrimaryKeyWithBLOBs(DraftTraining2WithBLOBs record); int updateByPrimaryKey(DraftTraining2 record); + + int updateStepJson(@Param("id") Long id, @Param("StepJson") String stepJson); } \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/dao/training2/DraftTraining2Mapper.java b/src/main/java/club/joylink/rtss/dao/training2/DraftTraining2Mapper.java deleted file mode 100644 index 6da611e37..000000000 --- a/src/main/java/club/joylink/rtss/dao/training2/DraftTraining2Mapper.java +++ /dev/null @@ -1,125 +0,0 @@ -package club.joylink.rtss.dao.training2; - -import club.joylink.rtss.entity.training2.DraftTraining2; -import club.joylink.rtss.entity.training2.DraftTraining2Example; -import club.joylink.rtss.entity.training2.DraftTraining2WithBLOBs; -import java.util.List; - -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; -@Mapper -@Repository -public interface DraftTraining2Mapper { - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - long countByExample(DraftTraining2Example example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - int deleteByExample(DraftTraining2Example example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - int deleteByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - int insert(DraftTraining2WithBLOBs record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - int insertSelective(DraftTraining2WithBLOBs record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - List selectByExampleWithBLOBs(DraftTraining2Example example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - List selectByExample(DraftTraining2Example example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - DraftTraining2WithBLOBs selectByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - int updateByExampleSelective(@Param("record") DraftTraining2WithBLOBs record, @Param("example") DraftTraining2Example example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - int updateByExampleWithBLOBs(@Param("record") DraftTraining2WithBLOBs record, @Param("example") DraftTraining2Example example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - int updateByExample(@Param("record") DraftTraining2 record, @Param("example") DraftTraining2Example example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - int updateByPrimaryKeySelective(DraftTraining2WithBLOBs record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - int updateByPrimaryKeyWithBLOBs(DraftTraining2WithBLOBs record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - int updateByPrimaryKey(DraftTraining2 record); -} \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/entity/training2/DraftTraining2.java b/src/main/java/club/joylink/rtss/entity/training2/DraftTraining2.java index 0a9562815..fddc700a1 100644 --- a/src/main/java/club/joylink/rtss/entity/training2/DraftTraining2.java +++ b/src/main/java/club/joylink/rtss/entity/training2/DraftTraining2.java @@ -1,401 +1,59 @@ package club.joylink.rtss.entity.training2; +import java.io.Serializable; import java.time.LocalDateTime; +import lombok.Data; -public class DraftTraining2 { - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column draft_training2.id - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ +/** + * @author + * + */ +@Data +public class DraftTraining2 implements Serializable { private Long id; - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column draft_training2.map_id - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ private Long mapId; /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column draft_training2.name - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 + * 实训名称 */ private String name; /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column draft_training2.description - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 + * 描述 */ private String description; /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column draft_training2.type - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 + * 实训类型(单操、场景) */ private String type; /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column draft_training2.label_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 + * 标签,用于检索 */ private String labelJson; /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column draft_training2.map_location_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 + * 地图定位json */ private String mapLocationJson; /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column draft_training2.run_plan_id - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 + * 运行图id */ private Long runPlanId; /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column draft_training2.failure_condition_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 + * 实训失败判定条件 */ private String failureConditionJson; - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column draft_training2.creator_id - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ private Long creatorId; - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column draft_training2.create_time - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ private LocalDateTime createTime; - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column draft_training2.update_time - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ private LocalDateTime updateTime; - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column draft_training2.id - * - * @return the value of draft_training2.id - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public Long getId() { - return id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column draft_training2.id - * - * @param id the value for draft_training2.id - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public void setId(Long id) { - this.id = id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column draft_training2.map_id - * - * @return the value of draft_training2.map_id - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public Long getMapId() { - return mapId; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column draft_training2.map_id - * - * @param mapId the value for draft_training2.map_id - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public void setMapId(Long mapId) { - this.mapId = mapId; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column draft_training2.name - * - * @return the value of draft_training2.name - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public String getName() { - return name; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column draft_training2.name - * - * @param name the value for draft_training2.name - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column draft_training2.description - * - * @return the value of draft_training2.description - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public String getDescription() { - return description; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column draft_training2.description - * - * @param description the value for draft_training2.description - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public void setDescription(String description) { - this.description = description == null ? null : description.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column draft_training2.type - * - * @return the value of draft_training2.type - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public String getType() { - return type; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column draft_training2.type - * - * @param type the value for draft_training2.type - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column draft_training2.label_json - * - * @return the value of draft_training2.label_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public String getLabelJson() { - return labelJson; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column draft_training2.label_json - * - * @param labelJson the value for draft_training2.label_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public void setLabelJson(String labelJson) { - this.labelJson = labelJson == null ? null : labelJson.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column draft_training2.map_location_json - * - * @return the value of draft_training2.map_location_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public String getMapLocationJson() { - return mapLocationJson; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column draft_training2.map_location_json - * - * @param mapLocationJson the value for draft_training2.map_location_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public void setMapLocationJson(String mapLocationJson) { - this.mapLocationJson = mapLocationJson == null ? null : mapLocationJson.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column draft_training2.run_plan_id - * - * @return the value of draft_training2.run_plan_id - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public Long getRunPlanId() { - return runPlanId; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column draft_training2.run_plan_id - * - * @param runPlanId the value for draft_training2.run_plan_id - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public void setRunPlanId(Long runPlanId) { - this.runPlanId = runPlanId; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column draft_training2.failure_condition_json - * - * @return the value of draft_training2.failure_condition_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public String getFailureConditionJson() { - return failureConditionJson; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column draft_training2.failure_condition_json - * - * @param failureConditionJson the value for draft_training2.failure_condition_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public void setFailureConditionJson(String failureConditionJson) { - this.failureConditionJson = failureConditionJson == null ? null : failureConditionJson.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column draft_training2.creator_id - * - * @return the value of draft_training2.creator_id - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public Long getCreatorId() { - return creatorId; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column draft_training2.creator_id - * - * @param creatorId the value for draft_training2.creator_id - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public void setCreatorId(Long creatorId) { - this.creatorId = creatorId; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column draft_training2.create_time - * - * @return the value of draft_training2.create_time - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public LocalDateTime getCreateTime() { - return createTime; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column draft_training2.create_time - * - * @param createTime the value for draft_training2.create_time - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public void setCreateTime(LocalDateTime createTime) { - this.createTime = createTime; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column draft_training2.update_time - * - * @return the value of draft_training2.update_time - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public LocalDateTime getUpdateTime() { - return updateTime; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column draft_training2.update_time - * - * @param updateTime the value for draft_training2.update_time - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public void setUpdateTime(LocalDateTime updateTime) { - this.updateTime = updateTime; - } + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/entity/training2/DraftTraining2Example.java b/src/main/java/club/joylink/rtss/entity/training2/DraftTraining2Example.java index 798b3f255..db40e361f 100644 --- a/src/main/java/club/joylink/rtss/entity/training2/DraftTraining2Example.java +++ b/src/main/java/club/joylink/rtss/entity/training2/DraftTraining2Example.java @@ -5,118 +5,50 @@ import java.util.ArrayList; import java.util.List; public class DraftTraining2Example { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ protected String orderByClause; - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ protected boolean distinct; - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ protected List oredCriteria; - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ + private Integer limit; + + private Long offset; + public DraftTraining2Example() { - oredCriteria = new ArrayList<>(); + oredCriteria = new ArrayList(); } - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ public String getOrderByClause() { return orderByClause; } - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ public void setDistinct(boolean distinct) { this.distinct = distinct; } - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ public boolean isDistinct() { return distinct; } - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ public List getOredCriteria() { return oredCriteria; } - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ public void or(Criteria criteria) { oredCriteria.add(criteria); } - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { @@ -125,41 +57,39 @@ public class DraftTraining2Example { return criteria; } - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + protected abstract static class GeneratedCriteria { protected List criteria; protected GeneratedCriteria() { super(); - criteria = new ArrayList<>(); + criteria = new ArrayList(); } public boolean isValid() { @@ -316,72 +246,72 @@ public class DraftTraining2Example { } public Criteria andNameIsNull() { - addCriterion("name is null"); + addCriterion("`name` is null"); return (Criteria) this; } public Criteria andNameIsNotNull() { - addCriterion("name is not null"); + addCriterion("`name` is not null"); return (Criteria) this; } public Criteria andNameEqualTo(String value) { - addCriterion("name =", value, "name"); + addCriterion("`name` =", value, "name"); return (Criteria) this; } public Criteria andNameNotEqualTo(String value) { - addCriterion("name <>", value, "name"); + addCriterion("`name` <>", value, "name"); return (Criteria) this; } public Criteria andNameGreaterThan(String value) { - addCriterion("name >", value, "name"); + addCriterion("`name` >", value, "name"); return (Criteria) this; } public Criteria andNameGreaterThanOrEqualTo(String value) { - addCriterion("name >=", value, "name"); + addCriterion("`name` >=", value, "name"); return (Criteria) this; } public Criteria andNameLessThan(String value) { - addCriterion("name <", value, "name"); + addCriterion("`name` <", value, "name"); return (Criteria) this; } public Criteria andNameLessThanOrEqualTo(String value) { - addCriterion("name <=", value, "name"); + addCriterion("`name` <=", value, "name"); return (Criteria) this; } public Criteria andNameLike(String value) { - addCriterion("name like", value, "name"); + addCriterion("`name` like", value, "name"); return (Criteria) this; } public Criteria andNameNotLike(String value) { - addCriterion("name not like", value, "name"); + addCriterion("`name` not like", value, "name"); return (Criteria) this; } public Criteria andNameIn(List values) { - addCriterion("name in", values, "name"); + addCriterion("`name` in", values, "name"); return (Criteria) this; } public Criteria andNameNotIn(List values) { - addCriterion("name not in", values, "name"); + addCriterion("`name` not in", values, "name"); return (Criteria) this; } public Criteria andNameBetween(String value1, String value2) { - addCriterion("name between", value1, value2, "name"); + addCriterion("`name` between", value1, value2, "name"); return (Criteria) this; } public Criteria andNameNotBetween(String value1, String value2) { - addCriterion("name not between", value1, value2, "name"); + addCriterion("`name` not between", value1, value2, "name"); return (Criteria) this; } @@ -456,72 +386,72 @@ public class DraftTraining2Example { } public Criteria andTypeIsNull() { - addCriterion("type is null"); + addCriterion("`type` is null"); return (Criteria) this; } public Criteria andTypeIsNotNull() { - addCriterion("type is not null"); + addCriterion("`type` is not null"); return (Criteria) this; } public Criteria andTypeEqualTo(String value) { - addCriterion("type =", value, "type"); + addCriterion("`type` =", value, "type"); return (Criteria) this; } public Criteria andTypeNotEqualTo(String value) { - addCriterion("type <>", value, "type"); + addCriterion("`type` <>", value, "type"); return (Criteria) this; } public Criteria andTypeGreaterThan(String value) { - addCriterion("type >", value, "type"); + addCriterion("`type` >", value, "type"); return (Criteria) this; } public Criteria andTypeGreaterThanOrEqualTo(String value) { - addCriterion("type >=", value, "type"); + addCriterion("`type` >=", value, "type"); return (Criteria) this; } public Criteria andTypeLessThan(String value) { - addCriterion("type <", value, "type"); + addCriterion("`type` <", value, "type"); return (Criteria) this; } public Criteria andTypeLessThanOrEqualTo(String value) { - addCriterion("type <=", value, "type"); + addCriterion("`type` <=", value, "type"); return (Criteria) this; } public Criteria andTypeLike(String value) { - addCriterion("type like", value, "type"); + addCriterion("`type` like", value, "type"); return (Criteria) this; } public Criteria andTypeNotLike(String value) { - addCriterion("type not like", value, "type"); + addCriterion("`type` not like", value, "type"); return (Criteria) this; } public Criteria andTypeIn(List values) { - addCriterion("type in", values, "type"); + addCriterion("`type` in", values, "type"); return (Criteria) this; } public Criteria andTypeNotIn(List values) { - addCriterion("type not in", values, "type"); + addCriterion("`type` not in", values, "type"); return (Criteria) this; } public Criteria andTypeBetween(String value1, String value2) { - addCriterion("type between", value1, value2, "type"); + addCriterion("`type` between", value1, value2, "type"); return (Criteria) this; } public Criteria andTypeNotBetween(String value1, String value2) { - addCriterion("type not between", value1, value2, "type"); + addCriterion("`type` not between", value1, value2, "type"); return (Criteria) this; } @@ -977,23 +907,14 @@ public class DraftTraining2Example { } /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table draft_training2 - * - * @mbg.generated do_not_delete_during_merge Tue Aug 16 14:29:01 CST 2022 */ public static class Criteria extends GeneratedCriteria { + protected Criteria() { super(); } } - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table draft_training2 - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ public static class Criterion { private String condition; diff --git a/src/main/java/club/joylink/rtss/entity/training2/DraftTraining2WithBLOBs.java b/src/main/java/club/joylink/rtss/entity/training2/DraftTraining2WithBLOBs.java index 170d95e99..4b71f00c2 100644 --- a/src/main/java/club/joylink/rtss/entity/training2/DraftTraining2WithBLOBs.java +++ b/src/main/java/club/joylink/rtss/entity/training2/DraftTraining2WithBLOBs.java @@ -1,201 +1,43 @@ package club.joylink.rtss.entity.training2; -public class DraftTraining2WithBLOBs extends DraftTraining2 { +import java.io.Serializable; +import lombok.Data; + +/** + * @author + * + */ +@Data +public class DraftTraining2WithBLOBs extends DraftTraining2 implements Serializable { /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column draft_training2.bg_scene_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 + * 初始背景 */ private String bgSceneJson; /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column draft_training2.opera_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 + * 操作列表json(List) */ private String operaJson; /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column draft_training2.step_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 + * 步骤列表json(List的json) */ private String stepJson; /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column draft_training2.scoring_rule_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 + * 打分规则列表json(List的json) */ private String scoringRuleJson; /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column draft_training2.member_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 + * 仿真内所有成员 */ private String memberJson; /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column draft_training2.player_id_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 + * 参演的仿真成员id列表Json */ private String playerIdJson; - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column draft_training2.bg_scene_json - * - * @return the value of draft_training2.bg_scene_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public String getBgSceneJson() { - return bgSceneJson; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column draft_training2.bg_scene_json - * - * @param bgSceneJson the value for draft_training2.bg_scene_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public void setBgSceneJson(String bgSceneJson) { - this.bgSceneJson = bgSceneJson == null ? null : bgSceneJson.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column draft_training2.opera_json - * - * @return the value of draft_training2.opera_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public String getOperaJson() { - return operaJson; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column draft_training2.opera_json - * - * @param operaJson the value for draft_training2.opera_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public void setOperaJson(String operaJson) { - this.operaJson = operaJson == null ? null : operaJson.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column draft_training2.step_json - * - * @return the value of draft_training2.step_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public String getStepJson() { - return stepJson; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column draft_training2.step_json - * - * @param stepJson the value for draft_training2.step_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public void setStepJson(String stepJson) { - this.stepJson = stepJson == null ? null : stepJson.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column draft_training2.scoring_rule_json - * - * @return the value of draft_training2.scoring_rule_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public String getScoringRuleJson() { - return scoringRuleJson; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column draft_training2.scoring_rule_json - * - * @param scoringRuleJson the value for draft_training2.scoring_rule_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public void setScoringRuleJson(String scoringRuleJson) { - this.scoringRuleJson = scoringRuleJson == null ? null : scoringRuleJson.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column draft_training2.member_json - * - * @return the value of draft_training2.member_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public String getMemberJson() { - return memberJson; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column draft_training2.member_json - * - * @param memberJson the value for draft_training2.member_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public void setMemberJson(String memberJson) { - this.memberJson = memberJson == null ? null : memberJson.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column draft_training2.player_id_json - * - * @return the value of draft_training2.player_id_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public String getPlayerIdJson() { - return playerIdJson; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column draft_training2.player_id_json - * - * @param playerIdJson the value for draft_training2.player_id_json - * - * @mbg.generated Tue Aug 16 14:29:01 CST 2022 - */ - public void setPlayerIdJson(String playerIdJson) { - this.playerIdJson = playerIdJson == null ? null : playerIdJson.trim(); - } + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/services/training2/Training2DraftService.java b/src/main/java/club/joylink/rtss/services/training2/Training2DraftService.java index dd6d6a26b..67d129def 100644 --- a/src/main/java/club/joylink/rtss/services/training2/Training2DraftService.java +++ b/src/main/java/club/joylink/rtss/services/training2/Training2DraftService.java @@ -1,19 +1,26 @@ package club.joylink.rtss.services.training2; -import club.joylink.rtss.dao.training2.DraftTraining2Mapper; +import club.joylink.rtss.dao.DraftTraining2DAO; +import club.joylink.rtss.entity.training2.DraftTraining2; +import club.joylink.rtss.entity.training2.DraftTraining2Example; import club.joylink.rtss.entity.training2.DraftTraining2WithBLOBs; +import club.joylink.rtss.exception.BusinessExceptionAssertEnum; import club.joylink.rtss.simulation.cbtc.exception.SimulationException; import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType; import club.joylink.rtss.util.JsonUtils; +import club.joylink.rtss.vo.AccountVO; import club.joylink.rtss.vo.client.training2.Step2VO; +import club.joylink.rtss.vo.training2.draft.CreateTraining2ReqVo; +import io.netty.util.internal.StringUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; +import java.time.LocalDateTime; import java.util.ArrayList; -import java.util.Comparator; import java.util.List; @Service @@ -21,14 +28,34 @@ import java.util.List; public class Training2DraftService { @Autowired - private DraftTraining2Mapper trainingDao; + private DraftTraining2DAO trainingDao; /** - * 创建实训 + * 根据基本信息创建实训 + * + * @return 返回创建的实训的id */ @Transactional(rollbackFor = Exception.class) - public void createTraining(Long mapId, String name, String description) { - + public Long createTraining(CreateTraining2ReqVo req, AccountVO user) { + //校验是否已经有同名的实训 + DraftTraining2Example example = new DraftTraining2Example(); + example.createCriteria().andNameEqualTo(req.getName()); + List check = this.trainingDao.selectByExample(example); + BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertCollectionEmpty(check, "实训已经存在"); + // + DraftTraining2WithBLOBs dt = new DraftTraining2WithBLOBs(); + dt.setMapId(req.getMapId()); + dt.setName(req.getName()); + dt.setCreatorId(user.getId()); + dt.setDescription(req.getDescription()); + dt.setType(req.getType()); + dt.setCreateTime(LocalDateTime.now()); + dt.setUpdateTime(LocalDateTime.now()); + this.trainingDao.insertSelective(dt); + // + List created = this.trainingDao.selectByExample(example); + BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue(null != created && created.size() == 1, "创建实训异常"); + return created.get(0).getId(); } /** @@ -49,11 +76,28 @@ public class Training2DraftService { /** * 修改实训所有步骤 */ - public void updateSteps(String trainingId, List step2VOList) { - Step2VO step2VO = step2VOList.stream().filter(s -> s.getId() != null) - .max(Comparator.comparingInt(Step2VO::getId)).orElse(null); - - + public void updateSteps(Long trainingId, List step2VOList) { + DraftTraining2WithBLOBs draftTraining2 = trainingDao.selectByPrimaryKey(trainingId); + if (draftTraining2 == null) { + throw new SimulationException(SimulationExceptionType.Data_Not_Exist, "实训不存在"); + } + String stepJson; + if (CollectionUtils.isEmpty(step2VOList)) { + stepJson = StringUtil.EMPTY_STRING; + } else { + stepJson = JsonUtils.writeValueAsString(step2VOList); + } + trainingDao.updateStepJson(trainingId, stepJson); } + /** + * 清空步骤 + */ + public void clearStep(Long trainingId) { + DraftTraining2WithBLOBs draftTraining2 = trainingDao.selectByPrimaryKey(trainingId); + if (draftTraining2 == null) { + throw new SimulationException(SimulationExceptionType.Data_Not_Exist, "实训不存在"); + } + trainingDao.updateStepJson(trainingId, StringUtil.EMPTY_STRING); + } } diff --git a/src/main/java/club/joylink/rtss/vo/training2/draft/CreateTraining2ReqVo.java b/src/main/java/club/joylink/rtss/vo/training2/draft/CreateTraining2ReqVo.java index e2fb52ebe..0003e0fac 100644 --- a/src/main/java/club/joylink/rtss/vo/training2/draft/CreateTraining2ReqVo.java +++ b/src/main/java/club/joylink/rtss/vo/training2/draft/CreateTraining2ReqVo.java @@ -1,5 +1,37 @@ package club.joylink.rtss.vo.training2.draft; -public class CreateTraining2ReqVo { +import java.time.LocalDateTime; +import javax.validation.constraints.NotBlank; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@NoArgsConstructor +public class CreateTraining2ReqVo { + @JsonSerialize(using = ToStringSerializer.class) + private Long mapId; + + /** + * 名称 + */ + @NotBlank(message = "名称不能为空") + private String name; + + /** + * 描述 + */ + private String description; + + /** + * 实训类型(单操、场景) + */ + @NotBlank(message = "实训类型不能为空") + private String type; } diff --git a/src/main/resources/generatorConfig.xml b/src/main/resources/generatorConfig.xml deleted file mode 100644 index dcb5bbef5..000000000 --- a/src/main/resources/generatorConfig.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/DraftTraining2DAO.xml b/src/main/resources/mybatis/mapper/DraftTraining2DAO.xml new file mode 100644 index 000000000..dd86dc2a4 --- /dev/null +++ b/src/main/resources/mybatis/mapper/DraftTraining2DAO.xml @@ -0,0 +1,500 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, map_id, `name`, description, `type`, label_json, map_location_json, run_plan_id, + failure_condition_json, creator_id, create_time, update_time + + + bg_scene_json, opera_json, step_json, scoring_rule_json, member_json, player_id_json + + + + + + delete from draft_training2 + where id = #{id,jdbcType=BIGINT} + + + delete from draft_training2 + + + + + + insert into draft_training2 (id, map_id, `name`, + description, `type`, label_json, + map_location_json, run_plan_id, failure_condition_json, + creator_id, create_time, update_time, + bg_scene_json, opera_json, step_json, + scoring_rule_json, member_json, player_id_json + ) + values (#{id,jdbcType=BIGINT}, #{mapId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, + #{description,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{labelJson,jdbcType=VARCHAR}, + #{mapLocationJson,jdbcType=VARCHAR}, #{runPlanId,jdbcType=BIGINT}, #{failureConditionJson,jdbcType=VARCHAR}, + #{creatorId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, + #{bgSceneJson,jdbcType=LONGVARCHAR}, #{operaJson,jdbcType=LONGVARCHAR}, #{stepJson,jdbcType=LONGVARCHAR}, + #{scoringRuleJson,jdbcType=LONGVARCHAR}, #{memberJson,jdbcType=LONGVARCHAR}, + #{playerIdJson,jdbcType=LONGVARCHAR} + ) + + + insert into draft_training2 + + + id, + + + map_id, + + + `name`, + + + description, + + + `type`, + + + label_json, + + + map_location_json, + + + run_plan_id, + + + failure_condition_json, + + + creator_id, + + + create_time, + + + update_time, + + + bg_scene_json, + + + opera_json, + + + step_json, + + + scoring_rule_json, + + + member_json, + + + player_id_json, + + + + + #{id,jdbcType=BIGINT}, + + + #{mapId,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{description,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{labelJson,jdbcType=VARCHAR}, + + + #{mapLocationJson,jdbcType=VARCHAR}, + + + #{runPlanId,jdbcType=BIGINT}, + + + #{failureConditionJson,jdbcType=VARCHAR}, + + + #{creatorId,jdbcType=BIGINT}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{bgSceneJson,jdbcType=LONGVARCHAR}, + + + #{operaJson,jdbcType=LONGVARCHAR}, + + + #{stepJson,jdbcType=LONGVARCHAR}, + + + #{scoringRuleJson,jdbcType=LONGVARCHAR}, + + + #{memberJson,jdbcType=LONGVARCHAR}, + + + #{playerIdJson,jdbcType=LONGVARCHAR}, + + + + + + update draft_training2 + + + id = #{record.id,jdbcType=BIGINT}, + + + map_id = #{record.mapId,jdbcType=BIGINT}, + + + `name` = #{record.name,jdbcType=VARCHAR}, + + + description = #{record.description,jdbcType=VARCHAR}, + + + `type` = #{record.type,jdbcType=VARCHAR}, + + + label_json = #{record.labelJson,jdbcType=VARCHAR}, + + + map_location_json = #{record.mapLocationJson,jdbcType=VARCHAR}, + + + run_plan_id = #{record.runPlanId,jdbcType=BIGINT}, + + + failure_condition_json = #{record.failureConditionJson,jdbcType=VARCHAR}, + + + creator_id = #{record.creatorId,jdbcType=BIGINT}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + + + bg_scene_json = #{record.bgSceneJson,jdbcType=LONGVARCHAR}, + + + opera_json = #{record.operaJson,jdbcType=LONGVARCHAR}, + + + step_json = #{record.stepJson,jdbcType=LONGVARCHAR}, + + + scoring_rule_json = #{record.scoringRuleJson,jdbcType=LONGVARCHAR}, + + + member_json = #{record.memberJson,jdbcType=LONGVARCHAR}, + + + player_id_json = #{record.playerIdJson,jdbcType=LONGVARCHAR}, + + + + + + + + update draft_training2 + set id = #{record.id,jdbcType=BIGINT}, + map_id = #{record.mapId,jdbcType=BIGINT}, + `name` = #{record.name,jdbcType=VARCHAR}, + description = #{record.description,jdbcType=VARCHAR}, + `type` = #{record.type,jdbcType=VARCHAR}, + label_json = #{record.labelJson,jdbcType=VARCHAR}, + map_location_json = #{record.mapLocationJson,jdbcType=VARCHAR}, + run_plan_id = #{record.runPlanId,jdbcType=BIGINT}, + failure_condition_json = #{record.failureConditionJson,jdbcType=VARCHAR}, + creator_id = #{record.creatorId,jdbcType=BIGINT}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + bg_scene_json = #{record.bgSceneJson,jdbcType=LONGVARCHAR}, + opera_json = #{record.operaJson,jdbcType=LONGVARCHAR}, + step_json = #{record.stepJson,jdbcType=LONGVARCHAR}, + scoring_rule_json = #{record.scoringRuleJson,jdbcType=LONGVARCHAR}, + member_json = #{record.memberJson,jdbcType=LONGVARCHAR}, + player_id_json = #{record.playerIdJson,jdbcType=LONGVARCHAR} + + + + + + update draft_training2 + set id = #{record.id,jdbcType=BIGINT}, + map_id = #{record.mapId,jdbcType=BIGINT}, + `name` = #{record.name,jdbcType=VARCHAR}, + description = #{record.description,jdbcType=VARCHAR}, + `type` = #{record.type,jdbcType=VARCHAR}, + label_json = #{record.labelJson,jdbcType=VARCHAR}, + map_location_json = #{record.mapLocationJson,jdbcType=VARCHAR}, + run_plan_id = #{record.runPlanId,jdbcType=BIGINT}, + failure_condition_json = #{record.failureConditionJson,jdbcType=VARCHAR}, + creator_id = #{record.creatorId,jdbcType=BIGINT}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + update_time = #{record.updateTime,jdbcType=TIMESTAMP} + + + + + + update draft_training2 + + + map_id = #{mapId,jdbcType=BIGINT}, + + + `name` = #{name,jdbcType=VARCHAR}, + + + description = #{description,jdbcType=VARCHAR}, + + + `type` = #{type,jdbcType=VARCHAR}, + + + label_json = #{labelJson,jdbcType=VARCHAR}, + + + map_location_json = #{mapLocationJson,jdbcType=VARCHAR}, + + + run_plan_id = #{runPlanId,jdbcType=BIGINT}, + + + failure_condition_json = #{failureConditionJson,jdbcType=VARCHAR}, + + + creator_id = #{creatorId,jdbcType=BIGINT}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + bg_scene_json = #{bgSceneJson,jdbcType=LONGVARCHAR}, + + + opera_json = #{operaJson,jdbcType=LONGVARCHAR}, + + + step_json = #{stepJson,jdbcType=LONGVARCHAR}, + + + scoring_rule_json = #{scoringRuleJson,jdbcType=LONGVARCHAR}, + + + member_json = #{memberJson,jdbcType=LONGVARCHAR}, + + + player_id_json = #{playerIdJson,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update draft_training2 + set map_id = #{mapId,jdbcType=BIGINT}, + `name` = #{name,jdbcType=VARCHAR}, + description = #{description,jdbcType=VARCHAR}, + `type` = #{type,jdbcType=VARCHAR}, + label_json = #{labelJson,jdbcType=VARCHAR}, + map_location_json = #{mapLocationJson,jdbcType=VARCHAR}, + run_plan_id = #{runPlanId,jdbcType=BIGINT}, + failure_condition_json = #{failureConditionJson,jdbcType=VARCHAR}, + creator_id = #{creatorId,jdbcType=BIGINT}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + bg_scene_json = #{bgSceneJson,jdbcType=LONGVARCHAR}, + opera_json = #{operaJson,jdbcType=LONGVARCHAR}, + step_json = #{stepJson,jdbcType=LONGVARCHAR}, + scoring_rule_json = #{scoringRuleJson,jdbcType=LONGVARCHAR}, + member_json = #{memberJson,jdbcType=LONGVARCHAR}, + player_id_json = #{playerIdJson,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=BIGINT} + + + update draft_training2 + set map_id = #{mapId,jdbcType=BIGINT}, + `name` = #{name,jdbcType=VARCHAR}, + description = #{description,jdbcType=VARCHAR}, + `type` = #{type,jdbcType=VARCHAR}, + label_json = #{labelJson,jdbcType=VARCHAR}, + map_location_json = #{mapLocationJson,jdbcType=VARCHAR}, + run_plan_id = #{runPlanId,jdbcType=BIGINT}, + failure_condition_json = #{failureConditionJson,jdbcType=VARCHAR}, + creator_id = #{creatorId,jdbcType=BIGINT}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=BIGINT} + + + + update draft_training2 set step_json = #{stepJson,jdbcType=LONGVARCHAR} where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/DraftTraining2Mapper.xml b/src/main/resources/mybatis/mapper/DraftTraining2Mapper.xml deleted file mode 100644 index a043f0b0a..000000000 --- a/src/main/resources/mybatis/mapper/DraftTraining2Mapper.xml +++ /dev/null @@ -1,573 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - id, map_id, name, description, type, label_json, map_location_json, run_plan_id, - failure_condition_json, creator_id, create_time, update_time - - - - bg_scene_json, opera_json, step_json, scoring_rule_json, member_json, player_id_json - - - - - - - delete from draft_training2 - where id = #{id,jdbcType=BIGINT} - - - - delete from draft_training2 - - - - - - - insert into draft_training2 (id, map_id, name, - description, type, label_json, - map_location_json, run_plan_id, failure_condition_json, - creator_id, create_time, update_time, - bg_scene_json, opera_json, step_json, - scoring_rule_json, member_json, player_id_json - ) - values (#{id,jdbcType=BIGINT}, #{mapId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, - #{description,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{labelJson,jdbcType=VARCHAR}, - #{mapLocationJson,jdbcType=VARCHAR}, #{runPlanId,jdbcType=BIGINT}, #{failureConditionJson,jdbcType=VARCHAR}, - #{creatorId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, - #{bgSceneJson,jdbcType=LONGVARCHAR}, #{operaJson,jdbcType=LONGVARCHAR}, #{stepJson,jdbcType=LONGVARCHAR}, - #{scoringRuleJson,jdbcType=LONGVARCHAR}, #{memberJson,jdbcType=LONGVARCHAR}, #{playerIdJson,jdbcType=LONGVARCHAR} - ) - - - - insert into draft_training2 - - - id, - - - map_id, - - - name, - - - description, - - - type, - - - label_json, - - - map_location_json, - - - run_plan_id, - - - failure_condition_json, - - - creator_id, - - - create_time, - - - update_time, - - - bg_scene_json, - - - opera_json, - - - step_json, - - - scoring_rule_json, - - - member_json, - - - player_id_json, - - - - - #{id,jdbcType=BIGINT}, - - - #{mapId,jdbcType=BIGINT}, - - - #{name,jdbcType=VARCHAR}, - - - #{description,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{labelJson,jdbcType=VARCHAR}, - - - #{mapLocationJson,jdbcType=VARCHAR}, - - - #{runPlanId,jdbcType=BIGINT}, - - - #{failureConditionJson,jdbcType=VARCHAR}, - - - #{creatorId,jdbcType=BIGINT}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - #{bgSceneJson,jdbcType=LONGVARCHAR}, - - - #{operaJson,jdbcType=LONGVARCHAR}, - - - #{stepJson,jdbcType=LONGVARCHAR}, - - - #{scoringRuleJson,jdbcType=LONGVARCHAR}, - - - #{memberJson,jdbcType=LONGVARCHAR}, - - - #{playerIdJson,jdbcType=LONGVARCHAR}, - - - - - - - update draft_training2 - - - id = #{record.id,jdbcType=BIGINT}, - - - map_id = #{record.mapId,jdbcType=BIGINT}, - - - name = #{record.name,jdbcType=VARCHAR}, - - - description = #{record.description,jdbcType=VARCHAR}, - - - type = #{record.type,jdbcType=VARCHAR}, - - - label_json = #{record.labelJson,jdbcType=VARCHAR}, - - - map_location_json = #{record.mapLocationJson,jdbcType=VARCHAR}, - - - run_plan_id = #{record.runPlanId,jdbcType=BIGINT}, - - - failure_condition_json = #{record.failureConditionJson,jdbcType=VARCHAR}, - - - creator_id = #{record.creatorId,jdbcType=BIGINT}, - - - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - - - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - - - bg_scene_json = #{record.bgSceneJson,jdbcType=LONGVARCHAR}, - - - opera_json = #{record.operaJson,jdbcType=LONGVARCHAR}, - - - step_json = #{record.stepJson,jdbcType=LONGVARCHAR}, - - - scoring_rule_json = #{record.scoringRuleJson,jdbcType=LONGVARCHAR}, - - - member_json = #{record.memberJson,jdbcType=LONGVARCHAR}, - - - player_id_json = #{record.playerIdJson,jdbcType=LONGVARCHAR}, - - - - - - - - - update draft_training2 - set id = #{record.id,jdbcType=BIGINT}, - map_id = #{record.mapId,jdbcType=BIGINT}, - name = #{record.name,jdbcType=VARCHAR}, - description = #{record.description,jdbcType=VARCHAR}, - type = #{record.type,jdbcType=VARCHAR}, - label_json = #{record.labelJson,jdbcType=VARCHAR}, - map_location_json = #{record.mapLocationJson,jdbcType=VARCHAR}, - run_plan_id = #{record.runPlanId,jdbcType=BIGINT}, - failure_condition_json = #{record.failureConditionJson,jdbcType=VARCHAR}, - creator_id = #{record.creatorId,jdbcType=BIGINT}, - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - bg_scene_json = #{record.bgSceneJson,jdbcType=LONGVARCHAR}, - opera_json = #{record.operaJson,jdbcType=LONGVARCHAR}, - step_json = #{record.stepJson,jdbcType=LONGVARCHAR}, - scoring_rule_json = #{record.scoringRuleJson,jdbcType=LONGVARCHAR}, - member_json = #{record.memberJson,jdbcType=LONGVARCHAR}, - player_id_json = #{record.playerIdJson,jdbcType=LONGVARCHAR} - - - - - - - update draft_training2 - set id = #{record.id,jdbcType=BIGINT}, - map_id = #{record.mapId,jdbcType=BIGINT}, - name = #{record.name,jdbcType=VARCHAR}, - description = #{record.description,jdbcType=VARCHAR}, - type = #{record.type,jdbcType=VARCHAR}, - label_json = #{record.labelJson,jdbcType=VARCHAR}, - map_location_json = #{record.mapLocationJson,jdbcType=VARCHAR}, - run_plan_id = #{record.runPlanId,jdbcType=BIGINT}, - failure_condition_json = #{record.failureConditionJson,jdbcType=VARCHAR}, - creator_id = #{record.creatorId,jdbcType=BIGINT}, - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - update_time = #{record.updateTime,jdbcType=TIMESTAMP} - - - - - - - update draft_training2 - - - map_id = #{mapId,jdbcType=BIGINT}, - - - name = #{name,jdbcType=VARCHAR}, - - - description = #{description,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - label_json = #{labelJson,jdbcType=VARCHAR}, - - - map_location_json = #{mapLocationJson,jdbcType=VARCHAR}, - - - run_plan_id = #{runPlanId,jdbcType=BIGINT}, - - - failure_condition_json = #{failureConditionJson,jdbcType=VARCHAR}, - - - creator_id = #{creatorId,jdbcType=BIGINT}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - bg_scene_json = #{bgSceneJson,jdbcType=LONGVARCHAR}, - - - opera_json = #{operaJson,jdbcType=LONGVARCHAR}, - - - step_json = #{stepJson,jdbcType=LONGVARCHAR}, - - - scoring_rule_json = #{scoringRuleJson,jdbcType=LONGVARCHAR}, - - - member_json = #{memberJson,jdbcType=LONGVARCHAR}, - - - player_id_json = #{playerIdJson,jdbcType=LONGVARCHAR}, - - - where id = #{id,jdbcType=BIGINT} - - - - update draft_training2 - set map_id = #{mapId,jdbcType=BIGINT}, - name = #{name,jdbcType=VARCHAR}, - description = #{description,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - label_json = #{labelJson,jdbcType=VARCHAR}, - map_location_json = #{mapLocationJson,jdbcType=VARCHAR}, - run_plan_id = #{runPlanId,jdbcType=BIGINT}, - failure_condition_json = #{failureConditionJson,jdbcType=VARCHAR}, - creator_id = #{creatorId,jdbcType=BIGINT}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, - bg_scene_json = #{bgSceneJson,jdbcType=LONGVARCHAR}, - opera_json = #{operaJson,jdbcType=LONGVARCHAR}, - step_json = #{stepJson,jdbcType=LONGVARCHAR}, - scoring_rule_json = #{scoringRuleJson,jdbcType=LONGVARCHAR}, - member_json = #{memberJson,jdbcType=LONGVARCHAR}, - player_id_json = #{playerIdJson,jdbcType=LONGVARCHAR} - where id = #{id,jdbcType=BIGINT} - - - - update draft_training2 - set map_id = #{mapId,jdbcType=BIGINT}, - name = #{name,jdbcType=VARCHAR}, - description = #{description,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - label_json = #{labelJson,jdbcType=VARCHAR}, - map_location_json = #{mapLocationJson,jdbcType=VARCHAR}, - run_plan_id = #{runPlanId,jdbcType=BIGINT}, - failure_condition_json = #{failureConditionJson,jdbcType=VARCHAR}, - creator_id = #{creatorId,jdbcType=BIGINT}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=BIGINT} - - \ No newline at end of file