diff --git a/src/main/java/club/joylink/rtss/controller/simulation/SimulationTrainingV2Controller.java b/src/main/java/club/joylink/rtss/controller/simulation/SimulationTrainingV2Controller.java index fb66c1b0d..2e335563e 100644 --- a/src/main/java/club/joylink/rtss/controller/simulation/SimulationTrainingV2Controller.java +++ b/src/main/java/club/joylink/rtss/controller/simulation/SimulationTrainingV2Controller.java @@ -75,6 +75,15 @@ public class SimulationTrainingV2Controller { return training2Service.completionClientStep(group, stepId, user); } + /** + * 客户端步骤完成后操作回调 + */ + @PutMapping("/{group}/completion/step/{stepId}/operation/{id}") + public Integer completionClientStepOperation(@PathVariable String group, @PathVariable Integer stepId + , @PathVariable Integer id, @RequestAttribute AccountVO user) { + return training2Service.completionClientStepOperation(group, stepId, id, user); + } + /** * 绘制剧本 */ diff --git a/src/main/java/club/joylink/rtss/controller/training2/TrainingDraftV2Controller.java b/src/main/java/club/joylink/rtss/controller/training2/TrainingDraftV2Controller.java index 2a304f641..e7589944d 100644 --- a/src/main/java/club/joylink/rtss/controller/training2/TrainingDraftV2Controller.java +++ b/src/main/java/club/joylink/rtss/controller/training2/TrainingDraftV2Controller.java @@ -22,9 +22,10 @@ import java.util.List; @RequestMapping("/api/v2/draft/training") public class TrainingDraftV2Controller { @Autowired - private Training2DraftService training2DraftService; + private Training2DraftService training2DraftService; @Autowired private ExpConditionMaterialCollector collector; + /** * 创建实训草稿 */ @@ -33,71 +34,81 @@ public class TrainingDraftV2Controller { log.debug("==>>创建实训草稿: mapId = {} , name = {} type = {} des = {}", req.getMapId(), req.getName(), req.getType(), req.getDescription()); return this.training2DraftService.createTraining(req, user); } + /** - * 删除当前用户的实训草稿 + * 删除当前用户的实训草稿 */ @DeleteMapping - public DeleteTraining2RspVo deleteTrainings(@RequestBody DeleteTraining2ReqVo req,@RequestAttribute AccountVO user) { - return this.training2DraftService.deleteTrainings(req,user); + public DeleteTraining2RspVo deleteTrainings(@RequestBody DeleteTraining2ReqVo req, @RequestAttribute AccountVO user) { + return this.training2DraftService.deleteTrainings(req, user); } + /** * 分页获取当前用户实训草稿基础信息 */ @PostMapping("/info/page") - public PageVO findTrainingsInfoByPage(@RequestBody DraftTraining2InfoPageReqVo req, @RequestAttribute AccountVO user){ - return this.training2DraftService.findTrainingsInfoByPage(req,user.getId()); + public PageVO findTrainingsInfoByPage(@RequestBody DraftTraining2InfoPageReqVo req, @RequestAttribute AccountVO user) { + return this.training2DraftService.findTrainingsInfoByPage(req, user.getId()); } + /** * 更新当前用户的某个实训草稿(大字段信息) */ @PostMapping("/update/content") - public void updateTraining(@RequestBody UpdateDraftTraining2BlobReqVo req,@RequestAttribute AccountVO user) { - this.training2DraftService.updateTrainingBlob(req, user.getId()); + public void updateTraining(@RequestBody UpdateDraftTraining2BlobReqVo req, @RequestAttribute AccountVO user) { + this.training2DraftService.updateTrainingBlob(req, user.getId()); } + /** * 单独更新当前用户的某个实训草稿的初始背景 *

* 背景内容由后端自己生成 */ @PostMapping("/update/content/backgroud") - public void updateTrainingBackgroud(@RequestBody UpdateTraining2BackgroudReqVo req,@RequestAttribute AccountVO user){ - this.training2DraftService.updateTrainingBackgroud(req,user.getId()); + public void updateTrainingBackgroud(@RequestBody UpdateTraining2BackgroudReqVo req, @RequestAttribute AccountVO user) { + this.training2DraftService.updateTrainingBackgroud(req, user.getId()); } + /** * 单独重置当前用户的某个实训草稿的初始背景 */ @PostMapping("/reset/content/backgroud") - public void resetTrainingBackgroud(@RequestBody ResetTraining2BackgroudReqVo req,@RequestAttribute AccountVO user){ - this.training2DraftService.resetTrainingBackgroud(req,user.getId()); + public void resetTrainingBackgroud(@RequestBody ResetTraining2BackgroudReqVo req, @RequestAttribute AccountVO user) { + this.training2DraftService.resetTrainingBackgroud(req, user.getId()); } + /** * 更新当前用户实训草稿定位 */ @PostMapping("/update/content/maplocation") - public void updateTrainingMapLocation(@RequestBody UpdateTraining2MapLocationReqVo req,@RequestAttribute AccountVO user){ - this.training2DraftService.updateTrainingMapLocation(req,user.getId()); + public void updateTrainingMapLocation(@RequestBody UpdateTraining2MapLocationReqVo req, @RequestAttribute AccountVO user) { + this.training2DraftService.updateTrainingMapLocation(req, user.getId()); } + /** * 获取实训表达式条件素材 */ @GetMapping("/expression/materials") - public List findTrainingExpressionMaterials(){ - return collector.doCollect(); + public List findTrainingExpressionMaterials() { + return collector.doCollect(); } + /** * 更新当前用户的某个实训草稿的基础信息 */ @PostMapping("/update/info") - public void updateTrainingInfo(@RequestBody UpdateDraftTraining2InfoReqVo req,@RequestAttribute AccountVO user){ + public void updateTrainingInfo(@RequestBody UpdateDraftTraining2InfoReqVo req, @RequestAttribute AccountVO user) { this.training2DraftService.updateTrainingInfo(req, user.getId()); } + /** * 获取当前用户的某个实训草稿的所有信息 */ @GetMapping("/all/{trainingId}") - public DraftTraining2DetailRspVo findTrainingDetail(@NotNull(message = "实训草稿id不能为空") @PathVariable("trainingId") Long trainingDraftId, @RequestAttribute AccountVO user){ - return this.training2DraftService.findTrainingDetail(trainingDraftId,user.getId()); + public DraftTraining2DetailRspVo findTrainingDetail(@NotNull(message = "实训草稿id不能为空") @PathVariable("trainingId") Long trainingDraftId, @RequestAttribute AccountVO user) { + return this.training2DraftService.findTrainingDetail(trainingDraftId, user.getId()); } + /** * 查询步骤列表 */ @@ -109,9 +120,10 @@ public class TrainingDraftV2Controller { /** * 修改实训所有步骤 */ - @PutMapping("/{trainingId}/step/update") - public void updateSteps(@PathVariable("trainingId") Long trainingId, @RequestBody List step2VOList) { - training2DraftService.updateSteps(trainingId, step2VOList); + @PutMapping("/{group}/{trainingId}/step/update") + public void updateSteps(@PathVariable("group") String group, @PathVariable("trainingId") Long trainingId + , @RequestBody List step2VOList) { + training2DraftService.updateSteps(group, trainingId, step2VOList); } /** diff --git a/src/main/java/club/joylink/rtss/dao/DraftTraining2DAO.java b/src/main/java/club/joylink/rtss/dao/DraftTraining2DAO.java index 3467329bc..6b54980db 100644 --- a/src/main/java/club/joylink/rtss/dao/DraftTraining2DAO.java +++ b/src/main/java/club/joylink/rtss/dao/DraftTraining2DAO.java @@ -1,44 +1,42 @@ -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 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 { - long countByExample(DraftTraining2Example example); - - int deleteByExample(DraftTraining2Example example); - - int deleteByPrimaryKey(Long id); - - int insert(DraftTraining2WithBLOBs record); - - int insertSelective(DraftTraining2WithBLOBs record); - - List selectByExampleWithBLOBs(DraftTraining2Example example); - - List selectByExample(DraftTraining2Example example); - - DraftTraining2WithBLOBs selectByPrimaryKey(Long id); - - int updateByExampleSelective(@Param("record") DraftTraining2WithBLOBs record, @Param("example") DraftTraining2Example example); - - int updateByExampleWithBLOBs(@Param("record") DraftTraining2WithBLOBs record, @Param("example") DraftTraining2Example example); - - int updateByExample(@Param("record") DraftTraining2 record, @Param("example") DraftTraining2Example example); - - int updateByPrimaryKeySelective(DraftTraining2WithBLOBs record); - - int updateByPrimaryKeyWithBLOBs(DraftTraining2WithBLOBs record); - - int updateByPrimaryKey(DraftTraining2 record); - - int updateStepJson(@Param("id") Long id, @Param("stepJson") String stepJson, @Param("playerIdJson") String playerIdJson); -} \ No newline at end of file +package club.joylink.rtss.dao; + +import java.util.List; + +import club.joylink.rtss.entity.training2.DraftTraining2; +import club.joylink.rtss.entity.training2.DraftTraining2Example; +import club.joylink.rtss.entity.training2.DraftTraining2WithBLOBs; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +@Mapper +@Repository +public interface DraftTraining2DAO { + long countByExample(DraftTraining2Example example); + + int deleteByExample(DraftTraining2Example example); + + int deleteByPrimaryKey(Long id); + + int insert(DraftTraining2WithBLOBs record); + + int insertSelective(DraftTraining2WithBLOBs record); + + List selectByExampleWithBLOBs(DraftTraining2Example example); + + List selectByExample(DraftTraining2Example example); + + DraftTraining2WithBLOBs selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") DraftTraining2WithBLOBs record, @Param("example") DraftTraining2Example example); + + int updateByExampleWithBLOBs(@Param("record") DraftTraining2WithBLOBs record, @Param("example") DraftTraining2Example example); + + int updateByExample(@Param("record") DraftTraining2 record, @Param("example") DraftTraining2Example example); + + int updateByPrimaryKeySelective(DraftTraining2WithBLOBs record); + + int updateByPrimaryKeyWithBLOBs(DraftTraining2WithBLOBs record); + + int updateByPrimaryKey(DraftTraining2 record); +} diff --git a/src/main/java/club/joylink/rtss/dao/PublishedTraining2DAO.java b/src/main/java/club/joylink/rtss/dao/PublishedTraining2DAO.java index 5a1c4ac0b..e0a62f1f9 100644 --- a/src/main/java/club/joylink/rtss/dao/PublishedTraining2DAO.java +++ b/src/main/java/club/joylink/rtss/dao/PublishedTraining2DAO.java @@ -1,9 +1,10 @@ package club.joylink.rtss.dao; +import java.util.List; + import club.joylink.rtss.entity.training2.PublishedTraining2; import club.joylink.rtss.entity.training2.PublishedTraining2Example; import club.joylink.rtss.entity.training2.PublishedTraining2WithBLOBs; -import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; @@ -38,4 +39,4 @@ public interface PublishedTraining2DAO { int updateByPrimaryKeyWithBLOBs(PublishedTraining2WithBLOBs record); int updateByPrimaryKey(PublishedTraining2 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 8c02456ec..515ca9c5e 100644 --- a/src/main/java/club/joylink/rtss/entity/training2/DraftTraining2.java +++ b/src/main/java/club/joylink/rtss/entity/training2/DraftTraining2.java @@ -1,59 +1,62 @@ -package club.joylink.rtss.entity.training2; - -import java.io.Serializable; -import java.time.LocalDateTime; -import lombok.Data; - -/** - * @author - * - */ -@Data -public class DraftTraining2 implements Serializable { - private Long id; - - private Long mapId; - - /** - * 实训名称 - */ - private String name; - - /** - * 描述 - */ - private String description; - - /** - * 实训类型(单操 single;场景scene) - */ - private String type; - - /** - * 标签,用于检索 - */ - private String labelJson; - - /** - * 地图定位json - */ - private String mapLocationJson; - - /** - * 运行图id - */ - private Long runPlanId; - - /** - * 实训失败判定条件 - */ - private String failureConditionJson; - - private Long creatorId; - - private LocalDateTime createTime; - - private LocalDateTime updateTime; - - private static final long serialVersionUID = 1L; -} +package club.joylink.rtss.entity.training2; + +import java.io.Serializable; +import java.time.LocalDateTime; +import lombok.Data; + +/** + * @author + * + */ +@Data +public class DraftTraining2 implements Serializable { + private Long id; + + /** + * 实训名称 + */ + private String name; + + /** + * 实训地图id + */ + private Long mapId; + + /** + * 描述 + */ + private String description; + + /** + * 实训类型(单操 single;场景scene) + */ + private String type; + + /** + * 标签,用于检索 + */ + private String labelJson; + + /** + * 地图定位json + */ + private String mapLocationJson; + + /** + * 运行图id + */ + private Long runPlanId; + + /** + * 实训失败判定条件 + */ + private String failureConditionJson; + + private Long creatorId; + + private LocalDateTime createTime; + + private LocalDateTime updateTime; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/entity/training2/DraftTraining2All.java b/src/main/java/club/joylink/rtss/entity/training2/DraftTraining2All.java deleted file mode 100644 index f7fff0ea2..000000000 --- a/src/main/java/club/joylink/rtss/entity/training2/DraftTraining2All.java +++ /dev/null @@ -1,90 +0,0 @@ -package club.joylink.rtss.entity.training2; - -import java.time.LocalDateTime; - -import lombok.Getter; -import lombok.Setter; - -@Getter -@Setter -public class DraftTraining2All { - private Long id; - - private Long mapId; - - /** - * 名称 - */ - private String name; - - /** - * 描述 - */ - private String description; - - /** - * 实训类型(单操、场景) - */ - private String type; - - /** - * 标签,用于检索 - */ - private String labelJson; - - /** - * 地图定位json - */ - private String mapLocationJson; - - /** - * 初始背景 - */ - private String bgSceneJson; - - /** - * 运行图id - */ - private Long runPlanId; - - /** - * List的json - */ - private String operaJson; - - /** - * List的json - */ - private String stepJson; - - /** - * List的json - */ - private String scoringRuleJson; - -// /** -// * 保存数据时的背景 -// */ -// private String saveSceneJson; - - /** - * 仿真内所有成员 - */ - private String memberJson; - - /** - * 参演的仿真成员id列表Json - */ - private String playerIdJson; - - /** - * 实训失败判定条件 - */ - private String failureConditionJson; - - private Long creatorId; - - private LocalDateTime createTime; - - private LocalDateTime updateTime; -} 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 db40e361f..07dd434ef 100644 --- a/src/main/java/club/joylink/rtss/entity/training2/DraftTraining2Example.java +++ b/src/main/java/club/joylink/rtss/entity/training2/DraftTraining2Example.java @@ -1,1003 +1,1003 @@ -package club.joylink.rtss.entity.training2; - -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.List; - -public class DraftTraining2Example { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - private Integer limit; - - private Long offset; - - public DraftTraining2Example() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - 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(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andMapIdIsNull() { - addCriterion("map_id is null"); - return (Criteria) this; - } - - public Criteria andMapIdIsNotNull() { - addCriterion("map_id is not null"); - return (Criteria) this; - } - - public Criteria andMapIdEqualTo(Long value) { - addCriterion("map_id =", value, "mapId"); - return (Criteria) this; - } - - public Criteria andMapIdNotEqualTo(Long value) { - addCriterion("map_id <>", value, "mapId"); - return (Criteria) this; - } - - public Criteria andMapIdGreaterThan(Long value) { - addCriterion("map_id >", value, "mapId"); - return (Criteria) this; - } - - public Criteria andMapIdGreaterThanOrEqualTo(Long value) { - addCriterion("map_id >=", value, "mapId"); - return (Criteria) this; - } - - public Criteria andMapIdLessThan(Long value) { - addCriterion("map_id <", value, "mapId"); - return (Criteria) this; - } - - public Criteria andMapIdLessThanOrEqualTo(Long value) { - addCriterion("map_id <=", value, "mapId"); - return (Criteria) this; - } - - public Criteria andMapIdIn(List values) { - addCriterion("map_id in", values, "mapId"); - return (Criteria) this; - } - - public Criteria andMapIdNotIn(List values) { - addCriterion("map_id not in", values, "mapId"); - return (Criteria) this; - } - - public Criteria andMapIdBetween(Long value1, Long value2) { - addCriterion("map_id between", value1, value2, "mapId"); - return (Criteria) this; - } - - public Criteria andMapIdNotBetween(Long value1, Long value2) { - addCriterion("map_id not between", value1, value2, "mapId"); - return (Criteria) this; - } - - public Criteria andNameIsNull() { - addCriterion("`name` is null"); - return (Criteria) this; - } - - public Criteria andNameIsNotNull() { - addCriterion("`name` is not null"); - return (Criteria) this; - } - - public Criteria andNameEqualTo(String value) { - addCriterion("`name` =", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotEqualTo(String value) { - addCriterion("`name` <>", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThan(String value) { - addCriterion("`name` >", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThanOrEqualTo(String value) { - addCriterion("`name` >=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThan(String value) { - addCriterion("`name` <", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThanOrEqualTo(String value) { - addCriterion("`name` <=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLike(String value) { - addCriterion("`name` like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotLike(String value) { - addCriterion("`name` not like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameIn(List values) { - addCriterion("`name` in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameNotIn(List values) { - addCriterion("`name` not in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameBetween(String value1, String value2) { - addCriterion("`name` between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andNameNotBetween(String value1, String value2) { - addCriterion("`name` not between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andDescriptionIsNull() { - addCriterion("description is null"); - return (Criteria) this; - } - - public Criteria andDescriptionIsNotNull() { - addCriterion("description is not null"); - return (Criteria) this; - } - - public Criteria andDescriptionEqualTo(String value) { - addCriterion("description =", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotEqualTo(String value) { - addCriterion("description <>", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionGreaterThan(String value) { - addCriterion("description >", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionGreaterThanOrEqualTo(String value) { - addCriterion("description >=", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionLessThan(String value) { - addCriterion("description <", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionLessThanOrEqualTo(String value) { - addCriterion("description <=", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionLike(String value) { - addCriterion("description like", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotLike(String value) { - addCriterion("description not like", value, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionIn(List values) { - addCriterion("description in", values, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotIn(List values) { - addCriterion("description not in", values, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionBetween(String value1, String value2) { - addCriterion("description between", value1, value2, "description"); - return (Criteria) this; - } - - public Criteria andDescriptionNotBetween(String value1, String value2) { - addCriterion("description not between", value1, value2, "description"); - return (Criteria) this; - } - - public Criteria andTypeIsNull() { - addCriterion("`type` is null"); - return (Criteria) this; - } - - public Criteria andTypeIsNotNull() { - addCriterion("`type` is not null"); - return (Criteria) this; - } - - public Criteria andTypeEqualTo(String value) { - addCriterion("`type` =", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotEqualTo(String value) { - addCriterion("`type` <>", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThan(String value) { - addCriterion("`type` >", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThanOrEqualTo(String value) { - addCriterion("`type` >=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThan(String value) { - addCriterion("`type` <", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThanOrEqualTo(String value) { - addCriterion("`type` <=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLike(String value) { - addCriterion("`type` like", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotLike(String value) { - addCriterion("`type` not like", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeIn(List values) { - addCriterion("`type` in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotIn(List values) { - addCriterion("`type` not in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeBetween(String value1, String value2) { - addCriterion("`type` between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotBetween(String value1, String value2) { - addCriterion("`type` not between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andLabelJsonIsNull() { - addCriterion("label_json is null"); - return (Criteria) this; - } - - public Criteria andLabelJsonIsNotNull() { - addCriterion("label_json is not null"); - return (Criteria) this; - } - - public Criteria andLabelJsonEqualTo(String value) { - addCriterion("label_json =", value, "labelJson"); - return (Criteria) this; - } - - public Criteria andLabelJsonNotEqualTo(String value) { - addCriterion("label_json <>", value, "labelJson"); - return (Criteria) this; - } - - public Criteria andLabelJsonGreaterThan(String value) { - addCriterion("label_json >", value, "labelJson"); - return (Criteria) this; - } - - public Criteria andLabelJsonGreaterThanOrEqualTo(String value) { - addCriterion("label_json >=", value, "labelJson"); - return (Criteria) this; - } - - public Criteria andLabelJsonLessThan(String value) { - addCriterion("label_json <", value, "labelJson"); - return (Criteria) this; - } - - public Criteria andLabelJsonLessThanOrEqualTo(String value) { - addCriterion("label_json <=", value, "labelJson"); - return (Criteria) this; - } - - public Criteria andLabelJsonLike(String value) { - addCriterion("label_json like", value, "labelJson"); - return (Criteria) this; - } - - public Criteria andLabelJsonNotLike(String value) { - addCriterion("label_json not like", value, "labelJson"); - return (Criteria) this; - } - - public Criteria andLabelJsonIn(List values) { - addCriterion("label_json in", values, "labelJson"); - return (Criteria) this; - } - - public Criteria andLabelJsonNotIn(List values) { - addCriterion("label_json not in", values, "labelJson"); - return (Criteria) this; - } - - public Criteria andLabelJsonBetween(String value1, String value2) { - addCriterion("label_json between", value1, value2, "labelJson"); - return (Criteria) this; - } - - public Criteria andLabelJsonNotBetween(String value1, String value2) { - addCriterion("label_json not between", value1, value2, "labelJson"); - return (Criteria) this; - } - - public Criteria andMapLocationJsonIsNull() { - addCriterion("map_location_json is null"); - return (Criteria) this; - } - - public Criteria andMapLocationJsonIsNotNull() { - addCriterion("map_location_json is not null"); - return (Criteria) this; - } - - public Criteria andMapLocationJsonEqualTo(String value) { - addCriterion("map_location_json =", value, "mapLocationJson"); - return (Criteria) this; - } - - public Criteria andMapLocationJsonNotEqualTo(String value) { - addCriterion("map_location_json <>", value, "mapLocationJson"); - return (Criteria) this; - } - - public Criteria andMapLocationJsonGreaterThan(String value) { - addCriterion("map_location_json >", value, "mapLocationJson"); - return (Criteria) this; - } - - public Criteria andMapLocationJsonGreaterThanOrEqualTo(String value) { - addCriterion("map_location_json >=", value, "mapLocationJson"); - return (Criteria) this; - } - - public Criteria andMapLocationJsonLessThan(String value) { - addCriterion("map_location_json <", value, "mapLocationJson"); - return (Criteria) this; - } - - public Criteria andMapLocationJsonLessThanOrEqualTo(String value) { - addCriterion("map_location_json <=", value, "mapLocationJson"); - return (Criteria) this; - } - - public Criteria andMapLocationJsonLike(String value) { - addCriterion("map_location_json like", value, "mapLocationJson"); - return (Criteria) this; - } - - public Criteria andMapLocationJsonNotLike(String value) { - addCriterion("map_location_json not like", value, "mapLocationJson"); - return (Criteria) this; - } - - public Criteria andMapLocationJsonIn(List values) { - addCriterion("map_location_json in", values, "mapLocationJson"); - return (Criteria) this; - } - - public Criteria andMapLocationJsonNotIn(List values) { - addCriterion("map_location_json not in", values, "mapLocationJson"); - return (Criteria) this; - } - - public Criteria andMapLocationJsonBetween(String value1, String value2) { - addCriterion("map_location_json between", value1, value2, "mapLocationJson"); - return (Criteria) this; - } - - public Criteria andMapLocationJsonNotBetween(String value1, String value2) { - addCriterion("map_location_json not between", value1, value2, "mapLocationJson"); - return (Criteria) this; - } - - public Criteria andRunPlanIdIsNull() { - addCriterion("run_plan_id is null"); - return (Criteria) this; - } - - public Criteria andRunPlanIdIsNotNull() { - addCriterion("run_plan_id is not null"); - return (Criteria) this; - } - - public Criteria andRunPlanIdEqualTo(Long value) { - addCriterion("run_plan_id =", value, "runPlanId"); - return (Criteria) this; - } - - public Criteria andRunPlanIdNotEqualTo(Long value) { - addCriterion("run_plan_id <>", value, "runPlanId"); - return (Criteria) this; - } - - public Criteria andRunPlanIdGreaterThan(Long value) { - addCriterion("run_plan_id >", value, "runPlanId"); - return (Criteria) this; - } - - public Criteria andRunPlanIdGreaterThanOrEqualTo(Long value) { - addCriterion("run_plan_id >=", value, "runPlanId"); - return (Criteria) this; - } - - public Criteria andRunPlanIdLessThan(Long value) { - addCriterion("run_plan_id <", value, "runPlanId"); - return (Criteria) this; - } - - public Criteria andRunPlanIdLessThanOrEqualTo(Long value) { - addCriterion("run_plan_id <=", value, "runPlanId"); - return (Criteria) this; - } - - public Criteria andRunPlanIdIn(List values) { - addCriterion("run_plan_id in", values, "runPlanId"); - return (Criteria) this; - } - - public Criteria andRunPlanIdNotIn(List values) { - addCriterion("run_plan_id not in", values, "runPlanId"); - return (Criteria) this; - } - - public Criteria andRunPlanIdBetween(Long value1, Long value2) { - addCriterion("run_plan_id between", value1, value2, "runPlanId"); - return (Criteria) this; - } - - public Criteria andRunPlanIdNotBetween(Long value1, Long value2) { - addCriterion("run_plan_id not between", value1, value2, "runPlanId"); - return (Criteria) this; - } - - public Criteria andFailureConditionJsonIsNull() { - addCriterion("failure_condition_json is null"); - return (Criteria) this; - } - - public Criteria andFailureConditionJsonIsNotNull() { - addCriterion("failure_condition_json is not null"); - return (Criteria) this; - } - - public Criteria andFailureConditionJsonEqualTo(String value) { - addCriterion("failure_condition_json =", value, "failureConditionJson"); - return (Criteria) this; - } - - public Criteria andFailureConditionJsonNotEqualTo(String value) { - addCriterion("failure_condition_json <>", value, "failureConditionJson"); - return (Criteria) this; - } - - public Criteria andFailureConditionJsonGreaterThan(String value) { - addCriterion("failure_condition_json >", value, "failureConditionJson"); - return (Criteria) this; - } - - public Criteria andFailureConditionJsonGreaterThanOrEqualTo(String value) { - addCriterion("failure_condition_json >=", value, "failureConditionJson"); - return (Criteria) this; - } - - public Criteria andFailureConditionJsonLessThan(String value) { - addCriterion("failure_condition_json <", value, "failureConditionJson"); - return (Criteria) this; - } - - public Criteria andFailureConditionJsonLessThanOrEqualTo(String value) { - addCriterion("failure_condition_json <=", value, "failureConditionJson"); - return (Criteria) this; - } - - public Criteria andFailureConditionJsonLike(String value) { - addCriterion("failure_condition_json like", value, "failureConditionJson"); - return (Criteria) this; - } - - public Criteria andFailureConditionJsonNotLike(String value) { - addCriterion("failure_condition_json not like", value, "failureConditionJson"); - return (Criteria) this; - } - - public Criteria andFailureConditionJsonIn(List values) { - addCriterion("failure_condition_json in", values, "failureConditionJson"); - return (Criteria) this; - } - - public Criteria andFailureConditionJsonNotIn(List values) { - addCriterion("failure_condition_json not in", values, "failureConditionJson"); - return (Criteria) this; - } - - public Criteria andFailureConditionJsonBetween(String value1, String value2) { - addCriterion("failure_condition_json between", value1, value2, "failureConditionJson"); - return (Criteria) this; - } - - public Criteria andFailureConditionJsonNotBetween(String value1, String value2) { - addCriterion("failure_condition_json not between", value1, value2, "failureConditionJson"); - return (Criteria) this; - } - - public Criteria andCreatorIdIsNull() { - addCriterion("creator_id is null"); - return (Criteria) this; - } - - public Criteria andCreatorIdIsNotNull() { - addCriterion("creator_id is not null"); - return (Criteria) this; - } - - public Criteria andCreatorIdEqualTo(Long value) { - addCriterion("creator_id =", value, "creatorId"); - return (Criteria) this; - } - - public Criteria andCreatorIdNotEqualTo(Long value) { - addCriterion("creator_id <>", value, "creatorId"); - return (Criteria) this; - } - - public Criteria andCreatorIdGreaterThan(Long value) { - addCriterion("creator_id >", value, "creatorId"); - return (Criteria) this; - } - - public Criteria andCreatorIdGreaterThanOrEqualTo(Long value) { - addCriterion("creator_id >=", value, "creatorId"); - return (Criteria) this; - } - - public Criteria andCreatorIdLessThan(Long value) { - addCriterion("creator_id <", value, "creatorId"); - return (Criteria) this; - } - - public Criteria andCreatorIdLessThanOrEqualTo(Long value) { - addCriterion("creator_id <=", value, "creatorId"); - return (Criteria) this; - } - - public Criteria andCreatorIdIn(List values) { - addCriterion("creator_id in", values, "creatorId"); - return (Criteria) this; - } - - public Criteria andCreatorIdNotIn(List values) { - addCriterion("creator_id not in", values, "creatorId"); - return (Criteria) this; - } - - public Criteria andCreatorIdBetween(Long value1, Long value2) { - addCriterion("creator_id between", value1, value2, "creatorId"); - return (Criteria) this; - } - - public Criteria andCreatorIdNotBetween(Long value1, Long value2) { - addCriterion("creator_id not between", value1, value2, "creatorId"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNull() { - addCriterion("create_time is null"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNotNull() { - addCriterion("create_time is not null"); - return (Criteria) this; - } - - public Criteria andCreateTimeEqualTo(LocalDateTime value) { - addCriterion("create_time =", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotEqualTo(LocalDateTime value) { - addCriterion("create_time <>", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThan(LocalDateTime value) { - addCriterion("create_time >", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThanOrEqualTo(LocalDateTime value) { - addCriterion("create_time >=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThan(LocalDateTime value) { - addCriterion("create_time <", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThanOrEqualTo(LocalDateTime value) { - addCriterion("create_time <=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeIn(List values) { - addCriterion("create_time in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotIn(List values) { - addCriterion("create_time not in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeBetween(LocalDateTime value1, LocalDateTime value2) { - addCriterion("create_time between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotBetween(LocalDateTime value1, LocalDateTime value2) { - addCriterion("create_time not between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNull() { - addCriterion("update_time is null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNotNull() { - addCriterion("update_time is not null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeEqualTo(LocalDateTime value) { - addCriterion("update_time =", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotEqualTo(LocalDateTime value) { - addCriterion("update_time <>", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThan(LocalDateTime value) { - addCriterion("update_time >", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThanOrEqualTo(LocalDateTime value) { - addCriterion("update_time >=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThan(LocalDateTime value) { - addCriterion("update_time <", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThanOrEqualTo(LocalDateTime value) { - addCriterion("update_time <=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIn(List values) { - addCriterion("update_time in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotIn(List values) { - addCriterion("update_time not in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeBetween(LocalDateTime value1, LocalDateTime value2) { - addCriterion("update_time between", value1, value2, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotBetween(LocalDateTime value1, LocalDateTime value2) { - addCriterion("update_time not between", value1, value2, "updateTime"); - return (Criteria) this; - } - } - - /** - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } +package club.joylink.rtss.entity.training2; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +public class DraftTraining2Example { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public DraftTraining2Example() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + 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(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("`name` is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("`name` is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("`name` =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("`name` <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("`name` >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("`name` >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("`name` <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("`name` <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("`name` like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("`name` not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("`name` in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("`name` not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("`name` between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("`name` not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andMapIdIsNull() { + addCriterion("map_id is null"); + return (Criteria) this; + } + + public Criteria andMapIdIsNotNull() { + addCriterion("map_id is not null"); + return (Criteria) this; + } + + public Criteria andMapIdEqualTo(Long value) { + addCriterion("map_id =", value, "mapId"); + return (Criteria) this; + } + + public Criteria andMapIdNotEqualTo(Long value) { + addCriterion("map_id <>", value, "mapId"); + return (Criteria) this; + } + + public Criteria andMapIdGreaterThan(Long value) { + addCriterion("map_id >", value, "mapId"); + return (Criteria) this; + } + + public Criteria andMapIdGreaterThanOrEqualTo(Long value) { + addCriterion("map_id >=", value, "mapId"); + return (Criteria) this; + } + + public Criteria andMapIdLessThan(Long value) { + addCriterion("map_id <", value, "mapId"); + return (Criteria) this; + } + + public Criteria andMapIdLessThanOrEqualTo(Long value) { + addCriterion("map_id <=", value, "mapId"); + return (Criteria) this; + } + + public Criteria andMapIdIn(List values) { + addCriterion("map_id in", values, "mapId"); + return (Criteria) this; + } + + public Criteria andMapIdNotIn(List values) { + addCriterion("map_id not in", values, "mapId"); + return (Criteria) this; + } + + public Criteria andMapIdBetween(Long value1, Long value2) { + addCriterion("map_id between", value1, value2, "mapId"); + return (Criteria) this; + } + + public Criteria andMapIdNotBetween(Long value1, Long value2) { + addCriterion("map_id not between", value1, value2, "mapId"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNull() { + addCriterion("description is null"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNotNull() { + addCriterion("description is not null"); + return (Criteria) this; + } + + public Criteria andDescriptionEqualTo(String value) { + addCriterion("description =", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotEqualTo(String value) { + addCriterion("description <>", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThan(String value) { + addCriterion("description >", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThanOrEqualTo(String value) { + addCriterion("description >=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThan(String value) { + addCriterion("description <", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThanOrEqualTo(String value) { + addCriterion("description <=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLike(String value) { + addCriterion("description like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotLike(String value) { + addCriterion("description not like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionIn(List values) { + addCriterion("description in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotIn(List values) { + addCriterion("description not in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionBetween(String value1, String value2) { + addCriterion("description between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotBetween(String value1, String value2) { + addCriterion("description not between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("`type` is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("`type` is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("`type` like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("`type` not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andLabelJsonIsNull() { + addCriterion("label_json is null"); + return (Criteria) this; + } + + public Criteria andLabelJsonIsNotNull() { + addCriterion("label_json is not null"); + return (Criteria) this; + } + + public Criteria andLabelJsonEqualTo(String value) { + addCriterion("label_json =", value, "labelJson"); + return (Criteria) this; + } + + public Criteria andLabelJsonNotEqualTo(String value) { + addCriterion("label_json <>", value, "labelJson"); + return (Criteria) this; + } + + public Criteria andLabelJsonGreaterThan(String value) { + addCriterion("label_json >", value, "labelJson"); + return (Criteria) this; + } + + public Criteria andLabelJsonGreaterThanOrEqualTo(String value) { + addCriterion("label_json >=", value, "labelJson"); + return (Criteria) this; + } + + public Criteria andLabelJsonLessThan(String value) { + addCriterion("label_json <", value, "labelJson"); + return (Criteria) this; + } + + public Criteria andLabelJsonLessThanOrEqualTo(String value) { + addCriterion("label_json <=", value, "labelJson"); + return (Criteria) this; + } + + public Criteria andLabelJsonLike(String value) { + addCriterion("label_json like", value, "labelJson"); + return (Criteria) this; + } + + public Criteria andLabelJsonNotLike(String value) { + addCriterion("label_json not like", value, "labelJson"); + return (Criteria) this; + } + + public Criteria andLabelJsonIn(List values) { + addCriterion("label_json in", values, "labelJson"); + return (Criteria) this; + } + + public Criteria andLabelJsonNotIn(List values) { + addCriterion("label_json not in", values, "labelJson"); + return (Criteria) this; + } + + public Criteria andLabelJsonBetween(String value1, String value2) { + addCriterion("label_json between", value1, value2, "labelJson"); + return (Criteria) this; + } + + public Criteria andLabelJsonNotBetween(String value1, String value2) { + addCriterion("label_json not between", value1, value2, "labelJson"); + return (Criteria) this; + } + + public Criteria andMapLocationJsonIsNull() { + addCriterion("map_location_json is null"); + return (Criteria) this; + } + + public Criteria andMapLocationJsonIsNotNull() { + addCriterion("map_location_json is not null"); + return (Criteria) this; + } + + public Criteria andMapLocationJsonEqualTo(String value) { + addCriterion("map_location_json =", value, "mapLocationJson"); + return (Criteria) this; + } + + public Criteria andMapLocationJsonNotEqualTo(String value) { + addCriterion("map_location_json <>", value, "mapLocationJson"); + return (Criteria) this; + } + + public Criteria andMapLocationJsonGreaterThan(String value) { + addCriterion("map_location_json >", value, "mapLocationJson"); + return (Criteria) this; + } + + public Criteria andMapLocationJsonGreaterThanOrEqualTo(String value) { + addCriterion("map_location_json >=", value, "mapLocationJson"); + return (Criteria) this; + } + + public Criteria andMapLocationJsonLessThan(String value) { + addCriterion("map_location_json <", value, "mapLocationJson"); + return (Criteria) this; + } + + public Criteria andMapLocationJsonLessThanOrEqualTo(String value) { + addCriterion("map_location_json <=", value, "mapLocationJson"); + return (Criteria) this; + } + + public Criteria andMapLocationJsonLike(String value) { + addCriterion("map_location_json like", value, "mapLocationJson"); + return (Criteria) this; + } + + public Criteria andMapLocationJsonNotLike(String value) { + addCriterion("map_location_json not like", value, "mapLocationJson"); + return (Criteria) this; + } + + public Criteria andMapLocationJsonIn(List values) { + addCriterion("map_location_json in", values, "mapLocationJson"); + return (Criteria) this; + } + + public Criteria andMapLocationJsonNotIn(List values) { + addCriterion("map_location_json not in", values, "mapLocationJson"); + return (Criteria) this; + } + + public Criteria andMapLocationJsonBetween(String value1, String value2) { + addCriterion("map_location_json between", value1, value2, "mapLocationJson"); + return (Criteria) this; + } + + public Criteria andMapLocationJsonNotBetween(String value1, String value2) { + addCriterion("map_location_json not between", value1, value2, "mapLocationJson"); + return (Criteria) this; + } + + public Criteria andRunPlanIdIsNull() { + addCriterion("run_plan_id is null"); + return (Criteria) this; + } + + public Criteria andRunPlanIdIsNotNull() { + addCriterion("run_plan_id is not null"); + return (Criteria) this; + } + + public Criteria andRunPlanIdEqualTo(Long value) { + addCriterion("run_plan_id =", value, "runPlanId"); + return (Criteria) this; + } + + public Criteria andRunPlanIdNotEqualTo(Long value) { + addCriterion("run_plan_id <>", value, "runPlanId"); + return (Criteria) this; + } + + public Criteria andRunPlanIdGreaterThan(Long value) { + addCriterion("run_plan_id >", value, "runPlanId"); + return (Criteria) this; + } + + public Criteria andRunPlanIdGreaterThanOrEqualTo(Long value) { + addCriterion("run_plan_id >=", value, "runPlanId"); + return (Criteria) this; + } + + public Criteria andRunPlanIdLessThan(Long value) { + addCriterion("run_plan_id <", value, "runPlanId"); + return (Criteria) this; + } + + public Criteria andRunPlanIdLessThanOrEqualTo(Long value) { + addCriterion("run_plan_id <=", value, "runPlanId"); + return (Criteria) this; + } + + public Criteria andRunPlanIdIn(List values) { + addCriterion("run_plan_id in", values, "runPlanId"); + return (Criteria) this; + } + + public Criteria andRunPlanIdNotIn(List values) { + addCriterion("run_plan_id not in", values, "runPlanId"); + return (Criteria) this; + } + + public Criteria andRunPlanIdBetween(Long value1, Long value2) { + addCriterion("run_plan_id between", value1, value2, "runPlanId"); + return (Criteria) this; + } + + public Criteria andRunPlanIdNotBetween(Long value1, Long value2) { + addCriterion("run_plan_id not between", value1, value2, "runPlanId"); + return (Criteria) this; + } + + public Criteria andFailureConditionJsonIsNull() { + addCriterion("failure_condition_json is null"); + return (Criteria) this; + } + + public Criteria andFailureConditionJsonIsNotNull() { + addCriterion("failure_condition_json is not null"); + return (Criteria) this; + } + + public Criteria andFailureConditionJsonEqualTo(String value) { + addCriterion("failure_condition_json =", value, "failureConditionJson"); + return (Criteria) this; + } + + public Criteria andFailureConditionJsonNotEqualTo(String value) { + addCriterion("failure_condition_json <>", value, "failureConditionJson"); + return (Criteria) this; + } + + public Criteria andFailureConditionJsonGreaterThan(String value) { + addCriterion("failure_condition_json >", value, "failureConditionJson"); + return (Criteria) this; + } + + public Criteria andFailureConditionJsonGreaterThanOrEqualTo(String value) { + addCriterion("failure_condition_json >=", value, "failureConditionJson"); + return (Criteria) this; + } + + public Criteria andFailureConditionJsonLessThan(String value) { + addCriterion("failure_condition_json <", value, "failureConditionJson"); + return (Criteria) this; + } + + public Criteria andFailureConditionJsonLessThanOrEqualTo(String value) { + addCriterion("failure_condition_json <=", value, "failureConditionJson"); + return (Criteria) this; + } + + public Criteria andFailureConditionJsonLike(String value) { + addCriterion("failure_condition_json like", value, "failureConditionJson"); + return (Criteria) this; + } + + public Criteria andFailureConditionJsonNotLike(String value) { + addCriterion("failure_condition_json not like", value, "failureConditionJson"); + return (Criteria) this; + } + + public Criteria andFailureConditionJsonIn(List values) { + addCriterion("failure_condition_json in", values, "failureConditionJson"); + return (Criteria) this; + } + + public Criteria andFailureConditionJsonNotIn(List values) { + addCriterion("failure_condition_json not in", values, "failureConditionJson"); + return (Criteria) this; + } + + public Criteria andFailureConditionJsonBetween(String value1, String value2) { + addCriterion("failure_condition_json between", value1, value2, "failureConditionJson"); + return (Criteria) this; + } + + public Criteria andFailureConditionJsonNotBetween(String value1, String value2) { + addCriterion("failure_condition_json not between", value1, value2, "failureConditionJson"); + return (Criteria) this; + } + + public Criteria andCreatorIdIsNull() { + addCriterion("creator_id is null"); + return (Criteria) this; + } + + public Criteria andCreatorIdIsNotNull() { + addCriterion("creator_id is not null"); + return (Criteria) this; + } + + public Criteria andCreatorIdEqualTo(Long value) { + addCriterion("creator_id =", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotEqualTo(Long value) { + addCriterion("creator_id <>", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdGreaterThan(Long value) { + addCriterion("creator_id >", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdGreaterThanOrEqualTo(Long value) { + addCriterion("creator_id >=", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdLessThan(Long value) { + addCriterion("creator_id <", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdLessThanOrEqualTo(Long value) { + addCriterion("creator_id <=", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdIn(List values) { + addCriterion("creator_id in", values, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotIn(List values) { + addCriterion("creator_id not in", values, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdBetween(Long value1, Long value2) { + addCriterion("creator_id between", value1, value2, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotBetween(Long value1, Long value2) { + addCriterion("creator_id not between", value1, value2, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(LocalDateTime value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(LocalDateTime value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(LocalDateTime value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(LocalDateTime value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(LocalDateTime value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(LocalDateTime value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(LocalDateTime value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(LocalDateTime value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(LocalDateTime value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(LocalDateTime value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(LocalDateTime value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(LocalDateTime value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } } \ No newline at end of file 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 4b71f00c2..ffc541702 100644 --- a/src/main/java/club/joylink/rtss/entity/training2/DraftTraining2WithBLOBs.java +++ b/src/main/java/club/joylink/rtss/entity/training2/DraftTraining2WithBLOBs.java @@ -1,43 +1,48 @@ -package club.joylink.rtss.entity.training2; - -import java.io.Serializable; -import lombok.Data; - -/** - * @author - * - */ -@Data -public class DraftTraining2WithBLOBs extends DraftTraining2 implements Serializable { - /** - * 初始背景 - */ - private String bgSceneJson; - - /** - * 操作列表json(List) - */ - private String operaJson; - - /** - * 步骤列表json(List的json) - */ - private String stepJson; - - /** - * 打分规则列表json(List的json) - */ - private String scoringRuleJson; - - /** - * 仿真内所有成员 - */ - private String memberJson; - - /** - * 参演的仿真成员id列表Json - */ - private String playerIdJson; - - private static final long serialVersionUID = 1L; +package club.joylink.rtss.entity.training2; + +import java.io.Serializable; +import lombok.Data; + +/** + * @author + * + */ +@Data +public class DraftTraining2WithBLOBs extends DraftTraining2 implements Serializable { + /** + * 初始背景 + */ + private String bgSceneJson; + + /** + * 实训编制完保存为最终场景json数据 + */ + private String finalScenesJson; + + /** + * 操作列表json(List) + */ + private String operaJson; + + /** + * 步骤列表json(List的json) + */ + private String stepJson; + + /** + * 打分规则列表json(List的json) + */ + private String scoringRuleJson; + + /** + * 仿真内所有成员 + */ + private String memberJson; + + /** + * 参演的仿真成员id列表Json + */ + private String playerIdJson; + + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/entity/training2/PublishedTraining2.java b/src/main/java/club/joylink/rtss/entity/training2/PublishedTraining2.java index 8af3cdd8b..dd1cb73b7 100644 --- a/src/main/java/club/joylink/rtss/entity/training2/PublishedTraining2.java +++ b/src/main/java/club/joylink/rtss/entity/training2/PublishedTraining2.java @@ -70,4 +70,4 @@ public class PublishedTraining2 implements Serializable { private Integer state; private static final long serialVersionUID = 1L; -} +} \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/entity/training2/PublishedTraining2WithBLOBs.java b/src/main/java/club/joylink/rtss/entity/training2/PublishedTraining2WithBLOBs.java index e27d598a3..02ab8ac09 100644 --- a/src/main/java/club/joylink/rtss/entity/training2/PublishedTraining2WithBLOBs.java +++ b/src/main/java/club/joylink/rtss/entity/training2/PublishedTraining2WithBLOBs.java @@ -39,5 +39,10 @@ public class PublishedTraining2WithBLOBs extends PublishedTraining2 implements S */ private String playerIdJson; + /** + * 实训编制后的最终场景json数据 + */ + private String finalScenesJson; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/services/training2/Training2Convertor.java b/src/main/java/club/joylink/rtss/services/training2/Training2Convertor.java index f50cd6a11..c1027ba14 100644 --- a/src/main/java/club/joylink/rtss/services/training2/Training2Convertor.java +++ b/src/main/java/club/joylink/rtss/services/training2/Training2Convertor.java @@ -33,6 +33,7 @@ public class Training2Convertor { // pub.setMemberJson(from.getMemberJson()); pub.setBgSceneJson(from.getBgSceneJson()); + pub.setFinalScenesJson(from.getFinalScenesJson()); pub.setOperaJson(from.getOperaJson()); pub.setDescription(from.getDescription()); pub.setCreateTime(LocalDateTime.now()); diff --git a/src/main/java/club/joylink/rtss/services/training2/Training2DraftPublishService.java b/src/main/java/club/joylink/rtss/services/training2/Training2DraftPublishService.java index 912a9c7a8..e10adc7e1 100644 --- a/src/main/java/club/joylink/rtss/services/training2/Training2DraftPublishService.java +++ b/src/main/java/club/joylink/rtss/services/training2/Training2DraftPublishService.java @@ -18,7 +18,7 @@ import java.util.List; @Slf4j public class Training2DraftPublishService { @Autowired - private DraftTraining2DAO trainingDao; + private DraftTraining2DAO trainingDao; @Autowired private PublishedTraining2DAO publishedDao; 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 41cad8064..05ee26193 100644 --- a/src/main/java/club/joylink/rtss/services/training2/Training2DraftService.java +++ b/src/main/java/club/joylink/rtss/services/training2/Training2DraftService.java @@ -1,7 +1,6 @@ package club.joylink.rtss.services.training2; import club.joylink.rtss.dao.DraftTraining2DAO; -import club.joylink.rtss.entity.TrainingWithBLOBs; import club.joylink.rtss.entity.training2.DraftTraining2; import club.joylink.rtss.entity.training2.DraftTraining2Example; import club.joylink.rtss.entity.training2.DraftTraining2WithBLOBs; @@ -23,8 +22,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.RequestAttribute; -import org.springframework.web.bind.annotation.RequestBody; import java.time.LocalDateTime; import java.util.ArrayList; @@ -42,6 +39,7 @@ public class Training2DraftService { private DraftTraining2DAO trainingDao; @Autowired private GroupSimulationService roupSimulationService; + /** * 根据基本信息创建实训 * @@ -123,10 +121,11 @@ public class Training2DraftService { // this.trainingDao.updateByExampleSelective(b, example); } + /** * 重置用户实训草稿的初始背景 */ - public void resetTrainingBackgroud(ResetTraining2BackgroudReqVo req, Long userId){ + public void resetTrainingBackgroud(ResetTraining2BackgroudReqVo req, Long userId) { DraftTraining2Example example = new DraftTraining2Example(); example.createCriteria().andCreatorIdEqualTo(userId).andIdEqualTo(req.getId()); List find = this.trainingDao.selectByExample(example); @@ -138,6 +137,7 @@ public class Training2DraftService { // this.trainingDao.updateByExampleSelective(b, example); } + /** * 更新用户实训草稿的地图定位信息 */ @@ -155,6 +155,7 @@ public class Training2DraftService { // this.trainingDao.updateByExampleSelective(b, example); } + /** * 更新当前用户的实训草稿基础信息 */ @@ -256,7 +257,7 @@ public class Training2DraftService { // DraftTraining2Example example = new DraftTraining2Example(); DraftTraining2Example.Criteria c = example.createCriteria().andCreatorIdEqualTo(userId); - if(null!=req.getMapId()){ + if (null != req.getMapId()) { c.andMapIdEqualTo(req.getMapId()); } // @@ -315,11 +316,14 @@ public class Training2DraftService { /** * 修改实训所有步骤 */ - public void updateSteps(Long trainingId, List step2VOList) { + public void updateSteps(String group, Long trainingId, List step2VOList) { DraftTraining2WithBLOBs draftTraining2 = trainingDao.selectByPrimaryKey(trainingId); if (draftTraining2 == null) { throw new SimulationException(SimulationExceptionType.Data_Not_Exist, "实训不存在"); } + // 保存当前背景 + Simulation simulation = this.roupSimulationService.getSimulationByGroup(group); + StorageSimulation scenesSaving = new StorageSimulation(simulation, false); String stepJson; if (CollectionUtils.isEmpty(step2VOList)) { stepJson = StringUtil.EMPTY_STRING; @@ -333,7 +337,12 @@ public class Training2DraftService { if (CollectionUtils.isEmpty(playerList)) { throw new SimulationException(SimulationExceptionType.Data_Not_Exist, "错误数据:无扮演者"); } - trainingDao.updateStepJson(trainingId, stepJson, JsonUtils.writeValueAsString(playerList)); + DraftTraining2WithBLOBs updateObj = new DraftTraining2WithBLOBs(); + updateObj.setId(trainingId); + updateObj.setStepJson(stepJson); + updateObj.setPlayerIdJson(JsonUtils.writeValueAsString(playerList)); + updateObj.setFinalScenesJson(JsonUtils.writeValueAsString(scenesSaving)); + trainingDao.updateByPrimaryKeySelective(updateObj); } /** @@ -344,6 +353,11 @@ public class Training2DraftService { if (draftTraining2 == null) { throw new SimulationException(SimulationExceptionType.Data_Not_Exist, "实训不存在"); } - trainingDao.updateStepJson(trainingId, StringUtil.EMPTY_STRING, StringUtil.EMPTY_STRING); + DraftTraining2WithBLOBs updateObj = new DraftTraining2WithBLOBs(); + updateObj.setId(trainingId); + updateObj.setStepJson(StringUtil.EMPTY_STRING); + updateObj.setPlayerIdJson(StringUtil.EMPTY_STRING); + updateObj.setFinalScenesJson(StringUtil.EMPTY_STRING); + trainingDao.updateByPrimaryKeySelective(updateObj); } } diff --git a/src/main/java/club/joylink/rtss/services/training2/Training2PublishService.java b/src/main/java/club/joylink/rtss/services/training2/Training2PublishService.java index e039abdac..5730f889f 100644 --- a/src/main/java/club/joylink/rtss/services/training2/Training2PublishService.java +++ b/src/main/java/club/joylink/rtss/services/training2/Training2PublishService.java @@ -11,7 +11,6 @@ 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.web.bind.annotation.PathVariable; import java.time.LocalDateTime; import java.util.ArrayList; @@ -77,7 +76,7 @@ public class Training2PublishService { final PutOnPublishedTraining2RspVo rsp =new PutOnPublishedTraining2RspVo(); rsp.setIds(new ArrayList<>()); req.getIds().forEach(id->{ - PublishedTraining2WithBLOBs pub =new PublishedTraining2WithBLOBs(); + PublishedTraining2WithBLOBs pub =new PublishedTraining2WithBLOBs(); pub.setId(Long.valueOf(id)); pub.setState(PublishedTraining2StateEnum.PutOn.getState()); pub.setUpdateTime(LocalDateTime.now()); @@ -198,6 +197,7 @@ public class Training2PublishService { rsp.setRunPlanId(b.getRunPlanId()); rsp.setScoringRuleJson(b.getScoringRuleJson()); rsp.setState(b.getState()); + rsp.setFinalScenesJson(b.getFinalScenesJson()); // return rsp; } diff --git a/src/main/java/club/joylink/rtss/services/training2/Training2Service.java b/src/main/java/club/joylink/rtss/services/training2/Training2Service.java index f89c28ade..7b9c55b00 100644 --- a/src/main/java/club/joylink/rtss/services/training2/Training2Service.java +++ b/src/main/java/club/joylink/rtss/services/training2/Training2Service.java @@ -77,6 +77,8 @@ public class Training2Service { .filter(s -> !s.isCompletion()).findFirst().orElse(null); if (step == null) { // 步骤已经运行完毕 training2.finish(); + // 发送实训完成消息 + sendTrainingFinish(training2, simulation); return; } // 步骤触发 @@ -274,6 +276,14 @@ public class Training2Service { return 1; } + /** + * 完成步骤中操作 + */ + public Integer completionClientStepOperation(String group, Integer stepId + , Integer id, AccountVO user) { + return null; + } + @Async("trainingV2Executor") @EventListener public void handle(SimulationOperationEvent event) { @@ -355,6 +365,17 @@ public class Training2Service { } } + /** + * 实训完成发送消息 + */ + public void sendTrainingFinish(Training2 training2, Simulation simulation) { + if (training2.isFinish()) { + SocketMessageVO message = + SocketMessageFactory.build(WebSocketMessageType.Simulation_Training_Finish, simulation.getId(), "实训完成"); + stompMessageService.sendToUser(simulation.getSimulationUserIds(), message); + } + } + /** * 绘制草稿时加载实训背景 * TODO 后续看根据需求是否加载到最后一步 diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/training2/Training2.java b/src/main/java/club/joylink/rtss/simulation/cbtc/training2/Training2.java index 4d67f3b9a..182eb4033 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/training2/Training2.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/training2/Training2.java @@ -98,15 +98,15 @@ public class Training2 { this.playerIds = JsonUtils.readCollection(draftTraining2.getPlayerIdJson(), List.class, String.class); } labels = JsonUtils.readCollection(draftTraining2.getLabelJson(), List.class, String.class); - if (StringUtils.isEmpty(draftTraining2.getOperaJson())) { + if (!StringUtils.isEmpty(draftTraining2.getOperaJson())) { List operation2VOS = JsonUtils.readCollection(draftTraining2.getOperaJson(), List.class, Operation2VO.class); operations = operation2VOS.stream().map(vo -> vo.convert2BO(simulation)).collect(Collectors.toList()); } - if (StringUtils.isEmpty(draftTraining2.getStepJson())) { + if (!StringUtils.isEmpty(draftTraining2.getStepJson())) { List step2VOS = JsonUtils.readCollection(draftTraining2.getStepJson(), List.class, Step2VO.class); steps = step2VOS.stream().map(vo -> new Step2(vo, simulation)).collect(Collectors.toList()); } - if (StringUtils.isEmpty(draftTraining2.getScoringRuleJson())) { + if (!StringUtils.isEmpty(draftTraining2.getScoringRuleJson())) { List scoringRuleVOS = JsonUtils.readCollection(draftTraining2.getScoringRuleJson(), List.class, ScoringRuleVO.class); scoringRules = scoringRuleVOS.stream().map(vo -> vo.convert2BO(simulation, this)).collect(Collectors.toList()); } @@ -165,6 +165,7 @@ public class Training2 { /** * 打分 + * * @return k-memberId v-分数 */ public Map mark() { diff --git a/src/main/java/club/joylink/rtss/vo/client/WebSocketMessageType.java b/src/main/java/club/joylink/rtss/vo/client/WebSocketMessageType.java index 0840b1c62..16c4fe165 100644 --- a/src/main/java/club/joylink/rtss/vo/client/WebSocketMessageType.java +++ b/src/main/java/club/joylink/rtss/vo/client/WebSocketMessageType.java @@ -409,6 +409,11 @@ public enum WebSocketMessageType { * 操作完成提示信息 */ Simulation_Training_Operate_Finish, + + /** + * 实训完成 + */ + Simulation_Training_Finish /** ------------ 新实训消息 ----------- */ ; } diff --git a/src/main/java/club/joylink/rtss/vo/client/factory/SocketMessageFactory.java b/src/main/java/club/joylink/rtss/vo/client/factory/SocketMessageFactory.java index c88c62f8b..21b8399bc 100644 --- a/src/main/java/club/joylink/rtss/vo/client/factory/SocketMessageFactory.java +++ b/src/main/java/club/joylink/rtss/vo/client/factory/SocketMessageFactory.java @@ -145,7 +145,8 @@ public class SocketMessageFactory { case Simulation_Training_Step_Tip: case Simulation_Training_Step_Finish: case Simulation_Training_Operate_Error: - case Simulation_Training_Operate_Finish: { + case Simulation_Training_Operate_Finish: + case Simulation_Training_Finish: { topicList.add(String.format(WebSocketSubscribeTopic.AssistantSimulation, group)); topicList.add(String.format(WebSocketSubscribeTopic.Simulation, group)); topicList.add(String.format(WebSocketSubscribeTopic.Sandbox3D, group)); diff --git a/src/main/java/club/joylink/rtss/vo/training2/publish/PublishedTraining2DetailRspVo.java b/src/main/java/club/joylink/rtss/vo/training2/publish/PublishedTraining2DetailRspVo.java index dc6823ac8..8518f2837 100644 --- a/src/main/java/club/joylink/rtss/vo/training2/publish/PublishedTraining2DetailRspVo.java +++ b/src/main/java/club/joylink/rtss/vo/training2/publish/PublishedTraining2DetailRspVo.java @@ -48,6 +48,11 @@ public class PublishedTraining2DetailRspVo { */ private String bgSceneJson; + /** + * 实训编制后的最终场景json数据 + */ + private String finalScenesJson; + /** * 运行图id */