From 877a9560760298d82f6edc73aff0d6a8ebdb5d34 Mon Sep 17 00:00:00 2001 From: sunhonglei Date: Tue, 25 Feb 2025 15:18:42 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E8=80=83=E8=AF=95=E5=AE=89=E6=8E=92?= =?UTF-8?q?=E6=9F=A5=E8=AF=A26?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ccic/safeliab/entity/ExamSchedule.java | 42 +++++++++++ .../ccic/safeliab/dao/ExamScheduleMapper.java | 13 ++++ .../safeliab/service/ExamScheduleService.java | 11 +++ .../service/ExamScheduleServiceImpl.java | 16 +++++ .../com/ccic/safeliab/vo/ExamScheduleVO.java | 7 ++ .../safeliab/web/ExamScheduleController.java | 71 +++++++++++++++++++ .../resources/mappers/ExamScheduleMapper.xml | 33 +++++++++ 7 files changed, 193 insertions(+) create mode 100644 ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java create mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java create mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java create mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java create mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/vo/ExamScheduleVO.java create mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java create mode 100644 ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml diff --git a/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java b/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java new file mode 100644 index 0000000..b2dd579 --- /dev/null +++ b/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java @@ -0,0 +1,42 @@ +package com.ccic.safeliab.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.sql.Timestamp; + +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("ex_exam_info") +public class ExamSchedule{ + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + @TableId(value = "exam_id", type = IdType.ID_WORKER) + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long examId; + private String examName; + private Integer paperId; + private String regulatedIndustry; + private String examRegion; + private String validFrom; + private String validTo; + private Integer publishStatus; + private String remark; + private Long createUser; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Timestamp createTime; + private Long updateUser; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Timestamp updateTime; + private Integer status; + private Integer isDeleted; +} diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java b/ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java new file mode 100644 index 0000000..3554315 --- /dev/null +++ b/ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java @@ -0,0 +1,13 @@ +package com.ccic.safeliab.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ccic.safeliab.entity.ExamSchedule; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +@Mapper +public interface ExamScheduleMapper extends BaseMapper { + List selectExamSchedule(Map param); +} \ No newline at end of file diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java new file mode 100644 index 0000000..0212201 --- /dev/null +++ b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java @@ -0,0 +1,11 @@ +package com.ccic.safeliab.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ccic.safeliab.entity.ExamSchedule; + +import java.util.List; +import java.util.Map; + +public interface ExamScheduleService extends IService { + public List selectExamSchedule(Map param); +} diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java new file mode 100644 index 0000000..f4d05bc --- /dev/null +++ b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java @@ -0,0 +1,16 @@ +package com.ccic.safeliab.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ccic.safeliab.dao.ExamScheduleMapper; +import com.ccic.safeliab.entity.ExamSchedule; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +@Service +public class ExamScheduleServiceImpl extends ServiceImpl implements ExamScheduleService { + public List selectExamSchedule(Map param){ + return baseMapper.selectExamSchedule(param); + } +} diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/vo/ExamScheduleVO.java b/ccic-exam/src/main/java/com/ccic/safeliab/vo/ExamScheduleVO.java new file mode 100644 index 0000000..ce0aa5e --- /dev/null +++ b/ccic-exam/src/main/java/com/ccic/safeliab/vo/ExamScheduleVO.java @@ -0,0 +1,7 @@ +package com.ccic.safeliab.vo; + +import com.ccic.safeliab.entity.ExamSchedule; +import com.ccic.safeliab.entity.InsDemo; + +public class ExamScheduleVO extends ExamSchedule { +} diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java b/ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java new file mode 100644 index 0000000..5b44275 --- /dev/null +++ b/ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java @@ -0,0 +1,71 @@ +package com.ccic.safeliab.web; + +import com.ccic.safeliab.entity.ExamSchedule; +import com.ccic.safeliab.service.ExamScheduleService; +import com.ccic.safeliab.support.Condition; +import com.ccic.safeliab.util.R; +import com.ccic.safeliab.vo.ExamScheduleVO; +import com.ccic.safeliab.vo.InsDemoVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/exam-schedule") +public class ExamScheduleController { + @Autowired + private ExamScheduleService service; + @GetMapping("/select") + public R select( @RequestParam(required = false) String examName, + @RequestParam(required = false) String paperName, + @RequestParam(required = false) String regulatedIndustry, + @RequestParam(required = false) String validDate, + @RequestParam(defaultValue = "1") int page, + @RequestParam(defaultValue = "10") int pageSize) { + // 模拟数据库查询 + List examList = new ArrayList<>(); + ExamScheduleVO insDemoVO = new ExamScheduleVO(); + // 这里可以添加实际的数据库查询逻辑 + + Map param = new HashMap<>(); + param.put("examName", examName); + param.put("paperName", paperName); + param.put("regulatedIndustry", regulatedIndustry); + param.put("date", validDate); + examList = service.selectExamSchedule(param); + Map result = new HashMap<>(); + result.put("data", examList); + result.put("total", examList.size()); + return R.ok().data(result); + } + @GetMapping("/cancel") + public R cancel() { + ExamScheduleVO insDemoVO = new ExamScheduleVO(); + return R.ok().data(service.list(Condition.getQueryWrapper(insDemoVO))); + } + @GetMapping("/publish") + public R publish() { + ExamScheduleVO insDemoVO = new ExamScheduleVO(); + return R.ok().data(service.list(Condition.getQueryWrapper(insDemoVO))); + } + @PostMapping("/update") + public R update(@RequestBody ExamScheduleVO examSchedule) { + boolean result = service.saveOrUpdate(examSchedule); + return R.ok().data("success."); + } + + @PostMapping("/insert") + public R insert(@RequestBody ExamScheduleVO examSchedule) { + boolean result = service.save(examSchedule); + return R.ok().data("success."); + } + + @GetMapping("/show") + public R show() { + return R.ok().data("success."); + } +} diff --git a/ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml b/ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml new file mode 100644 index 0000000..446d018 --- /dev/null +++ b/ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml @@ -0,0 +1,33 @@ + + + + + \ No newline at end of file From b20171e25dc399bcf6fc5f2759c188e083059f0f Mon Sep 17 00:00:00 2001 From: sunhonglei Date: Tue, 25 Feb 2025 15:19:24 +0800 Subject: [PATCH 2/6] =?UTF-8?q?Revert=20"=E8=80=83=E8=AF=95=E5=AE=89?= =?UTF-8?q?=E6=8E=92=E6=9F=A5=E8=AF=A26"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 877a9560760298d82f6edc73aff0d6a8ebdb5d34. --- .../ccic/safeliab/entity/ExamSchedule.java | 42 ----------- .../ccic/safeliab/dao/ExamScheduleMapper.java | 13 ---- .../safeliab/service/ExamScheduleService.java | 11 --- .../service/ExamScheduleServiceImpl.java | 16 ----- .../com/ccic/safeliab/vo/ExamScheduleVO.java | 7 -- .../safeliab/web/ExamScheduleController.java | 71 ------------------- .../resources/mappers/ExamScheduleMapper.xml | 33 --------- 7 files changed, 193 deletions(-) delete mode 100644 ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java delete mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java delete mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java delete mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java delete mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/vo/ExamScheduleVO.java delete mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java delete mode 100644 ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml diff --git a/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java b/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java deleted file mode 100644 index b2dd579..0000000 --- a/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.ccic.safeliab.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.sql.Timestamp; - -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ex_exam_info") -public class ExamSchedule{ - private static final long serialVersionUID = 1L; - - /** - * 主键ID - */ - @TableId(value = "exam_id", type = IdType.ID_WORKER) - @JsonFormat(shape = JsonFormat.Shape.STRING) - private Long examId; - private String examName; - private Integer paperId; - private String regulatedIndustry; - private String examRegion; - private String validFrom; - private String validTo; - private Integer publishStatus; - private String remark; - private Long createUser; - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Timestamp createTime; - private Long updateUser; - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Timestamp updateTime; - private Integer status; - private Integer isDeleted; -} diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java b/ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java deleted file mode 100644 index 3554315..0000000 --- a/ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.ccic.safeliab.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.ccic.safeliab.entity.ExamSchedule; -import org.apache.ibatis.annotations.Mapper; - -import java.util.List; -import java.util.Map; - -@Mapper -public interface ExamScheduleMapper extends BaseMapper { - List selectExamSchedule(Map param); -} \ No newline at end of file diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java deleted file mode 100644 index 0212201..0000000 --- a/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.ccic.safeliab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.ccic.safeliab.entity.ExamSchedule; - -import java.util.List; -import java.util.Map; - -public interface ExamScheduleService extends IService { - public List selectExamSchedule(Map param); -} diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java deleted file mode 100644 index f4d05bc..0000000 --- a/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.ccic.safeliab.service; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.ccic.safeliab.dao.ExamScheduleMapper; -import com.ccic.safeliab.entity.ExamSchedule; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Map; - -@Service -public class ExamScheduleServiceImpl extends ServiceImpl implements ExamScheduleService { - public List selectExamSchedule(Map param){ - return baseMapper.selectExamSchedule(param); - } -} diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/vo/ExamScheduleVO.java b/ccic-exam/src/main/java/com/ccic/safeliab/vo/ExamScheduleVO.java deleted file mode 100644 index ce0aa5e..0000000 --- a/ccic-exam/src/main/java/com/ccic/safeliab/vo/ExamScheduleVO.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.ccic.safeliab.vo; - -import com.ccic.safeliab.entity.ExamSchedule; -import com.ccic.safeliab.entity.InsDemo; - -public class ExamScheduleVO extends ExamSchedule { -} diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java b/ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java deleted file mode 100644 index 5b44275..0000000 --- a/ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.ccic.safeliab.web; - -import com.ccic.safeliab.entity.ExamSchedule; -import com.ccic.safeliab.service.ExamScheduleService; -import com.ccic.safeliab.support.Condition; -import com.ccic.safeliab.util.R; -import com.ccic.safeliab.vo.ExamScheduleVO; -import com.ccic.safeliab.vo.InsDemoVO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@RestController -@RequestMapping("/exam-schedule") -public class ExamScheduleController { - @Autowired - private ExamScheduleService service; - @GetMapping("/select") - public R select( @RequestParam(required = false) String examName, - @RequestParam(required = false) String paperName, - @RequestParam(required = false) String regulatedIndustry, - @RequestParam(required = false) String validDate, - @RequestParam(defaultValue = "1") int page, - @RequestParam(defaultValue = "10") int pageSize) { - // 模拟数据库查询 - List examList = new ArrayList<>(); - ExamScheduleVO insDemoVO = new ExamScheduleVO(); - // 这里可以添加实际的数据库查询逻辑 - - Map param = new HashMap<>(); - param.put("examName", examName); - param.put("paperName", paperName); - param.put("regulatedIndustry", regulatedIndustry); - param.put("date", validDate); - examList = service.selectExamSchedule(param); - Map result = new HashMap<>(); - result.put("data", examList); - result.put("total", examList.size()); - return R.ok().data(result); - } - @GetMapping("/cancel") - public R cancel() { - ExamScheduleVO insDemoVO = new ExamScheduleVO(); - return R.ok().data(service.list(Condition.getQueryWrapper(insDemoVO))); - } - @GetMapping("/publish") - public R publish() { - ExamScheduleVO insDemoVO = new ExamScheduleVO(); - return R.ok().data(service.list(Condition.getQueryWrapper(insDemoVO))); - } - @PostMapping("/update") - public R update(@RequestBody ExamScheduleVO examSchedule) { - boolean result = service.saveOrUpdate(examSchedule); - return R.ok().data("success."); - } - - @PostMapping("/insert") - public R insert(@RequestBody ExamScheduleVO examSchedule) { - boolean result = service.save(examSchedule); - return R.ok().data("success."); - } - - @GetMapping("/show") - public R show() { - return R.ok().data("success."); - } -} diff --git a/ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml b/ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml deleted file mode 100644 index 446d018..0000000 --- a/ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - \ No newline at end of file From e5fe333a03bbf264ddd53e7ec6b330f9fa945df5 Mon Sep 17 00:00:00 2001 From: sunhonglei Date: Tue, 25 Feb 2025 15:21:09 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E8=80=83=E8=AF=95=E5=AE=89=E6=8E=92?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ccic/safeliab/entity/ExamSchedule.java | 42 +++++++++++ .../ccic/safeliab/dao/ExamScheduleMapper.java | 13 ++++ .../safeliab/service/ExamScheduleService.java | 11 +++ .../service/ExamScheduleServiceImpl.java | 16 +++++ .../com/ccic/safeliab/vo/ExamScheduleVO.java | 7 ++ .../safeliab/web/ExamScheduleController.java | 71 +++++++++++++++++++ .../resources/mappers/ExamScheduleMapper.xml | 33 +++++++++ 7 files changed, 193 insertions(+) create mode 100644 ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java create mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java create mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java create mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java create mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/vo/ExamScheduleVO.java create mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java create mode 100644 ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml diff --git a/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java b/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java new file mode 100644 index 0000000..b2dd579 --- /dev/null +++ b/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java @@ -0,0 +1,42 @@ +package com.ccic.safeliab.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.sql.Timestamp; + +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("ex_exam_info") +public class ExamSchedule{ + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + @TableId(value = "exam_id", type = IdType.ID_WORKER) + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long examId; + private String examName; + private Integer paperId; + private String regulatedIndustry; + private String examRegion; + private String validFrom; + private String validTo; + private Integer publishStatus; + private String remark; + private Long createUser; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Timestamp createTime; + private Long updateUser; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Timestamp updateTime; + private Integer status; + private Integer isDeleted; +} diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java b/ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java new file mode 100644 index 0000000..3554315 --- /dev/null +++ b/ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java @@ -0,0 +1,13 @@ +package com.ccic.safeliab.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ccic.safeliab.entity.ExamSchedule; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +@Mapper +public interface ExamScheduleMapper extends BaseMapper { + List selectExamSchedule(Map param); +} \ No newline at end of file diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java new file mode 100644 index 0000000..0212201 --- /dev/null +++ b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java @@ -0,0 +1,11 @@ +package com.ccic.safeliab.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ccic.safeliab.entity.ExamSchedule; + +import java.util.List; +import java.util.Map; + +public interface ExamScheduleService extends IService { + public List selectExamSchedule(Map param); +} diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java new file mode 100644 index 0000000..f4d05bc --- /dev/null +++ b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java @@ -0,0 +1,16 @@ +package com.ccic.safeliab.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ccic.safeliab.dao.ExamScheduleMapper; +import com.ccic.safeliab.entity.ExamSchedule; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +@Service +public class ExamScheduleServiceImpl extends ServiceImpl implements ExamScheduleService { + public List selectExamSchedule(Map param){ + return baseMapper.selectExamSchedule(param); + } +} diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/vo/ExamScheduleVO.java b/ccic-exam/src/main/java/com/ccic/safeliab/vo/ExamScheduleVO.java new file mode 100644 index 0000000..ce0aa5e --- /dev/null +++ b/ccic-exam/src/main/java/com/ccic/safeliab/vo/ExamScheduleVO.java @@ -0,0 +1,7 @@ +package com.ccic.safeliab.vo; + +import com.ccic.safeliab.entity.ExamSchedule; +import com.ccic.safeliab.entity.InsDemo; + +public class ExamScheduleVO extends ExamSchedule { +} diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java b/ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java new file mode 100644 index 0000000..5b44275 --- /dev/null +++ b/ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java @@ -0,0 +1,71 @@ +package com.ccic.safeliab.web; + +import com.ccic.safeliab.entity.ExamSchedule; +import com.ccic.safeliab.service.ExamScheduleService; +import com.ccic.safeliab.support.Condition; +import com.ccic.safeliab.util.R; +import com.ccic.safeliab.vo.ExamScheduleVO; +import com.ccic.safeliab.vo.InsDemoVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/exam-schedule") +public class ExamScheduleController { + @Autowired + private ExamScheduleService service; + @GetMapping("/select") + public R select( @RequestParam(required = false) String examName, + @RequestParam(required = false) String paperName, + @RequestParam(required = false) String regulatedIndustry, + @RequestParam(required = false) String validDate, + @RequestParam(defaultValue = "1") int page, + @RequestParam(defaultValue = "10") int pageSize) { + // 模拟数据库查询 + List examList = new ArrayList<>(); + ExamScheduleVO insDemoVO = new ExamScheduleVO(); + // 这里可以添加实际的数据库查询逻辑 + + Map param = new HashMap<>(); + param.put("examName", examName); + param.put("paperName", paperName); + param.put("regulatedIndustry", regulatedIndustry); + param.put("date", validDate); + examList = service.selectExamSchedule(param); + Map result = new HashMap<>(); + result.put("data", examList); + result.put("total", examList.size()); + return R.ok().data(result); + } + @GetMapping("/cancel") + public R cancel() { + ExamScheduleVO insDemoVO = new ExamScheduleVO(); + return R.ok().data(service.list(Condition.getQueryWrapper(insDemoVO))); + } + @GetMapping("/publish") + public R publish() { + ExamScheduleVO insDemoVO = new ExamScheduleVO(); + return R.ok().data(service.list(Condition.getQueryWrapper(insDemoVO))); + } + @PostMapping("/update") + public R update(@RequestBody ExamScheduleVO examSchedule) { + boolean result = service.saveOrUpdate(examSchedule); + return R.ok().data("success."); + } + + @PostMapping("/insert") + public R insert(@RequestBody ExamScheduleVO examSchedule) { + boolean result = service.save(examSchedule); + return R.ok().data("success."); + } + + @GetMapping("/show") + public R show() { + return R.ok().data("success."); + } +} diff --git a/ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml b/ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml new file mode 100644 index 0000000..446d018 --- /dev/null +++ b/ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml @@ -0,0 +1,33 @@ + + + + + \ No newline at end of file From 4708008cfa11eebc451e27f49f59744c2c2bfaa2 Mon Sep 17 00:00:00 2001 From: sunhonglei Date: Tue, 25 Feb 2025 15:19:24 +0800 Subject: [PATCH 4/6] =?UTF-8?q?Revert=20"=E8=80=83=E8=AF=95=E5=AE=89?= =?UTF-8?q?=E6=8E=92=E6=9F=A5=E8=AF=A26"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 877a9560760298d82f6edc73aff0d6a8ebdb5d34. --- .../ccic/safeliab/entity/ExamSchedule.java | 42 ----------- .../ccic/safeliab/dao/ExamScheduleMapper.java | 13 ---- .../safeliab/service/ExamScheduleService.java | 11 --- .../service/ExamScheduleServiceImpl.java | 16 ----- .../com/ccic/safeliab/vo/ExamScheduleVO.java | 7 -- .../safeliab/web/ExamScheduleController.java | 71 ------------------- .../resources/mappers/ExamScheduleMapper.xml | 33 --------- 7 files changed, 193 deletions(-) delete mode 100644 ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java delete mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java delete mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java delete mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java delete mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/vo/ExamScheduleVO.java delete mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java delete mode 100644 ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml diff --git a/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java b/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java deleted file mode 100644 index b2dd579..0000000 --- a/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.ccic.safeliab.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.sql.Timestamp; - -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ex_exam_info") -public class ExamSchedule{ - private static final long serialVersionUID = 1L; - - /** - * 主键ID - */ - @TableId(value = "exam_id", type = IdType.ID_WORKER) - @JsonFormat(shape = JsonFormat.Shape.STRING) - private Long examId; - private String examName; - private Integer paperId; - private String regulatedIndustry; - private String examRegion; - private String validFrom; - private String validTo; - private Integer publishStatus; - private String remark; - private Long createUser; - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Timestamp createTime; - private Long updateUser; - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Timestamp updateTime; - private Integer status; - private Integer isDeleted; -} diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java b/ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java deleted file mode 100644 index 3554315..0000000 --- a/ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.ccic.safeliab.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.ccic.safeliab.entity.ExamSchedule; -import org.apache.ibatis.annotations.Mapper; - -import java.util.List; -import java.util.Map; - -@Mapper -public interface ExamScheduleMapper extends BaseMapper { - List selectExamSchedule(Map param); -} \ No newline at end of file diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java deleted file mode 100644 index 0212201..0000000 --- a/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.ccic.safeliab.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.ccic.safeliab.entity.ExamSchedule; - -import java.util.List; -import java.util.Map; - -public interface ExamScheduleService extends IService { - public List selectExamSchedule(Map param); -} diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java deleted file mode 100644 index f4d05bc..0000000 --- a/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.ccic.safeliab.service; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.ccic.safeliab.dao.ExamScheduleMapper; -import com.ccic.safeliab.entity.ExamSchedule; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Map; - -@Service -public class ExamScheduleServiceImpl extends ServiceImpl implements ExamScheduleService { - public List selectExamSchedule(Map param){ - return baseMapper.selectExamSchedule(param); - } -} diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/vo/ExamScheduleVO.java b/ccic-exam/src/main/java/com/ccic/safeliab/vo/ExamScheduleVO.java deleted file mode 100644 index ce0aa5e..0000000 --- a/ccic-exam/src/main/java/com/ccic/safeliab/vo/ExamScheduleVO.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.ccic.safeliab.vo; - -import com.ccic.safeliab.entity.ExamSchedule; -import com.ccic.safeliab.entity.InsDemo; - -public class ExamScheduleVO extends ExamSchedule { -} diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java b/ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java deleted file mode 100644 index 5b44275..0000000 --- a/ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.ccic.safeliab.web; - -import com.ccic.safeliab.entity.ExamSchedule; -import com.ccic.safeliab.service.ExamScheduleService; -import com.ccic.safeliab.support.Condition; -import com.ccic.safeliab.util.R; -import com.ccic.safeliab.vo.ExamScheduleVO; -import com.ccic.safeliab.vo.InsDemoVO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@RestController -@RequestMapping("/exam-schedule") -public class ExamScheduleController { - @Autowired - private ExamScheduleService service; - @GetMapping("/select") - public R select( @RequestParam(required = false) String examName, - @RequestParam(required = false) String paperName, - @RequestParam(required = false) String regulatedIndustry, - @RequestParam(required = false) String validDate, - @RequestParam(defaultValue = "1") int page, - @RequestParam(defaultValue = "10") int pageSize) { - // 模拟数据库查询 - List examList = new ArrayList<>(); - ExamScheduleVO insDemoVO = new ExamScheduleVO(); - // 这里可以添加实际的数据库查询逻辑 - - Map param = new HashMap<>(); - param.put("examName", examName); - param.put("paperName", paperName); - param.put("regulatedIndustry", regulatedIndustry); - param.put("date", validDate); - examList = service.selectExamSchedule(param); - Map result = new HashMap<>(); - result.put("data", examList); - result.put("total", examList.size()); - return R.ok().data(result); - } - @GetMapping("/cancel") - public R cancel() { - ExamScheduleVO insDemoVO = new ExamScheduleVO(); - return R.ok().data(service.list(Condition.getQueryWrapper(insDemoVO))); - } - @GetMapping("/publish") - public R publish() { - ExamScheduleVO insDemoVO = new ExamScheduleVO(); - return R.ok().data(service.list(Condition.getQueryWrapper(insDemoVO))); - } - @PostMapping("/update") - public R update(@RequestBody ExamScheduleVO examSchedule) { - boolean result = service.saveOrUpdate(examSchedule); - return R.ok().data("success."); - } - - @PostMapping("/insert") - public R insert(@RequestBody ExamScheduleVO examSchedule) { - boolean result = service.save(examSchedule); - return R.ok().data("success."); - } - - @GetMapping("/show") - public R show() { - return R.ok().data("success."); - } -} diff --git a/ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml b/ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml deleted file mode 100644 index 446d018..0000000 --- a/ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - \ No newline at end of file From a98509f3a589be1c20507bf50d805d2296e9d55f Mon Sep 17 00:00:00 2001 From: sunhonglei Date: Tue, 25 Feb 2025 15:24:29 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E8=80=83=E8=AF=95=E5=AE=89=E6=8E=92?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ccic/safeliab/entity/ExamSchedule.java | 42 +++++++++++ .../ccic/safeliab/dao/ExamScheduleMapper.java | 13 ++++ .../safeliab/service/ExamScheduleService.java | 11 +++ .../service/ExamScheduleServiceImpl.java | 16 +++++ .../com/ccic/safeliab/vo/ExamScheduleVO.java | 7 ++ .../safeliab/web/ExamScheduleController.java | 71 +++++++++++++++++++ .../resources/mappers/ExamScheduleMapper.xml | 33 +++++++++ 7 files changed, 193 insertions(+) create mode 100644 ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java create mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java create mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java create mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java create mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/vo/ExamScheduleVO.java create mode 100644 ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java create mode 100644 ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml diff --git a/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java b/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java new file mode 100644 index 0000000..b2dd579 --- /dev/null +++ b/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java @@ -0,0 +1,42 @@ +package com.ccic.safeliab.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.sql.Timestamp; + +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("ex_exam_info") +public class ExamSchedule{ + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + @TableId(value = "exam_id", type = IdType.ID_WORKER) + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long examId; + private String examName; + private Integer paperId; + private String regulatedIndustry; + private String examRegion; + private String validFrom; + private String validTo; + private Integer publishStatus; + private String remark; + private Long createUser; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Timestamp createTime; + private Long updateUser; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Timestamp updateTime; + private Integer status; + private Integer isDeleted; +} diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java b/ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java new file mode 100644 index 0000000..3554315 --- /dev/null +++ b/ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java @@ -0,0 +1,13 @@ +package com.ccic.safeliab.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ccic.safeliab.entity.ExamSchedule; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +@Mapper +public interface ExamScheduleMapper extends BaseMapper { + List selectExamSchedule(Map param); +} \ No newline at end of file diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java new file mode 100644 index 0000000..0212201 --- /dev/null +++ b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java @@ -0,0 +1,11 @@ +package com.ccic.safeliab.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ccic.safeliab.entity.ExamSchedule; + +import java.util.List; +import java.util.Map; + +public interface ExamScheduleService extends IService { + public List selectExamSchedule(Map param); +} diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java new file mode 100644 index 0000000..f4d05bc --- /dev/null +++ b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java @@ -0,0 +1,16 @@ +package com.ccic.safeliab.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ccic.safeliab.dao.ExamScheduleMapper; +import com.ccic.safeliab.entity.ExamSchedule; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +@Service +public class ExamScheduleServiceImpl extends ServiceImpl implements ExamScheduleService { + public List selectExamSchedule(Map param){ + return baseMapper.selectExamSchedule(param); + } +} diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/vo/ExamScheduleVO.java b/ccic-exam/src/main/java/com/ccic/safeliab/vo/ExamScheduleVO.java new file mode 100644 index 0000000..ce0aa5e --- /dev/null +++ b/ccic-exam/src/main/java/com/ccic/safeliab/vo/ExamScheduleVO.java @@ -0,0 +1,7 @@ +package com.ccic.safeliab.vo; + +import com.ccic.safeliab.entity.ExamSchedule; +import com.ccic.safeliab.entity.InsDemo; + +public class ExamScheduleVO extends ExamSchedule { +} diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java b/ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java new file mode 100644 index 0000000..5b44275 --- /dev/null +++ b/ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java @@ -0,0 +1,71 @@ +package com.ccic.safeliab.web; + +import com.ccic.safeliab.entity.ExamSchedule; +import com.ccic.safeliab.service.ExamScheduleService; +import com.ccic.safeliab.support.Condition; +import com.ccic.safeliab.util.R; +import com.ccic.safeliab.vo.ExamScheduleVO; +import com.ccic.safeliab.vo.InsDemoVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/exam-schedule") +public class ExamScheduleController { + @Autowired + private ExamScheduleService service; + @GetMapping("/select") + public R select( @RequestParam(required = false) String examName, + @RequestParam(required = false) String paperName, + @RequestParam(required = false) String regulatedIndustry, + @RequestParam(required = false) String validDate, + @RequestParam(defaultValue = "1") int page, + @RequestParam(defaultValue = "10") int pageSize) { + // 模拟数据库查询 + List examList = new ArrayList<>(); + ExamScheduleVO insDemoVO = new ExamScheduleVO(); + // 这里可以添加实际的数据库查询逻辑 + + Map param = new HashMap<>(); + param.put("examName", examName); + param.put("paperName", paperName); + param.put("regulatedIndustry", regulatedIndustry); + param.put("date", validDate); + examList = service.selectExamSchedule(param); + Map result = new HashMap<>(); + result.put("data", examList); + result.put("total", examList.size()); + return R.ok().data(result); + } + @GetMapping("/cancel") + public R cancel() { + ExamScheduleVO insDemoVO = new ExamScheduleVO(); + return R.ok().data(service.list(Condition.getQueryWrapper(insDemoVO))); + } + @GetMapping("/publish") + public R publish() { + ExamScheduleVO insDemoVO = new ExamScheduleVO(); + return R.ok().data(service.list(Condition.getQueryWrapper(insDemoVO))); + } + @PostMapping("/update") + public R update(@RequestBody ExamScheduleVO examSchedule) { + boolean result = service.saveOrUpdate(examSchedule); + return R.ok().data("success."); + } + + @PostMapping("/insert") + public R insert(@RequestBody ExamScheduleVO examSchedule) { + boolean result = service.save(examSchedule); + return R.ok().data("success."); + } + + @GetMapping("/show") + public R show() { + return R.ok().data("success."); + } +} diff --git a/ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml b/ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml new file mode 100644 index 0000000..446d018 --- /dev/null +++ b/ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml @@ -0,0 +1,33 @@ + + + + + \ No newline at end of file From 824b170a721bdfc5a89f41975a0be485c65b1f74 Mon Sep 17 00:00:00 2001 From: sunhonglei Date: Wed, 26 Feb 2025 14:26:35 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E8=80=83=E8=AF=95=E5=AE=89=E6=8E=92?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=94=BB=E9=9D=A2=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ccic/safeliab/entity/ExamSchedule.java | 10 +--------- .../ccic/safeliab/dao/ExamScheduleMapper.java | 3 +++ .../safeliab/service/ExamScheduleService.java | 6 +++++- .../service/ExamScheduleServiceImpl.java | 16 +++++++++++++++- .../safeliab/web/ExamScheduleController.java | 16 +++++++++++++++- .../resources/mappers/ExamScheduleMapper.xml | 17 +++++++++++++++++ 6 files changed, 56 insertions(+), 12 deletions(-) diff --git a/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java b/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java index b2dd579..31ac3af 100644 --- a/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java +++ b/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExamSchedule.java @@ -14,7 +14,7 @@ import java.sql.Timestamp; @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("ex_exam_info") -public class ExamSchedule{ +public class ExamSchedule extends BaseEntity{ private static final long serialVersionUID = 1L; /** @@ -31,12 +31,4 @@ public class ExamSchedule{ private String validTo; private Integer publishStatus; private String remark; - private Long createUser; - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Timestamp createTime; - private Long updateUser; - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Timestamp updateTime; - private Integer status; - private Integer isDeleted; } diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java b/ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java index 3554315..0b77843 100644 --- a/ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java +++ b/ccic-exam/src/main/java/com/ccic/safeliab/dao/ExamScheduleMapper.java @@ -2,6 +2,7 @@ package com.ccic.safeliab.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ccic.safeliab.entity.ExamSchedule; +import com.ccic.safeliab.entity.Industry; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -10,4 +11,6 @@ import java.util.Map; @Mapper public interface ExamScheduleMapper extends BaseMapper { List selectExamSchedule(Map param); + List> getIndustry(); + List> getPaper(); } \ No newline at end of file diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java index 0212201..b2fcf2d 100644 --- a/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java +++ b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleService.java @@ -2,10 +2,14 @@ package com.ccic.safeliab.service; import com.baomidou.mybatisplus.extension.service.IService; import com.ccic.safeliab.entity.ExamSchedule; +import com.ccic.safeliab.entity.Industry; +import com.ccic.safeliab.support.BaseService; import java.util.List; import java.util.Map; -public interface ExamScheduleService extends IService { +public interface ExamScheduleService extends BaseService { public List selectExamSchedule(Map param); + public List> getIndustry(); + public List> getPaper(); } diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java index f4d05bc..2d081be 100644 --- a/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java +++ b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamScheduleServiceImpl.java @@ -1,16 +1,30 @@ package com.ccic.safeliab.service; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ccic.safeliab.dao.ExamScheduleMapper; import com.ccic.safeliab.entity.ExamSchedule; +import com.ccic.safeliab.entity.Industry; +import com.ccic.safeliab.support.BaseServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; import java.util.Map; @Service -public class ExamScheduleServiceImpl extends ServiceImpl implements ExamScheduleService { +public class ExamScheduleServiceImpl extends BaseServiceImpl implements ExamScheduleService { + public List selectExamSchedule(Map param){ return baseMapper.selectExamSchedule(param); } + + public List> getIndustry(){ + return baseMapper.getIndustry(); + } + + public List> getPaper(){ + return baseMapper.getPaper(); + } + } diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java b/ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java index 5b44275..7836aff 100644 --- a/ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java +++ b/ccic-exam/src/main/java/com/ccic/safeliab/web/ExamScheduleController.java @@ -15,7 +15,7 @@ import java.util.List; import java.util.Map; @RestController -@RequestMapping("/exam-schedule") +@RequestMapping("/ex/exam-schedule") public class ExamScheduleController { @Autowired private ExamScheduleService service; @@ -54,15 +54,29 @@ public class ExamScheduleController { } @PostMapping("/update") public R update(@RequestBody ExamScheduleVO examSchedule) { + examSchedule.setPublishStatus(0); boolean result = service.saveOrUpdate(examSchedule); return R.ok().data("success."); } @PostMapping("/insert") public R insert(@RequestBody ExamScheduleVO examSchedule) { + examSchedule.setPublishStatus(0); boolean result = service.save(examSchedule); return R.ok().data("success."); } + @GetMapping("/getIndustry") + public R getIndustry(){ + return R.ok().data(service.getIndustry()); + } + + @GetMapping("/getPaper") + public R getPaper(){ + List> results = new ArrayList<>(); + results.addAll(service.getPaper()); + return R.ok().data(results); + } + @GetMapping("/show") public R show() { diff --git a/ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml b/ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml index 446d018..7c62d00 100644 --- a/ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml +++ b/ccic-exam/src/main/resources/mappers/ExamScheduleMapper.xml @@ -30,4 +30,21 @@ AND #{date} BETWEEN info.valid_from AND info.valid_to + + \ No newline at end of file