From ec7645bf979ec142ab92d571ae99f9c2d5964dff Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Tue, 31 Oct 2023 09:46:40 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B):?= =?UTF-8?q?=20=E8=B0=83=E6=95=B4=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E8=A1=A8=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/FunctionalCaseModule.java | 40 ++++----- .../domain/FunctionalCaseModuleExample.java | 90 ++++++++++++++++--- .../mapper/FunctionalCaseModuleMapper.xml | 55 ++++++++---- 3 files changed, 137 insertions(+), 48 deletions(-) diff --git a/backend/framework/domain/src/main/java/io/metersphere/functional/domain/FunctionalCaseModule.java b/backend/framework/domain/src/main/java/io/metersphere/functional/domain/FunctionalCaseModule.java index 0690c333c6..45929e6767 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/functional/domain/FunctionalCaseModule.java +++ b/backend/framework/domain/src/main/java/io/metersphere/functional/domain/FunctionalCaseModule.java @@ -1,10 +1,8 @@ package io.metersphere.functional.domain; -import io.metersphere.validation.groups.Created; -import io.metersphere.validation.groups.Updated; +import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.Size; +import jakarta.validation.constraints.*; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; @@ -12,45 +10,46 @@ import lombok.Data; @Data public class FunctionalCaseModule implements Serializable { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{functional_case_module.id.not_blank}", groups = {Updated.class}) @Size(min = 1, max = 50, message = "{functional_case_module.id.length_range}", groups = {Created.class, Updated.class}) private String id; - @Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{functional_case_module.project_id.not_blank}", groups = {Created.class}) @Size(min = 1, max = 50, message = "{functional_case_module.project_id.length_range}", groups = {Created.class, Updated.class}) private String projectId; - @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{functional_case_module.name.not_blank}", groups = {Created.class}) @Size(min = 1, max = 100, message = "{functional_case_module.name.length_range}", groups = {Created.class, Updated.class}) private String name; - @Schema(description = "父节点ID", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "父节点ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{functional_case_module.parent_id.not_blank}", groups = {Created.class}) @Size(min = 1, max = 50, message = "{functional_case_module.parent_id.length_range}", groups = {Created.class, Updated.class}) private String parentId; - @Schema(description = "节点的层级", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{functional_case_module.level.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 10, message = "{functional_case_module.level.length_range}", groups = {Created.class, Updated.class}) + @Schema(description = "节点的层级", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "{functional_case_module.level.not_blank}", groups = {Created.class}) private Integer level; - @Schema(description = "创建时间") + @Schema(description = "创建时间") private Long createTime; - @Schema(description = "更新时间") + @Schema(description = "更新时间") private Long updateTime; - @Schema(description = "同一节点下的顺序", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{functional_case_module.pos.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 19, message = "{functional_case_module.pos.length_range}", groups = {Created.class, Updated.class}) - private Long pos; + @Schema(description = "同一节点下的顺序", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "{functional_case_module.pos.not_blank}", groups = {Created.class}) + private Integer pos; - @Schema(description = "创建人") + @Schema(description = "创建人") private String createUser; + @Schema(description = "更新人") + private String updateUser; + private static final long serialVersionUID = 1L; public enum Column { @@ -61,8 +60,9 @@ public class FunctionalCaseModule implements Serializable { level("level", "level", "INTEGER", true), createTime("create_time", "createTime", "BIGINT", false), updateTime("update_time", "updateTime", "BIGINT", false), - pos("pos", "pos", "BIGINT", false), - createUser("create_user", "createUser", "VARCHAR", false); + pos("pos", "pos", "INTEGER", false), + createUser("create_user", "createUser", "VARCHAR", false), + updateUser("update_user", "updateUser", "VARCHAR", false); private static final String BEGINNING_DELIMITER = "`"; diff --git a/backend/framework/domain/src/main/java/io/metersphere/functional/domain/FunctionalCaseModuleExample.java b/backend/framework/domain/src/main/java/io/metersphere/functional/domain/FunctionalCaseModuleExample.java index 45e6aa50a5..221e238e78 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/functional/domain/FunctionalCaseModuleExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/functional/domain/FunctionalCaseModuleExample.java @@ -574,52 +574,52 @@ public class FunctionalCaseModuleExample { return (Criteria) this; } - public Criteria andPosEqualTo(Long value) { + public Criteria andPosEqualTo(Integer value) { addCriterion("pos =", value, "pos"); return (Criteria) this; } - public Criteria andPosNotEqualTo(Long value) { + public Criteria andPosNotEqualTo(Integer value) { addCriterion("pos <>", value, "pos"); return (Criteria) this; } - public Criteria andPosGreaterThan(Long value) { + public Criteria andPosGreaterThan(Integer value) { addCriterion("pos >", value, "pos"); return (Criteria) this; } - public Criteria andPosGreaterThanOrEqualTo(Long value) { + public Criteria andPosGreaterThanOrEqualTo(Integer value) { addCriterion("pos >=", value, "pos"); return (Criteria) this; } - public Criteria andPosLessThan(Long value) { + public Criteria andPosLessThan(Integer value) { addCriterion("pos <", value, "pos"); return (Criteria) this; } - public Criteria andPosLessThanOrEqualTo(Long value) { + public Criteria andPosLessThanOrEqualTo(Integer value) { addCriterion("pos <=", value, "pos"); return (Criteria) this; } - public Criteria andPosIn(List values) { + public Criteria andPosIn(List values) { addCriterion("pos in", values, "pos"); return (Criteria) this; } - public Criteria andPosNotIn(List values) { + public Criteria andPosNotIn(List values) { addCriterion("pos not in", values, "pos"); return (Criteria) this; } - public Criteria andPosBetween(Long value1, Long value2) { + public Criteria andPosBetween(Integer value1, Integer value2) { addCriterion("pos between", value1, value2, "pos"); return (Criteria) this; } - public Criteria andPosNotBetween(Long value1, Long value2) { + public Criteria andPosNotBetween(Integer value1, Integer value2) { addCriterion("pos not between", value1, value2, "pos"); return (Criteria) this; } @@ -693,6 +693,76 @@ public class FunctionalCaseModuleExample { addCriterion("create_user not between", value1, value2, "createUser"); return (Criteria) this; } + + public Criteria andUpdateUserIsNull() { + addCriterion("update_user is null"); + return (Criteria) this; + } + + public Criteria andUpdateUserIsNotNull() { + addCriterion("update_user is not null"); + return (Criteria) this; + } + + public Criteria andUpdateUserEqualTo(String value) { + addCriterion("update_user =", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserNotEqualTo(String value) { + addCriterion("update_user <>", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserGreaterThan(String value) { + addCriterion("update_user >", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserGreaterThanOrEqualTo(String value) { + addCriterion("update_user >=", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserLessThan(String value) { + addCriterion("update_user <", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserLessThanOrEqualTo(String value) { + addCriterion("update_user <=", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserLike(String value) { + addCriterion("update_user like", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserNotLike(String value) { + addCriterion("update_user not like", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserIn(List values) { + addCriterion("update_user in", values, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserNotIn(List values) { + addCriterion("update_user not in", values, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserBetween(String value1, String value2) { + addCriterion("update_user between", value1, value2, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserNotBetween(String value1, String value2) { + addCriterion("update_user not between", value1, value2, "updateUser"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/framework/domain/src/main/java/io/metersphere/functional/mapper/FunctionalCaseModuleMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/functional/mapper/FunctionalCaseModuleMapper.xml index acef65444e..60a20aa94a 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/functional/mapper/FunctionalCaseModuleMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/functional/mapper/FunctionalCaseModuleMapper.xml @@ -9,8 +9,9 @@ - + + @@ -71,7 +72,8 @@ - id, project_id, `name`, parent_id, `level`, create_time, update_time, pos, create_user + id, project_id, `name`, parent_id, `level`, create_time, update_time, pos, create_user, + update_user @@ -205,11 +213,14 @@ update_time = #{record.updateTime,jdbcType=BIGINT}, - pos = #{record.pos,jdbcType=BIGINT}, + pos = #{record.pos,jdbcType=INTEGER}, create_user = #{record.createUser,jdbcType=VARCHAR}, + + update_user = #{record.updateUser,jdbcType=VARCHAR}, + @@ -224,8 +235,9 @@ `level` = #{record.level,jdbcType=INTEGER}, create_time = #{record.createTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT}, - pos = #{record.pos,jdbcType=BIGINT}, - create_user = #{record.createUser,jdbcType=VARCHAR} + pos = #{record.pos,jdbcType=INTEGER}, + create_user = #{record.createUser,jdbcType=VARCHAR}, + update_user = #{record.updateUser,jdbcType=VARCHAR} @@ -252,11 +264,14 @@ update_time = #{updateTime,jdbcType=BIGINT}, - pos = #{pos,jdbcType=BIGINT}, + pos = #{pos,jdbcType=INTEGER}, create_user = #{createUser,jdbcType=VARCHAR}, + + update_user = #{updateUser,jdbcType=VARCHAR}, + where id = #{id,jdbcType=VARCHAR} @@ -268,20 +283,21 @@ `level` = #{level,jdbcType=INTEGER}, create_time = #{createTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT}, - pos = #{pos,jdbcType=BIGINT}, - create_user = #{createUser,jdbcType=VARCHAR} + pos = #{pos,jdbcType=INTEGER}, + create_user = #{createUser,jdbcType=VARCHAR}, + update_user = #{updateUser,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} insert into functional_case_module - (id, project_id, `name`, parent_id, `level`, create_time, update_time, pos, create_user - ) + (id, project_id, `name`, parent_id, `level`, create_time, update_time, pos, create_user, + update_user) values (#{item.id,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.parentId,jdbcType=VARCHAR}, #{item.level,jdbcType=INTEGER}, #{item.createTime,jdbcType=BIGINT}, - #{item.updateTime,jdbcType=BIGINT}, #{item.pos,jdbcType=BIGINT}, #{item.createUser,jdbcType=VARCHAR} - ) + #{item.updateTime,jdbcType=BIGINT}, #{item.pos,jdbcType=INTEGER}, #{item.createUser,jdbcType=VARCHAR}, + #{item.updateUser,jdbcType=VARCHAR}) @@ -316,11 +332,14 @@ #{item.updateTime,jdbcType=BIGINT} - #{item.pos,jdbcType=BIGINT} + #{item.pos,jdbcType=INTEGER} #{item.createUser,jdbcType=VARCHAR} + + #{item.updateUser,jdbcType=VARCHAR} + )