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 5bcacad410..8a4e701939 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,16 +1,12 @@ 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.NotNull; -import jakarta.validation.constraints.Size; -import lombok.Data; - +import jakarta.validation.constraints.*; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; +import lombok.Data; @Data public class FunctionalCaseModule implements Serializable { @@ -54,6 +50,10 @@ public class FunctionalCaseModule implements Serializable { @Schema(description = "更新人") private String updateUser; + @Schema(description = "是否在回收站:0-否,1-是", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "{functional_case_module.deleted.not_blank}", groups = {Created.class}) + private Boolean deleted; + private static final long serialVersionUID = 1L; public enum Column { @@ -66,7 +66,8 @@ public class FunctionalCaseModule implements Serializable { updateTime("update_time", "updateTime", "BIGINT", false), pos("pos", "pos", "BIGINT", false), createUser("create_user", "createUser", "VARCHAR", false), - updateUser("update_user", "updateUser", "VARCHAR", false); + updateUser("update_user", "updateUser", "VARCHAR", false), + deleted("deleted", "deleted", "BIT", 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 0e24bedc39..5a2acad6db 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 @@ -763,6 +763,66 @@ public class FunctionalCaseModuleExample { addCriterion("update_user not between", value1, value2, "updateUser"); return (Criteria) this; } + + public Criteria andDeletedIsNull() { + addCriterion("deleted is null"); + return (Criteria) this; + } + + public Criteria andDeletedIsNotNull() { + addCriterion("deleted is not null"); + return (Criteria) this; + } + + public Criteria andDeletedEqualTo(Boolean value) { + addCriterion("deleted =", value, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedNotEqualTo(Boolean value) { + addCriterion("deleted <>", value, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedGreaterThan(Boolean value) { + addCriterion("deleted >", value, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedGreaterThanOrEqualTo(Boolean value) { + addCriterion("deleted >=", value, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedLessThan(Boolean value) { + addCriterion("deleted <", value, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedLessThanOrEqualTo(Boolean value) { + addCriterion("deleted <=", value, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedIn(List values) { + addCriterion("deleted in", values, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedNotIn(List values) { + addCriterion("deleted not in", values, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedBetween(Boolean value1, Boolean value2) { + addCriterion("deleted between", value1, value2, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedNotBetween(Boolean value1, Boolean value2) { + addCriterion("deleted not between", value1, value2, "deleted"); + 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 725b16782f..fa23b3df4e 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 @@ -12,6 +12,7 @@ + @@ -73,7 +74,7 @@ id, project_id, `name`, parent_id, `level`, create_time, update_time, pos, create_user, - update_user + update_user, deleted @@ -221,6 +228,9 @@ update_user = #{record.updateUser,jdbcType=VARCHAR}, + + deleted = #{record.deleted,jdbcType=BIT}, + @@ -237,7 +247,8 @@ update_time = #{record.updateTime,jdbcType=BIGINT}, pos = #{record.pos,jdbcType=BIGINT}, create_user = #{record.createUser,jdbcType=VARCHAR}, - update_user = #{record.updateUser,jdbcType=VARCHAR} + update_user = #{record.updateUser,jdbcType=VARCHAR}, + deleted = #{record.deleted,jdbcType=BIT} @@ -272,6 +283,9 @@ update_user = #{updateUser,jdbcType=VARCHAR}, + + deleted = #{deleted,jdbcType=BIT}, + where id = #{id,jdbcType=VARCHAR} @@ -285,19 +299,20 @@ update_time = #{updateTime,jdbcType=BIGINT}, pos = #{pos,jdbcType=BIGINT}, create_user = #{createUser,jdbcType=VARCHAR}, - update_user = #{updateUser,jdbcType=VARCHAR} + update_user = #{updateUser,jdbcType=VARCHAR}, + deleted = #{deleted,jdbcType=BIT} where id = #{id,jdbcType=VARCHAR} insert into functional_case_module (id, project_id, `name`, parent_id, `level`, create_time, update_time, pos, create_user, - update_user) + update_user, deleted) 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.updateUser,jdbcType=VARCHAR}) + #{item.updateUser,jdbcType=VARCHAR}, #{item.deleted,jdbcType=BIT}) @@ -340,6 +355,9 @@ #{item.updateUser,jdbcType=VARCHAR} + + #{item.deleted,jdbcType=BIT} + ) diff --git a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_10__functional_case.sql b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_10__functional_case.sql index 57fd57996f..39ce8ccb51 100644 --- a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_10__functional_case.sql +++ b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_10__functional_case.sql @@ -83,20 +83,28 @@ CREATE TABLE IF NOT EXISTS functional_case_module( `id` VARCHAR(50) NOT NULL COMMENT 'ID' , `project_id` VARCHAR(50) NOT NULL COMMENT '项目ID' , `name` VARCHAR(100) NOT NULL COMMENT '名称' , - `parent_id` VARCHAR(50) NOT NULL COMMENT '父节点ID' , + `parent_id` VARCHAR(50) NOT NULL DEFAULT 'NONE' COMMENT '父节点ID' , `level` INT NOT NULL DEFAULT 1 COMMENT '节点的层级' , `create_time` BIGINT NOT NULL COMMENT '创建时间' , `update_time` BIGINT NOT NULL COMMENT '更新时间' , - `pos` BIGINT(10) NOT NULL DEFAULT 0 COMMENT '同一节点下的顺序' , + `pos` BIGINT NOT NULL DEFAULT 0 COMMENT '同一节点下的顺序' , `create_user` VARCHAR(50) NOT NULL COMMENT '创建人' , + `update_user` VARCHAR(50) NOT NULL COMMENT '更新人' , + `deleted` BIT NOT NULL DEFAULT 0 COMMENT '是否在回收站:0-否,1-是' , PRIMARY KEY (id) - ) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci COMMENT = '功能用例模块'; + ) COMMENT = '功能用例模块'; CREATE INDEX idx_project_id ON functional_case_module(project_id); CREATE INDEX idx_name ON functional_case_module(name); +CREATE INDEX idx_pos ON functional_case_module(pos); +CREATE INDEX idx_parent_id ON functional_case_module(parent_id); +CREATE INDEX idx_level ON functional_case_module(level); +CREATE INDEX idx_create_user ON functional_case_module(create_user); +CREATE INDEX idx_update_user ON functional_case_module(update_user); +CREATE INDEX idx_create_time ON functional_case_module(create_time); +CREATE INDEX idx_update_time ON functional_case_module(update_time); +CREATE INDEX idx_delete ON functional_case_module(deleted); CREATE TABLE IF NOT EXISTS functional_case_attachment(