diff --git a/src/main/java/com/rj/controller/LoveCheckItemChildController.java b/src/main/java/com/rj/controller/LoveCheckItemChildController.java new file mode 100644 index 0000000..c99a135 --- /dev/null +++ b/src/main/java/com/rj/controller/LoveCheckItemChildController.java @@ -0,0 +1,245 @@ +package com.rj.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.rj.entity.LoveCheckItemChild; +import com.rj.service.ILoveCheckItemChildService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/** + * 恋爱/择偶检查项子表 前端控制器(love_check_item_child) + * + * @author system + * @since 2026-04-06 + */ +@RestController +@RequestMapping("/api/loveCheckItemChild") +@Tag(name = "恋爱检查项子表", description = "love_check_item_child 表 CRUD") +public class LoveCheckItemChildController { + + @Autowired + private ILoveCheckItemChildService loveCheckItemChildService; + + @PostMapping("/add") + @Operation(summary = "新增", description = "新增一条子表记录") + public ResponseEntity> add( + @Parameter(description = "实体 JSON", required = true) + @RequestBody LoveCheckItemChild body) { + Map result = new HashMap<>(); + try { + if (body.getId() == null || body.getId().trim().isEmpty()) { + body.setId(UUID.randomUUID().toString()); + } + LocalDateTime now = LocalDateTime.now(); + body.setCreateTime(now); + body.setUpdateTime(now); + boolean success = loveCheckItemChildService.save(body); + if (success) { + result.put("success", true); + result.put("message", "添加成功"); + result.put("data", body); + return ResponseEntity.ok(result); + } + result.put("success", false); + result.put("message", "添加失败"); + return ResponseEntity.badRequest().body(result); + } catch (Exception e) { + result.put("success", false); + result.put("message", "添加异常:" + e.getMessage()); + return ResponseEntity.internalServerError().body(result); + } + } + + @GetMapping("/get/{id}") + @Operation(summary = "按主键查询", description = "根据 id(UUID)查询") + public ResponseEntity> getById( + @Parameter(description = "主键 UUID", required = true) @PathVariable String id) { + Map result = new HashMap<>(); + try { + LoveCheckItemChild row = loveCheckItemChildService.getById(id); + if (row != null) { + result.put("success", true); + result.put("message", "查询成功"); + result.put("data", row); + return ResponseEntity.ok(result); + } + result.put("success", false); + result.put("message", "记录不存在"); + return ResponseEntity.notFound().build(); + } catch (Exception e) { + result.put("success", false); + result.put("message", "查询异常:" + e.getMessage()); + return ResponseEntity.internalServerError().body(result); + } + } + + @GetMapping("/list") + @Operation(summary = "分页列表", description = "支持 parentId、项目名称、场景(模糊)及时间范围等条件") + public ResponseEntity> list( + @Parameter(description = "页码") @RequestParam(defaultValue = "1") Integer current, + @Parameter(description = "每页条数") @RequestParam(defaultValue = "10") Integer size, + @Parameter(description = "父级ID(精确)") @RequestParam(required = false) String parentId, + @Parameter(description = "项目名称(模糊)") @RequestParam(required = false) String projectName, + @Parameter(description = "场景(模糊)") @RequestParam(required = false) String scenario, + @Parameter(description = "创建开始时间 yyyy-MM-dd HH:mm:ss") @RequestParam(required = false) String createStartTime, + @Parameter(description = "创建结束时间 yyyy-MM-dd HH:mm:ss") @RequestParam(required = false) String createEndTime, + @Parameter(description = "修改开始时间 yyyy-MM-dd HH:mm:ss") @RequestParam(required = false) String updateStartTime, + @Parameter(description = "修改结束时间 yyyy-MM-dd HH:mm:ss") @RequestParam(required = false) String updateEndTime) { + Map result = new HashMap<>(); + try { + Page page = new Page<>(current, size); + LambdaQueryWrapper qw = new LambdaQueryWrapper<>(); + if (parentId != null && !parentId.trim().isEmpty()) { + qw.eq(LoveCheckItemChild::getParentId, parentId); + } + if (projectName != null && !projectName.trim().isEmpty()) { + qw.like(LoveCheckItemChild::getProjectName, projectName); + } + if (scenario != null && !scenario.trim().isEmpty()) { + qw.like(LoveCheckItemChild::getScenario, scenario); + } + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + if (createStartTime != null && !createStartTime.trim().isEmpty()) { + try { + qw.ge(LoveCheckItemChild::getCreateTime, LocalDateTime.parse(createStartTime, formatter)); + } catch (Exception e) { + result.put("success", false); + result.put("message", "创建开始时间格式错误,请使用:yyyy-MM-dd HH:mm:ss"); + return ResponseEntity.badRequest().body(result); + } + } + if (createEndTime != null && !createEndTime.trim().isEmpty()) { + try { + qw.le(LoveCheckItemChild::getCreateTime, LocalDateTime.parse(createEndTime, formatter)); + } catch (Exception e) { + result.put("success", false); + result.put("message", "创建结束时间格式错误,请使用:yyyy-MM-dd HH:mm:ss"); + return ResponseEntity.badRequest().body(result); + } + } + if (updateStartTime != null && !updateStartTime.trim().isEmpty()) { + try { + qw.ge(LoveCheckItemChild::getUpdateTime, LocalDateTime.parse(updateStartTime, formatter)); + } catch (Exception e) { + result.put("success", false); + result.put("message", "修改开始时间格式错误,请使用:yyyy-MM-dd HH:mm:ss"); + return ResponseEntity.badRequest().body(result); + } + } + if (updateEndTime != null && !updateEndTime.trim().isEmpty()) { + try { + qw.le(LoveCheckItemChild::getUpdateTime, LocalDateTime.parse(updateEndTime, formatter)); + } catch (Exception e) { + result.put("success", false); + result.put("message", "修改结束时间格式错误,请使用:yyyy-MM-dd HH:mm:ss"); + return ResponseEntity.badRequest().body(result); + } + } + qw.orderByDesc(LoveCheckItemChild::getUpdateTime); + Page p = loveCheckItemChildService.page(page, qw); + result.put("success", true); + result.put("message", "查询成功"); + result.put("data", p.getRecords()); + result.put("total", p.getTotal()); + result.put("current", p.getCurrent()); + result.put("size", p.getSize()); + result.put("pages", p.getPages()); + return ResponseEntity.ok(result); + } catch (Exception e) { + result.put("success", false); + result.put("message", "查询异常:" + e.getMessage()); + return ResponseEntity.internalServerError().body(result); + } + } + + @PutMapping("/update") + @Operation(summary = "更新", description = "按主键 id 更新;修改时间由服务端刷新") + public ResponseEntity> update( + @Parameter(description = "实体 JSON(须含 id)", required = true) + @RequestBody LoveCheckItemChild body) { + Map result = new HashMap<>(); + try { + if (body.getId() == null || body.getId().trim().isEmpty()) { + result.put("success", false); + result.put("message", "id 不能为空"); + return ResponseEntity.badRequest().body(result); + } + body.setUpdateTime(LocalDateTime.now()); + boolean success = loveCheckItemChildService.updateById(body); + if (success) { + result.put("success", true); + result.put("message", "更新成功"); + result.put("data", body); + return ResponseEntity.ok(result); + } + result.put("success", false); + result.put("message", "更新失败"); + return ResponseEntity.badRequest().body(result); + } catch (Exception e) { + result.put("success", false); + result.put("message", "更新异常:" + e.getMessage()); + return ResponseEntity.internalServerError().body(result); + } + } + + @DeleteMapping("/delete/{id}") + @Operation(summary = "删除", description = "按主键删除") + public ResponseEntity> delete( + @Parameter(description = "主键 UUID", required = true) @PathVariable String id) { + Map result = new HashMap<>(); + try { + boolean success = loveCheckItemChildService.removeById(id); + if (success) { + result.put("success", true); + result.put("message", "删除成功"); + return ResponseEntity.ok(result); + } + result.put("success", false); + result.put("message", "删除失败"); + return ResponseEntity.badRequest().body(result); + } catch (Exception e) { + result.put("success", false); + result.put("message", "删除异常:" + e.getMessage()); + return ResponseEntity.internalServerError().body(result); + } + } + + @DeleteMapping("/batchDelete") + @Operation(summary = "批量删除", description = "请求体为 id 字符串列表") + public ResponseEntity> batchDelete( + @Parameter(description = "主键 UUID 列表", required = true) @RequestBody List ids) { + Map result = new HashMap<>(); + try { + if (ids == null || ids.isEmpty()) { + result.put("success", false); + result.put("message", "id 列表不能为空"); + return ResponseEntity.badRequest().body(result); + } + boolean success = loveCheckItemChildService.removeByIds(ids); + if (success) { + result.put("success", true); + result.put("message", "批量删除成功,共 " + ids.size() + " 条"); + return ResponseEntity.ok(result); + } + result.put("success", false); + result.put("message", "批量删除失败"); + return ResponseEntity.badRequest().body(result); + } catch (Exception e) { + result.put("success", false); + result.put("message", "批量删除异常:" + e.getMessage()); + return ResponseEntity.internalServerError().body(result); + } + } +} diff --git a/src/main/java/com/rj/controller/LoveCheckItemController.java b/src/main/java/com/rj/controller/LoveCheckItemController.java new file mode 100644 index 0000000..7c9d0ed --- /dev/null +++ b/src/main/java/com/rj/controller/LoveCheckItemController.java @@ -0,0 +1,249 @@ +package com.rj.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.rj.entity.LoveCheckItem; +import com.rj.service.ILoveCheckItemService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/** + * 恋爱/择偶检查项表 前端控制器(love_check_item) + * + * @author system + * @since 2026-04-06 + */ +@RestController +@RequestMapping("/api/loveCheckItem") +@Tag(name = "恋爱检查项", description = "love_check_item 表 CRUD") +public class LoveCheckItemController { + + @Autowired + private ILoveCheckItemService loveCheckItemService; + + @PostMapping("/add") + @Operation(summary = "新增", description = "新增一条检查项记录") + public ResponseEntity> add( + @Parameter(description = "实体 JSON", required = true) + @RequestBody LoveCheckItem body) { + Map result = new HashMap<>(); + try { + if (body.getId() == null || body.getId().trim().isEmpty()) { + body.setId(UUID.randomUUID().toString()); + } + LocalDateTime now = LocalDateTime.now(); + body.setCreateTime(now); + body.setUpdateTime(now); + boolean success = loveCheckItemService.save(body); + if (success) { + result.put("success", true); + result.put("message", "添加成功"); + result.put("data", body); + return ResponseEntity.ok(result); + } + result.put("success", false); + result.put("message", "添加失败"); + return ResponseEntity.badRequest().body(result); + } catch (Exception e) { + result.put("success", false); + result.put("message", "添加异常:" + e.getMessage()); + return ResponseEntity.internalServerError().body(result); + } + } + + @GetMapping("/get/{id}") + @Operation(summary = "按主键查询", description = "根据 id(UUID)查询") + public ResponseEntity> getById( + @Parameter(description = "主键 UUID", required = true) @PathVariable String id) { + Map result = new HashMap<>(); + try { + LoveCheckItem row = loveCheckItemService.getById(id); + if (row != null) { + result.put("success", true); + result.put("message", "查询成功"); + result.put("data", row); + return ResponseEntity.ok(result); + } + result.put("success", false); + result.put("message", "记录不存在"); + return ResponseEntity.notFound().build(); + } catch (Exception e) { + result.put("success", false); + result.put("message", "查询异常:" + e.getMessage()); + return ResponseEntity.internalServerError().body(result); + } + } + + @GetMapping("/list") + @Operation(summary = "分页列表", description = "支持 parentId、项目名称、类型、危害星级及时间范围等条件") + public ResponseEntity> list( + @Parameter(description = "页码") @RequestParam(defaultValue = "1") Integer current, + @Parameter(description = "每页条数") @RequestParam(defaultValue = "10") Integer size, + @Parameter(description = "父级ID(精确,空串表示不过滤)") @RequestParam(required = false) String parentId, + @Parameter(description = "项目名称(模糊)") @RequestParam(required = false) String projectName, + @Parameter(description = "类型(模糊)") @RequestParam(required = false) String type, + @Parameter(description = "危害星级(精确,1-5)") @RequestParam(required = false) Integer hazardStars, + @Parameter(description = "创建开始时间 yyyy-MM-dd HH:mm:ss") @RequestParam(required = false) String createStartTime, + @Parameter(description = "创建结束时间 yyyy-MM-dd HH:mm:ss") @RequestParam(required = false) String createEndTime, + @Parameter(description = "修改开始时间 yyyy-MM-dd HH:mm:ss") @RequestParam(required = false) String updateStartTime, + @Parameter(description = "修改结束时间 yyyy-MM-dd HH:mm:ss") @RequestParam(required = false) String updateEndTime) { + Map result = new HashMap<>(); + try { + Page page = new Page<>(current, size); + LambdaQueryWrapper qw = new LambdaQueryWrapper<>(); + if (parentId != null && !parentId.trim().isEmpty()) { + qw.eq(LoveCheckItem::getParentId, parentId); + } + if (projectName != null && !projectName.trim().isEmpty()) { + qw.like(LoveCheckItem::getProjectName, projectName); + } + if (type != null && !type.trim().isEmpty()) { + qw.like(LoveCheckItem::getType, type); + } + if (hazardStars != null) { + qw.eq(LoveCheckItem::getHazardStars, hazardStars); + } + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + if (createStartTime != null && !createStartTime.trim().isEmpty()) { + try { + qw.ge(LoveCheckItem::getCreateTime, LocalDateTime.parse(createStartTime, formatter)); + } catch (Exception e) { + result.put("success", false); + result.put("message", "创建开始时间格式错误,请使用:yyyy-MM-dd HH:mm:ss"); + return ResponseEntity.badRequest().body(result); + } + } + if (createEndTime != null && !createEndTime.trim().isEmpty()) { + try { + qw.le(LoveCheckItem::getCreateTime, LocalDateTime.parse(createEndTime, formatter)); + } catch (Exception e) { + result.put("success", false); + result.put("message", "创建结束时间格式错误,请使用:yyyy-MM-dd HH:mm:ss"); + return ResponseEntity.badRequest().body(result); + } + } + if (updateStartTime != null && !updateStartTime.trim().isEmpty()) { + try { + qw.ge(LoveCheckItem::getUpdateTime, LocalDateTime.parse(updateStartTime, formatter)); + } catch (Exception e) { + result.put("success", false); + result.put("message", "修改开始时间格式错误,请使用:yyyy-MM-dd HH:mm:ss"); + return ResponseEntity.badRequest().body(result); + } + } + if (updateEndTime != null && !updateEndTime.trim().isEmpty()) { + try { + qw.le(LoveCheckItem::getUpdateTime, LocalDateTime.parse(updateEndTime, formatter)); + } catch (Exception e) { + result.put("success", false); + result.put("message", "修改结束时间格式错误,请使用:yyyy-MM-dd HH:mm:ss"); + return ResponseEntity.badRequest().body(result); + } + } + qw.orderByDesc(LoveCheckItem::getUpdateTime); + Page p = loveCheckItemService.page(page, qw); + result.put("success", true); + result.put("message", "查询成功"); + result.put("data", p.getRecords()); + result.put("total", p.getTotal()); + result.put("current", p.getCurrent()); + result.put("size", p.getSize()); + result.put("pages", p.getPages()); + return ResponseEntity.ok(result); + } catch (Exception e) { + result.put("success", false); + result.put("message", "查询异常:" + e.getMessage()); + return ResponseEntity.internalServerError().body(result); + } + } + + @PutMapping("/update") + @Operation(summary = "更新", description = "按主键 id 更新;修改时间由服务端刷新") + public ResponseEntity> update( + @Parameter(description = "实体 JSON(须含 id)", required = true) + @RequestBody LoveCheckItem body) { + Map result = new HashMap<>(); + try { + if (body.getId() == null || body.getId().trim().isEmpty()) { + result.put("success", false); + result.put("message", "id 不能为空"); + return ResponseEntity.badRequest().body(result); + } + body.setUpdateTime(LocalDateTime.now()); + boolean success = loveCheckItemService.updateById(body); + if (success) { + result.put("success", true); + result.put("message", "更新成功"); + result.put("data", body); + return ResponseEntity.ok(result); + } + result.put("success", false); + result.put("message", "更新失败"); + return ResponseEntity.badRequest().body(result); + } catch (Exception e) { + result.put("success", false); + result.put("message", "更新异常:" + e.getMessage()); + return ResponseEntity.internalServerError().body(result); + } + } + + @DeleteMapping("/delete/{id}") + @Operation(summary = "删除", description = "按主键删除") + public ResponseEntity> delete( + @Parameter(description = "主键 UUID", required = true) @PathVariable String id) { + Map result = new HashMap<>(); + try { + boolean success = loveCheckItemService.removeById(id); + if (success) { + result.put("success", true); + result.put("message", "删除成功"); + return ResponseEntity.ok(result); + } + result.put("success", false); + result.put("message", "删除失败"); + return ResponseEntity.badRequest().body(result); + } catch (Exception e) { + result.put("success", false); + result.put("message", "删除异常:" + e.getMessage()); + return ResponseEntity.internalServerError().body(result); + } + } + + @DeleteMapping("/batchDelete") + @Operation(summary = "批量删除", description = "请求体为 id 字符串列表") + public ResponseEntity> batchDelete( + @Parameter(description = "主键 UUID 列表", required = true) @RequestBody List ids) { + Map result = new HashMap<>(); + try { + if (ids == null || ids.isEmpty()) { + result.put("success", false); + result.put("message", "id 列表不能为空"); + return ResponseEntity.badRequest().body(result); + } + boolean success = loveCheckItemService.removeByIds(ids); + if (success) { + result.put("success", true); + result.put("message", "批量删除成功,共 " + ids.size() + " 条"); + return ResponseEntity.ok(result); + } + result.put("success", false); + result.put("message", "批量删除失败"); + return ResponseEntity.badRequest().body(result); + } catch (Exception e) { + result.put("success", false); + result.put("message", "批量删除异常:" + e.getMessage()); + return ResponseEntity.internalServerError().body(result); + } + } +} diff --git a/src/main/java/com/rj/entity/LoveCheckItem.java b/src/main/java/com/rj/entity/LoveCheckItem.java new file mode 100644 index 0000000..63fda05 --- /dev/null +++ b/src/main/java/com/rj/entity/LoveCheckItem.java @@ -0,0 +1,62 @@ +package com.rj.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 恋爱/择偶检查项表(love_check_item) + * + * @author system + * @since 2026-04-06 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("love_check_item") +@Schema(description = "恋爱/择偶检查项") +public class LoveCheckItem implements Serializable { + + private static final long serialVersionUID = 1L; + + @Schema(description = "主键,UUID") + @TableId("id") + private String id; + + @Schema(description = "父级ID,UUID,根节点为空") + @TableField("parent_id") + private String parentId; + + @Schema(description = "项目名称") + @TableField("project_name") + private String projectName; + + @Schema(description = "危害程度(星级,1-5,5星危害最大)") + @TableField("hazard_stars") + private Integer hazardStars; + + @Schema(description = "类型") + @TableField("type") + private String type; + + @Schema(description = "简述") + @TableField("brief") + private String brief; + + @Schema(description = "备注") + @TableField("remark") + private String remark; + + @Schema(description = "创建时间") + @TableField("create_time") + private LocalDateTime createTime; + + @Schema(description = "修改时间") + @TableField("update_time") + private LocalDateTime updateTime; +} diff --git a/src/main/java/com/rj/entity/LoveCheckItemChild.java b/src/main/java/com/rj/entity/LoveCheckItemChild.java new file mode 100644 index 0000000..4d88ee0 --- /dev/null +++ b/src/main/java/com/rj/entity/LoveCheckItemChild.java @@ -0,0 +1,70 @@ +package com.rj.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 恋爱/择偶检查项子表(love_check_item_child) + * + * @author system + * @since 2026-04-06 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("love_check_item_child") +@Schema(description = "恋爱/择偶检查项子表(场景话术等)") +public class LoveCheckItemChild implements Serializable { + + private static final long serialVersionUID = 1L; + + @Schema(description = "主键,UUID") + @TableId("id") + private String id; + + @Schema(description = "父级ID,UUID") + @TableField("parent_id") + private String parentId; + + @Schema(description = "项目名称") + @TableField("project_name") + private String projectName; + + @Schema(description = "场景") + @TableField("scenario") + private String scenario; + + @Schema(description = "话术") + @TableField("talk_script") + private String talkScript; + + @Schema(description = "引导故事") + @TableField("guide_story") + private String guideStory; + + @Schema(description = "加分标准") + @TableField("bonus_standard") + private String bonusStandard; + + @Schema(description = "减分标准") + @TableField("deduction_standard") + private String deductionStandard; + + @Schema(description = "备注") + @TableField("remark") + private String remark; + + @Schema(description = "创建时间") + @TableField("create_time") + private LocalDateTime createTime; + + @Schema(description = "修改时间") + @TableField("update_time") + private LocalDateTime updateTime; +} diff --git a/src/main/java/com/rj/entity/LoveWhoI.java b/src/main/java/com/rj/entity/LoveWhoI.java index 667554d..26396f1 100644 --- a/src/main/java/com/rj/entity/LoveWhoI.java +++ b/src/main/java/com/rj/entity/LoveWhoI.java @@ -45,7 +45,7 @@ public class LoveWhoI implements Serializable { @TableField("salutation") private String salutation; - @Schema(description = "性别") + @Schema(description = "性别: 下拉框,男或 女") @TableField("gender") private String gender; diff --git a/src/main/java/com/rj/mapper/LoveCheckItemChildMapper.java b/src/main/java/com/rj/mapper/LoveCheckItemChildMapper.java new file mode 100644 index 0000000..e648ecd --- /dev/null +++ b/src/main/java/com/rj/mapper/LoveCheckItemChildMapper.java @@ -0,0 +1,14 @@ +package com.rj.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.rj.entity.LoveCheckItemChild; + +/** + * 恋爱/择偶检查项子表 Mapper + * + * @author system + * @since 2026-04-06 + */ +public interface LoveCheckItemChildMapper extends BaseMapper { + +} diff --git a/src/main/java/com/rj/mapper/LoveCheckItemMapper.java b/src/main/java/com/rj/mapper/LoveCheckItemMapper.java new file mode 100644 index 0000000..943c810 --- /dev/null +++ b/src/main/java/com/rj/mapper/LoveCheckItemMapper.java @@ -0,0 +1,14 @@ +package com.rj.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.rj.entity.LoveCheckItem; + +/** + * 恋爱/择偶检查项表 Mapper + * + * @author system + * @since 2026-04-06 + */ +public interface LoveCheckItemMapper extends BaseMapper { + +} diff --git a/src/main/java/com/rj/service/ILoveCheckItemChildService.java b/src/main/java/com/rj/service/ILoveCheckItemChildService.java new file mode 100644 index 0000000..9b374b7 --- /dev/null +++ b/src/main/java/com/rj/service/ILoveCheckItemChildService.java @@ -0,0 +1,14 @@ +package com.rj.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.rj.entity.LoveCheckItemChild; + +/** + * 恋爱/择偶检查项子表 服务类 + * + * @author system + * @since 2026-04-06 + */ +public interface ILoveCheckItemChildService extends IService { + +} diff --git a/src/main/java/com/rj/service/ILoveCheckItemService.java b/src/main/java/com/rj/service/ILoveCheckItemService.java new file mode 100644 index 0000000..86f0947 --- /dev/null +++ b/src/main/java/com/rj/service/ILoveCheckItemService.java @@ -0,0 +1,14 @@ +package com.rj.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.rj.entity.LoveCheckItem; + +/** + * 恋爱/择偶检查项表 服务类 + * + * @author system + * @since 2026-04-06 + */ +public interface ILoveCheckItemService extends IService { + +} diff --git a/src/main/java/com/rj/service/impl/LoveCheckItemChildServiceImpl.java b/src/main/java/com/rj/service/impl/LoveCheckItemChildServiceImpl.java new file mode 100644 index 0000000..588ddcd --- /dev/null +++ b/src/main/java/com/rj/service/impl/LoveCheckItemChildServiceImpl.java @@ -0,0 +1,19 @@ +package com.rj.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.rj.entity.LoveCheckItemChild; +import com.rj.mapper.LoveCheckItemChildMapper; +import com.rj.service.ILoveCheckItemChildService; +import org.springframework.stereotype.Service; + +/** + * 恋爱/择偶检查项子表 服务实现 + * + * @author system + * @since 2026-04-06 + */ +@Service +public class LoveCheckItemChildServiceImpl extends ServiceImpl + implements ILoveCheckItemChildService { + +} diff --git a/src/main/java/com/rj/service/impl/LoveCheckItemServiceImpl.java b/src/main/java/com/rj/service/impl/LoveCheckItemServiceImpl.java new file mode 100644 index 0000000..9502eaf --- /dev/null +++ b/src/main/java/com/rj/service/impl/LoveCheckItemServiceImpl.java @@ -0,0 +1,19 @@ +package com.rj.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.rj.entity.LoveCheckItem; +import com.rj.mapper.LoveCheckItemMapper; +import com.rj.service.ILoveCheckItemService; +import org.springframework.stereotype.Service; + +/** + * 恋爱/择偶检查项表 服务实现 + * + * @author system + * @since 2026-04-06 + */ +@Service +public class LoveCheckItemServiceImpl extends ServiceImpl + implements ILoveCheckItemService { + +} diff --git a/src/main/resources/mapper/LoveCheckItemChildMapper.xml b/src/main/resources/mapper/LoveCheckItemChildMapper.xml new file mode 100644 index 0000000..5b1b968 --- /dev/null +++ b/src/main/resources/mapper/LoveCheckItemChildMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + id, parent_id, project_name, scenario, talk_script, guide_story, bonus_standard, deduction_standard, + remark, create_time, update_time + + + diff --git a/src/main/resources/mapper/LoveCheckItemMapper.xml b/src/main/resources/mapper/LoveCheckItemMapper.xml new file mode 100644 index 0000000..43f86e2 --- /dev/null +++ b/src/main/resources/mapper/LoveCheckItemMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + id, parent_id, project_name, hazard_stars, type, brief, remark, create_time, update_time + + + diff --git a/src/main/sql/love_check_item.sql b/src/main/sql/love_check_item.sql new file mode 100644 index 0000000..6732a92 --- /dev/null +++ b/src/main/sql/love_check_item.sql @@ -0,0 +1,19 @@ +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +DROP TABLE IF EXISTS `love_check_item`; +CREATE TABLE `love_check_item` ( + `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键,UUID', + `parent_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '父级ID,UUID,根节点为空', + `project_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '项目名称', + `hazard_stars` tinyint unsigned NULL DEFAULT NULL COMMENT '危害程度(星级,1-5,5星危害最大)', + `type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '类型', + `brief` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '简述', + `remark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '备注', + `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_parent_id` (`parent_id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='恋爱/择偶检查项表' ROW_FORMAT=DYNAMIC; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/src/main/sql/love_check_item_child.sql b/src/main/sql/love_check_item_child.sql new file mode 100644 index 0000000..2f84b3c --- /dev/null +++ b/src/main/sql/love_check_item_child.sql @@ -0,0 +1,21 @@ +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +DROP TABLE IF EXISTS `love_check_item_child`; +CREATE TABLE `love_check_item_child` ( + `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键,UUID', + `parent_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '父级ID,UUID,关联 love_check_item 等', + `project_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '项目名称', + `scenario` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '场景', + `talk_script` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '话术', + `guide_story` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '引导故事', + `bonus_standard` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '加分标准', + `deduction_standard` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '减分标准', + `remark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '备注', + `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_parent_id` (`parent_id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='恋爱/择偶检查项子表(场景话术等)' ROW_FORMAT=DYNAMIC; + +SET FOREIGN_KEY_CHECKS = 1;