diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanBug.java b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanBug.java deleted file mode 100644 index bfe2d713f2..0000000000 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanBug.java +++ /dev/null @@ -1,126 +0,0 @@ -package io.metersphere.plan.domain; - -import io.metersphere.validation.groups.*; -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.*; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Arrays; -import lombok.Data; - -@Data -public class TestPlanBug implements Serializable { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{test_plan_bug.id.not_blank}", groups = {Updated.class}) - @Size(min = 1, max = 50, message = "{test_plan_bug.id.length_range}", groups = {Created.class, Updated.class}) - private String id; - - @Schema(description = "num") - private Long num; - - @Schema(description = "测试计划ID;测试计划ID", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{test_plan_bug.test_plan_id.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 50, message = "{test_plan_bug.test_plan_id.length_range}", groups = {Created.class, Updated.class}) - private String testPlanId; - - @Schema(description = "接口用例ID;测试用例ID(包含功能、接口、场景等)", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{test_plan_bug.case_id.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 50, message = "{test_plan_bug.case_id.length_range}", groups = {Created.class, Updated.class}) - private String caseId; - - @Schema(description = "用例类型;用例类型(FUNCTIONAL_CASE/API_TEST_CASE/API_SCENARIO)", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{test_plan_bug.case_type.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 50, message = "{test_plan_bug.case_type.length_range}", groups = {Created.class, Updated.class}) - private String caseType; - - @Schema(description = "缺陷id;缺陷ID", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{test_plan_bug.bug_id.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 50, message = "{test_plan_bug.bug_id.length_range}", groups = {Created.class, Updated.class}) - private String bugId; - - @Schema(description = "创建时间") - private Long createTime; - - @Schema(description = "创建人") - private String createUser; - - private static final long serialVersionUID = 1L; - - public enum Column { - id("id", "id", "VARCHAR", false), - num("num", "num", "BIGINT", false), - testPlanId("test_plan_id", "testPlanId", "VARCHAR", false), - caseId("case_id", "caseId", "VARCHAR", false), - caseType("case_type", "caseType", "VARCHAR", false), - bugId("bug_id", "bugId", "VARCHAR", false), - createTime("create_time", "createTime", "BIGINT", false), - createUser("create_user", "createUser", "VARCHAR", false); - - private static final String BEGINNING_DELIMITER = "`"; - - private static final String ENDING_DELIMITER = "`"; - - private final String column; - - private final boolean isColumnNameDelimited; - - private final String javaProperty; - - private final String jdbcType; - - public String value() { - return this.column; - } - - public String getValue() { - return this.column; - } - - public String getJavaProperty() { - return this.javaProperty; - } - - public String getJdbcType() { - return this.jdbcType; - } - - Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { - this.column = column; - this.javaProperty = javaProperty; - this.jdbcType = jdbcType; - this.isColumnNameDelimited = isColumnNameDelimited; - } - - public String desc() { - return this.getEscapedColumnName() + " DESC"; - } - - public String asc() { - return this.getEscapedColumnName() + " ASC"; - } - - public static Column[] excludes(Column ... excludes) { - ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); - if (excludes != null && excludes.length > 0) { - columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); - } - return columns.toArray(new Column[]{}); - } - - public static Column[] all() { - return Column.values(); - } - - public String getEscapedColumnName() { - if (this.isColumnNameDelimited) { - return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); - } else { - return this.column; - } - } - - public String getAliasedEscapedColumnName() { - return this.getEscapedColumnName(); - } - } -} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanBugExample.java b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanBugExample.java deleted file mode 100644 index 3756491766..0000000000 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanBugExample.java +++ /dev/null @@ -1,740 +0,0 @@ -package io.metersphere.plan.domain; - -import java.util.ArrayList; -import java.util.List; - -public class TestPlanBugExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - public TestPlanBugExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(String value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(String value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(String value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(String value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(String value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(String value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLike(String value) { - addCriterion("id like", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotLike(String value) { - addCriterion("id not like", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(String value1, String value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(String value1, String value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andNumIsNull() { - addCriterion("num is null"); - return (Criteria) this; - } - - public Criteria andNumIsNotNull() { - addCriterion("num is not null"); - return (Criteria) this; - } - - public Criteria andNumEqualTo(Long value) { - addCriterion("num =", value, "num"); - return (Criteria) this; - } - - public Criteria andNumNotEqualTo(Long value) { - addCriterion("num <>", value, "num"); - return (Criteria) this; - } - - public Criteria andNumGreaterThan(Long value) { - addCriterion("num >", value, "num"); - return (Criteria) this; - } - - public Criteria andNumGreaterThanOrEqualTo(Long value) { - addCriterion("num >=", value, "num"); - return (Criteria) this; - } - - public Criteria andNumLessThan(Long value) { - addCriterion("num <", value, "num"); - return (Criteria) this; - } - - public Criteria andNumLessThanOrEqualTo(Long value) { - addCriterion("num <=", value, "num"); - return (Criteria) this; - } - - public Criteria andNumIn(List values) { - addCriterion("num in", values, "num"); - return (Criteria) this; - } - - public Criteria andNumNotIn(List values) { - addCriterion("num not in", values, "num"); - return (Criteria) this; - } - - public Criteria andNumBetween(Long value1, Long value2) { - addCriterion("num between", value1, value2, "num"); - return (Criteria) this; - } - - public Criteria andNumNotBetween(Long value1, Long value2) { - addCriterion("num not between", value1, value2, "num"); - return (Criteria) this; - } - - public Criteria andTestPlanIdIsNull() { - addCriterion("test_plan_id is null"); - return (Criteria) this; - } - - public Criteria andTestPlanIdIsNotNull() { - addCriterion("test_plan_id is not null"); - return (Criteria) this; - } - - public Criteria andTestPlanIdEqualTo(String value) { - addCriterion("test_plan_id =", value, "testPlanId"); - return (Criteria) this; - } - - public Criteria andTestPlanIdNotEqualTo(String value) { - addCriterion("test_plan_id <>", value, "testPlanId"); - return (Criteria) this; - } - - public Criteria andTestPlanIdGreaterThan(String value) { - addCriterion("test_plan_id >", value, "testPlanId"); - return (Criteria) this; - } - - public Criteria andTestPlanIdGreaterThanOrEqualTo(String value) { - addCriterion("test_plan_id >=", value, "testPlanId"); - return (Criteria) this; - } - - public Criteria andTestPlanIdLessThan(String value) { - addCriterion("test_plan_id <", value, "testPlanId"); - return (Criteria) this; - } - - public Criteria andTestPlanIdLessThanOrEqualTo(String value) { - addCriterion("test_plan_id <=", value, "testPlanId"); - return (Criteria) this; - } - - public Criteria andTestPlanIdLike(String value) { - addCriterion("test_plan_id like", value, "testPlanId"); - return (Criteria) this; - } - - public Criteria andTestPlanIdNotLike(String value) { - addCriterion("test_plan_id not like", value, "testPlanId"); - return (Criteria) this; - } - - public Criteria andTestPlanIdIn(List values) { - addCriterion("test_plan_id in", values, "testPlanId"); - return (Criteria) this; - } - - public Criteria andTestPlanIdNotIn(List values) { - addCriterion("test_plan_id not in", values, "testPlanId"); - return (Criteria) this; - } - - public Criteria andTestPlanIdBetween(String value1, String value2) { - addCriterion("test_plan_id between", value1, value2, "testPlanId"); - return (Criteria) this; - } - - public Criteria andTestPlanIdNotBetween(String value1, String value2) { - addCriterion("test_plan_id not between", value1, value2, "testPlanId"); - return (Criteria) this; - } - - public Criteria andCaseIdIsNull() { - addCriterion("case_id is null"); - return (Criteria) this; - } - - public Criteria andCaseIdIsNotNull() { - addCriterion("case_id is not null"); - return (Criteria) this; - } - - public Criteria andCaseIdEqualTo(String value) { - addCriterion("case_id =", value, "caseId"); - return (Criteria) this; - } - - public Criteria andCaseIdNotEqualTo(String value) { - addCriterion("case_id <>", value, "caseId"); - return (Criteria) this; - } - - public Criteria andCaseIdGreaterThan(String value) { - addCriterion("case_id >", value, "caseId"); - return (Criteria) this; - } - - public Criteria andCaseIdGreaterThanOrEqualTo(String value) { - addCriterion("case_id >=", value, "caseId"); - return (Criteria) this; - } - - public Criteria andCaseIdLessThan(String value) { - addCriterion("case_id <", value, "caseId"); - return (Criteria) this; - } - - public Criteria andCaseIdLessThanOrEqualTo(String value) { - addCriterion("case_id <=", value, "caseId"); - return (Criteria) this; - } - - public Criteria andCaseIdLike(String value) { - addCriterion("case_id like", value, "caseId"); - return (Criteria) this; - } - - public Criteria andCaseIdNotLike(String value) { - addCriterion("case_id not like", value, "caseId"); - return (Criteria) this; - } - - public Criteria andCaseIdIn(List values) { - addCriterion("case_id in", values, "caseId"); - return (Criteria) this; - } - - public Criteria andCaseIdNotIn(List values) { - addCriterion("case_id not in", values, "caseId"); - return (Criteria) this; - } - - public Criteria andCaseIdBetween(String value1, String value2) { - addCriterion("case_id between", value1, value2, "caseId"); - return (Criteria) this; - } - - public Criteria andCaseIdNotBetween(String value1, String value2) { - addCriterion("case_id not between", value1, value2, "caseId"); - return (Criteria) this; - } - - public Criteria andCaseTypeIsNull() { - addCriterion("case_type is null"); - return (Criteria) this; - } - - public Criteria andCaseTypeIsNotNull() { - addCriterion("case_type is not null"); - return (Criteria) this; - } - - public Criteria andCaseTypeEqualTo(String value) { - addCriterion("case_type =", value, "caseType"); - return (Criteria) this; - } - - public Criteria andCaseTypeNotEqualTo(String value) { - addCriterion("case_type <>", value, "caseType"); - return (Criteria) this; - } - - public Criteria andCaseTypeGreaterThan(String value) { - addCriterion("case_type >", value, "caseType"); - return (Criteria) this; - } - - public Criteria andCaseTypeGreaterThanOrEqualTo(String value) { - addCriterion("case_type >=", value, "caseType"); - return (Criteria) this; - } - - public Criteria andCaseTypeLessThan(String value) { - addCriterion("case_type <", value, "caseType"); - return (Criteria) this; - } - - public Criteria andCaseTypeLessThanOrEqualTo(String value) { - addCriterion("case_type <=", value, "caseType"); - return (Criteria) this; - } - - public Criteria andCaseTypeLike(String value) { - addCriterion("case_type like", value, "caseType"); - return (Criteria) this; - } - - public Criteria andCaseTypeNotLike(String value) { - addCriterion("case_type not like", value, "caseType"); - return (Criteria) this; - } - - public Criteria andCaseTypeIn(List values) { - addCriterion("case_type in", values, "caseType"); - return (Criteria) this; - } - - public Criteria andCaseTypeNotIn(List values) { - addCriterion("case_type not in", values, "caseType"); - return (Criteria) this; - } - - public Criteria andCaseTypeBetween(String value1, String value2) { - addCriterion("case_type between", value1, value2, "caseType"); - return (Criteria) this; - } - - public Criteria andCaseTypeNotBetween(String value1, String value2) { - addCriterion("case_type not between", value1, value2, "caseType"); - return (Criteria) this; - } - - public Criteria andBugIdIsNull() { - addCriterion("bug_id is null"); - return (Criteria) this; - } - - public Criteria andBugIdIsNotNull() { - addCriterion("bug_id is not null"); - return (Criteria) this; - } - - public Criteria andBugIdEqualTo(String value) { - addCriterion("bug_id =", value, "bugId"); - return (Criteria) this; - } - - public Criteria andBugIdNotEqualTo(String value) { - addCriterion("bug_id <>", value, "bugId"); - return (Criteria) this; - } - - public Criteria andBugIdGreaterThan(String value) { - addCriterion("bug_id >", value, "bugId"); - return (Criteria) this; - } - - public Criteria andBugIdGreaterThanOrEqualTo(String value) { - addCriterion("bug_id >=", value, "bugId"); - return (Criteria) this; - } - - public Criteria andBugIdLessThan(String value) { - addCriterion("bug_id <", value, "bugId"); - return (Criteria) this; - } - - public Criteria andBugIdLessThanOrEqualTo(String value) { - addCriterion("bug_id <=", value, "bugId"); - return (Criteria) this; - } - - public Criteria andBugIdLike(String value) { - addCriterion("bug_id like", value, "bugId"); - return (Criteria) this; - } - - public Criteria andBugIdNotLike(String value) { - addCriterion("bug_id not like", value, "bugId"); - return (Criteria) this; - } - - public Criteria andBugIdIn(List values) { - addCriterion("bug_id in", values, "bugId"); - return (Criteria) this; - } - - public Criteria andBugIdNotIn(List values) { - addCriterion("bug_id not in", values, "bugId"); - return (Criteria) this; - } - - public Criteria andBugIdBetween(String value1, String value2) { - addCriterion("bug_id between", value1, value2, "bugId"); - return (Criteria) this; - } - - public Criteria andBugIdNotBetween(String value1, String value2) { - addCriterion("bug_id not between", value1, value2, "bugId"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNull() { - addCriterion("create_time is null"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNotNull() { - addCriterion("create_time is not null"); - return (Criteria) this; - } - - public Criteria andCreateTimeEqualTo(Long value) { - addCriterion("create_time =", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotEqualTo(Long value) { - addCriterion("create_time <>", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThan(Long value) { - addCriterion("create_time >", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) { - addCriterion("create_time >=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThan(Long value) { - addCriterion("create_time <", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThanOrEqualTo(Long value) { - addCriterion("create_time <=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeIn(List values) { - addCriterion("create_time in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotIn(List values) { - addCriterion("create_time not in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeBetween(Long value1, Long value2) { - addCriterion("create_time between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotBetween(Long value1, Long value2) { - addCriterion("create_time not between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateUserIsNull() { - addCriterion("create_user is null"); - return (Criteria) this; - } - - public Criteria andCreateUserIsNotNull() { - addCriterion("create_user is not null"); - return (Criteria) this; - } - - public Criteria andCreateUserEqualTo(String value) { - addCriterion("create_user =", value, "createUser"); - return (Criteria) this; - } - - public Criteria andCreateUserNotEqualTo(String value) { - addCriterion("create_user <>", value, "createUser"); - return (Criteria) this; - } - - public Criteria andCreateUserGreaterThan(String value) { - addCriterion("create_user >", value, "createUser"); - return (Criteria) this; - } - - public Criteria andCreateUserGreaterThanOrEqualTo(String value) { - addCriterion("create_user >=", value, "createUser"); - return (Criteria) this; - } - - public Criteria andCreateUserLessThan(String value) { - addCriterion("create_user <", value, "createUser"); - return (Criteria) this; - } - - public Criteria andCreateUserLessThanOrEqualTo(String value) { - addCriterion("create_user <=", value, "createUser"); - return (Criteria) this; - } - - public Criteria andCreateUserLike(String value) { - addCriterion("create_user like", value, "createUser"); - return (Criteria) this; - } - - public Criteria andCreateUserNotLike(String value) { - addCriterion("create_user not like", value, "createUser"); - return (Criteria) this; - } - - public Criteria andCreateUserIn(List values) { - addCriterion("create_user in", values, "createUser"); - return (Criteria) this; - } - - public Criteria andCreateUserNotIn(List values) { - addCriterion("create_user not in", values, "createUser"); - return (Criteria) this; - } - - public Criteria andCreateUserBetween(String value1, String value2) { - addCriterion("create_user between", value1, value2, "createUser"); - return (Criteria) this; - } - - public Criteria andCreateUserNotBetween(String value1, String value2) { - addCriterion("create_user not between", value1, value2, "createUser"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanBugMapper.java b/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanBugMapper.java deleted file mode 100644 index f2e89d3366..0000000000 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanBugMapper.java +++ /dev/null @@ -1,34 +0,0 @@ -package io.metersphere.plan.mapper; - -import io.metersphere.plan.domain.TestPlanBug; -import io.metersphere.plan.domain.TestPlanBugExample; -import java.util.List; -import org.apache.ibatis.annotations.Param; - -public interface TestPlanBugMapper { - long countByExample(TestPlanBugExample example); - - int deleteByExample(TestPlanBugExample example); - - int deleteByPrimaryKey(String id); - - int insert(TestPlanBug record); - - int insertSelective(TestPlanBug record); - - List selectByExample(TestPlanBugExample example); - - TestPlanBug selectByPrimaryKey(String id); - - int updateByExampleSelective(@Param("record") TestPlanBug record, @Param("example") TestPlanBugExample example); - - int updateByExample(@Param("record") TestPlanBug record, @Param("example") TestPlanBugExample example); - - int updateByPrimaryKeySelective(TestPlanBug record); - - int updateByPrimaryKey(TestPlanBug record); - - int batchInsert(@Param("list") List list); - - int batchInsertSelective(@Param("list") List list, @Param("selective") TestPlanBug.Column ... selective); -} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanBugMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanBugMapper.xml deleted file mode 100644 index 25b5ab8f93..0000000000 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanBugMapper.xml +++ /dev/null @@ -1,306 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - id, num, test_plan_id, case_id, case_type, bug_id, create_time, create_user - - - - - delete from test_plan_bug - where id = #{id,jdbcType=VARCHAR} - - - delete from test_plan_bug - - - - - - insert into test_plan_bug (id, num, test_plan_id, - case_id, case_type, bug_id, - create_time, create_user) - values (#{id,jdbcType=VARCHAR}, #{num,jdbcType=BIGINT}, #{testPlanId,jdbcType=VARCHAR}, - #{caseId,jdbcType=VARCHAR}, #{caseType,jdbcType=VARCHAR}, #{bugId,jdbcType=VARCHAR}, - #{createTime,jdbcType=BIGINT}, #{createUser,jdbcType=VARCHAR}) - - - insert into test_plan_bug - - - id, - - - num, - - - test_plan_id, - - - case_id, - - - case_type, - - - bug_id, - - - create_time, - - - create_user, - - - - - #{id,jdbcType=VARCHAR}, - - - #{num,jdbcType=BIGINT}, - - - #{testPlanId,jdbcType=VARCHAR}, - - - #{caseId,jdbcType=VARCHAR}, - - - #{caseType,jdbcType=VARCHAR}, - - - #{bugId,jdbcType=VARCHAR}, - - - #{createTime,jdbcType=BIGINT}, - - - #{createUser,jdbcType=VARCHAR}, - - - - - - update test_plan_bug - - - id = #{record.id,jdbcType=VARCHAR}, - - - num = #{record.num,jdbcType=BIGINT}, - - - test_plan_id = #{record.testPlanId,jdbcType=VARCHAR}, - - - case_id = #{record.caseId,jdbcType=VARCHAR}, - - - case_type = #{record.caseType,jdbcType=VARCHAR}, - - - bug_id = #{record.bugId,jdbcType=VARCHAR}, - - - create_time = #{record.createTime,jdbcType=BIGINT}, - - - create_user = #{record.createUser,jdbcType=VARCHAR}, - - - - - - - - update test_plan_bug - set id = #{record.id,jdbcType=VARCHAR}, - num = #{record.num,jdbcType=BIGINT}, - test_plan_id = #{record.testPlanId,jdbcType=VARCHAR}, - case_id = #{record.caseId,jdbcType=VARCHAR}, - case_type = #{record.caseType,jdbcType=VARCHAR}, - bug_id = #{record.bugId,jdbcType=VARCHAR}, - create_time = #{record.createTime,jdbcType=BIGINT}, - create_user = #{record.createUser,jdbcType=VARCHAR} - - - - - - update test_plan_bug - - - num = #{num,jdbcType=BIGINT}, - - - test_plan_id = #{testPlanId,jdbcType=VARCHAR}, - - - case_id = #{caseId,jdbcType=VARCHAR}, - - - case_type = #{caseType,jdbcType=VARCHAR}, - - - bug_id = #{bugId,jdbcType=VARCHAR}, - - - create_time = #{createTime,jdbcType=BIGINT}, - - - create_user = #{createUser,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update test_plan_bug - set num = #{num,jdbcType=BIGINT}, - test_plan_id = #{testPlanId,jdbcType=VARCHAR}, - case_id = #{caseId,jdbcType=VARCHAR}, - case_type = #{caseType,jdbcType=VARCHAR}, - bug_id = #{bugId,jdbcType=VARCHAR}, - create_time = #{createTime,jdbcType=BIGINT}, - create_user = #{createUser,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - insert into test_plan_bug - (id, num, test_plan_id, case_id, case_type, bug_id, create_time, create_user) - values - - (#{item.id,jdbcType=VARCHAR}, #{item.num,jdbcType=BIGINT}, #{item.testPlanId,jdbcType=VARCHAR}, - #{item.caseId,jdbcType=VARCHAR}, #{item.caseType,jdbcType=VARCHAR}, #{item.bugId,jdbcType=VARCHAR}, - #{item.createTime,jdbcType=BIGINT}, #{item.createUser,jdbcType=VARCHAR}) - - - - insert into test_plan_bug ( - - ${column.escapedColumnName} - - ) - values - - ( - - - #{item.id,jdbcType=VARCHAR} - - - #{item.num,jdbcType=BIGINT} - - - #{item.testPlanId,jdbcType=VARCHAR} - - - #{item.caseId,jdbcType=VARCHAR} - - - #{item.caseType,jdbcType=VARCHAR} - - - #{item.bugId,jdbcType=VARCHAR} - - - #{item.createTime,jdbcType=BIGINT} - - - #{item.createUser,jdbcType=VARCHAR} - - - ) - - - \ No newline at end of file diff --git a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_12__beta_ddl.sql b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_12__beta_ddl.sql index dd0021d296..e97761d8e7 100644 --- a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_12__beta_ddl.sql +++ b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_12__beta_ddl.sql @@ -24,6 +24,7 @@ CREATE INDEX idx_num ON test_plan_functional_case(num); ALTER TABLE test_resource_pool DROP COLUMN api_test; ALTER TABLE test_resource_pool DROP COLUMN load_test; ALTER TABLE test_resource_pool DROP COLUMN ui_test; +DROP TABLE test_plan_bug; CREATE TABLE IF NOT EXISTS test_plan_allocation diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugCommonService.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugCommonService.java index 3d80dd431b..83df673d51 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugCommonService.java +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugCommonService.java @@ -26,6 +26,7 @@ import io.metersphere.system.domain.ServiceIntegration; import io.metersphere.system.service.PlatformPluginService; import io.metersphere.system.service.PluginLoadService; import jakarta.annotation.Resource; +import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -33,6 +34,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; @Service @Transactional(rollbackFor = Exception.class) @@ -41,6 +43,8 @@ public class BugCommonService { @Resource private FileService fileService; @Resource + private BugStatusService bugStatusService; + @Resource private BugCommentMapper bugCommentMapper; @Resource private BugContentMapper bugContentMapper; @@ -172,4 +176,30 @@ public class BugCommonService { followerExample.createCriteria().andBugIdIn(bugIds); bugFollowerMapper.deleteByExample(followerExample); } + + /** + * 获取状态集合 + * @param projectId 项目ID + * @return 处理人集合 + */ + public Map getAllHandlerMap(String projectId) { + // 缺陷表头处理人选项 + List headerOptions = getHeaderHandlerOption(projectId); + List localOptions = getLocalHandlerOption(projectId); + List allHandleOption = ListUtils.union(headerOptions, localOptions).stream().distinct().toList(); + return allHandleOption.stream().collect(Collectors.toMap(SelectOption::getValue, SelectOption::getText)); + } + + /** + * 获取状态选项 + * @param projectId 项目ID + * @return 状态集合 + */ + public Map getAllStatusMap(String projectId) { + // 缺陷表头状态选项 + List headerOptions = bugStatusService.getHeaderStatusOption(projectId); + List localOptions = bugStatusService.getAllLocalStatusOptions(projectId); + List allStatusOption = ListUtils.union(headerOptions, localOptions).stream().distinct().toList(); + return allStatusOption.stream().collect(Collectors.toMap(SelectOption::getValue, SelectOption::getText)); + } } diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java index c59d3a50ac..eb9c711f80 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java @@ -1245,21 +1245,13 @@ public class BugService { List ids = bugs.stream().map(BugDTO::getId).toList(); List customFields = extBugCustomFieldMapper.getBugAllCustomFields(ids, projectId); Map> customFieldMap = customFields.stream().collect(Collectors.groupingBy(BugCustomFieldDTO::getBugId)); - // 表头处理人选项 - List handleUserOption = bugCommonService.getHeaderHandlerOption(projectId); - Map handleMap = handleUserOption.stream().collect(Collectors.toMap(SelectOption::getValue, SelectOption::getText)); - List localHandlerOption = bugCommonService.getLocalHandlerOption(projectId); - Map localHandleMap = localHandlerOption.stream().collect(Collectors.toMap(SelectOption::getValue, SelectOption::getText)); - // 表头状态选项 - List statusOption = bugStatusService.getHeaderStatusOption(projectId); - Map statusMap = statusOption.stream().collect(Collectors.toMap(SelectOption::getValue, SelectOption::getText)); - List localStatusOptions = bugStatusService.getAllLocalStatusOptions(projectId); - Map localStatusMap = localStatusOptions.stream().collect(Collectors.toMap(SelectOption::getValue, SelectOption::getText)); + Map allHandlerMap = bugCommonService.getAllHandlerMap(projectId); + Map allStatusMap = bugCommonService.getAllStatusMap(projectId); bugs.forEach(bug -> { bug.setCustomFields(customFieldMap.get(bug.getId())); // 解析处理人, 状态 - bug.setHandleUserName(StringUtils.isBlank(handleMap.get(bug.getHandleUser())) ? localHandleMap.get(bug.getHandleUser()) : handleMap.get(bug.getHandleUser())); - bug.setStatusName(StringUtils.isBlank(statusMap.get(bug.getStatus())) ? localStatusMap.get(bug.getStatus()) : statusMap.get(bug.getStatus())); + bug.setHandleUserName(allHandlerMap.get(bug.getHandleUser())); + bug.setStatusName(allStatusMap.get(bug.getStatus())); }); return bugs; } diff --git a/backend/services/test-plan/pom.xml b/backend/services/test-plan/pom.xml index 213815c5c2..aa064f5b5b 100644 --- a/backend/services/test-plan/pom.xml +++ b/backend/services/test-plan/pom.xml @@ -36,6 +36,11 @@ test-jar test + + io.metersphere + metersphere-bug-management + ${revision} + diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanBugController.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanBugController.java new file mode 100644 index 0000000000..a48279bc3d --- /dev/null +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanBugController.java @@ -0,0 +1,40 @@ +package io.metersphere.plan.controller; + +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import io.metersphere.plan.dto.request.TestPlanBugPageRequest; +import io.metersphere.plan.dto.response.TestPlanBugPageResponse; +import io.metersphere.plan.service.TestPlanBugService; +import io.metersphere.sdk.constants.PermissionConstants; +import io.metersphere.system.utils.PageUtils; +import io.metersphere.system.utils.Pager; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import org.apache.commons.lang3.StringUtils; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@Tag(name = "测试计划-详情-缺陷列表") +@RestController +@RequestMapping("/test-plan/bug") +public class TestPlanBugController { + + @Resource + private TestPlanBugService testPlanBugService; + + @PostMapping("/page") + @Operation(summary = "缺陷列表-分页查询") + @RequiresPermissions(PermissionConstants.TEST_PLAN_READ) + public Pager> page(@Validated @RequestBody TestPlanBugPageRequest request) { + Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), + StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "b.create_time desc"); + return PageUtils.setPageInfo(page, testPlanBugService.page(request)); + } +} diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanBugCaseDTO.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanBugCaseDTO.java new file mode 100644 index 0000000000..60776c1a73 --- /dev/null +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanBugCaseDTO.java @@ -0,0 +1,17 @@ +package io.metersphere.plan.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@EqualsAndHashCode(callSuper = false) +public class TestPlanBugCaseDTO { + + @Schema(description = "用例ID") + private String id; + @Schema(description = "缺陷ID") + private String bugId; + @Schema(description = "用例名称") + private String name; +} diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/request/TestPlanBugPageRequest.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/request/TestPlanBugPageRequest.java new file mode 100644 index 0000000000..0cf9148a25 --- /dev/null +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/request/TestPlanBugPageRequest.java @@ -0,0 +1,20 @@ +package io.metersphere.plan.dto.request; + +import io.metersphere.system.dto.sdk.BasePageRequest; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@EqualsAndHashCode(callSuper = false) +public class TestPlanBugPageRequest extends BasePageRequest { + + @Schema(description = "计划ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{test_plan.id.not_blank}") + private String planId; + + @Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{test_plan.project_id.not_blank}") + private String projectId; +} diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanBugPageResponse.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanBugPageResponse.java new file mode 100644 index 0000000000..3a4f052843 --- /dev/null +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanBugPageResponse.java @@ -0,0 +1,30 @@ +package io.metersphere.plan.dto.response; + +import io.metersphere.plan.dto.TestPlanBugCaseDTO; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +@Data +@EqualsAndHashCode(callSuper = false) +public class TestPlanBugPageResponse { + + @Schema(description = "缺陷ID") + private String id; + @Schema(description = "缺陷业务ID") + private String num; + @Schema(description = "缺陷标题") + private String title; + @Schema(description = "关联用例集合") + private List relateCase; + @Schema(description = "处理人") + private String handleUser; + @Schema(description = "状态") + private String status; + @Schema(description = "创建人") + private String createUser; + @Schema(description = "创建时间") + private Long createTime; +} diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanBugMapper.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanBugMapper.java new file mode 100644 index 0000000000..8a1a65f968 --- /dev/null +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanBugMapper.java @@ -0,0 +1,26 @@ +package io.metersphere.plan.mapper; + +import io.metersphere.plan.dto.TestPlanBugCaseDTO; +import io.metersphere.plan.dto.request.TestPlanBugPageRequest; +import io.metersphere.plan.dto.response.TestPlanBugPageResponse; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface ExtTestPlanBugMapper { + + /** + * 查询计划-关联缺陷列表 + * @param request 请求参数 + * @return 缺陷列表 + */ + List list(@Param("request") TestPlanBugPageRequest request); + + /** + * 根据缺陷ID集合获取计划下缺陷关联的用例集合 + * @param bugIds 缺陷ID集合 + * @param planId 计划ID + * @return 用例集合 + */ + List getBugRelatedCase(@Param("ids") List bugIds, @Param("planId") String planId); +} diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanBugMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanBugMapper.xml new file mode 100644 index 0000000000..d7bb410a32 --- /dev/null +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanBugMapper.xml @@ -0,0 +1,236 @@ + + + + + + + + + + + + + + + and b.handle_user in + + + + + and b.status in + + + + + + + + + + + and ( + + + + + + + + + + b.num + + + + + + + + + + b.title + + + + + + + + + + b.platform + + + + + + + + + + b.handle_user + + + + + + + + + + b.status + + + + + + + + + + b.create_user + + + + + + + + + + b.create_time + + + + + + + + + + + + + + + + + + + + b.id not in ( + + + b.id in ( + + select bug_id from bug_custom_field where field_id = #{custom.id} and + + + + JSON_CONTAINS(`value`, JSON_ARRAY(#{val})) + + + + left(replace(unix_timestamp(trim(both '"' from `value`)), '.', ''), 13) + + + + + + trim(both '"' from `value`) + + + + + + ) + + + + ) + + + + + + + 1 = 1 + + + 1 = 2 + + + + + + + + and + + + or + + + + + + + + + + + ( + b.tags is null or b.tags = '[]' or + + !JSON_CONTAINS(b.tags, JSON_ARRAY(#{tag})) + + ) + + + + + + + + JSON_CONTAINS(b.tags, JSON_ARRAY(#{tag})) + + + + + + + + (b.tags is null or b.tags = '[]') + + + \ No newline at end of file diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.xml index 6f653ff86e..b86ef5bce9 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.xml +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.xml @@ -317,7 +317,7 @@