diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseIssues.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseIssues.java index cff8104fd7..467ed84f06 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseIssues.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseIssues.java @@ -7,9 +7,13 @@ import lombok.Data; public class TestCaseIssues implements Serializable { private String id; - private String testCaseId; + private String resourceId; private String issuesId; + private String refId; + + private String refType; + private static final long serialVersionUID = 1L; -} \ No newline at end of file +} diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseIssuesExample.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseIssuesExample.java index 02920aa81a..6a665564a3 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseIssuesExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseIssuesExample.java @@ -174,73 +174,73 @@ public class TestCaseIssuesExample { return (Criteria) this; } - public Criteria andTestCaseIdIsNull() { - addCriterion("test_case_id is null"); + public Criteria andResourceIdIsNull() { + addCriterion("resource_id is null"); return (Criteria) this; } - public Criteria andTestCaseIdIsNotNull() { - addCriterion("test_case_id is not null"); + public Criteria andResourceIdIsNotNull() { + addCriterion("resource_id is not null"); return (Criteria) this; } - public Criteria andTestCaseIdEqualTo(String value) { - addCriterion("test_case_id =", value, "testCaseId"); + public Criteria andResourceIdEqualTo(String value) { + addCriterion("resource_id =", value, "resourceId"); return (Criteria) this; } - public Criteria andTestCaseIdNotEqualTo(String value) { - addCriterion("test_case_id <>", value, "testCaseId"); + public Criteria andResourceIdNotEqualTo(String value) { + addCriterion("resource_id <>", value, "resourceId"); return (Criteria) this; } - public Criteria andTestCaseIdGreaterThan(String value) { - addCriterion("test_case_id >", value, "testCaseId"); + public Criteria andResourceIdGreaterThan(String value) { + addCriterion("resource_id >", value, "resourceId"); return (Criteria) this; } - public Criteria andTestCaseIdGreaterThanOrEqualTo(String value) { - addCriterion("test_case_id >=", value, "testCaseId"); + public Criteria andResourceIdGreaterThanOrEqualTo(String value) { + addCriterion("resource_id >=", value, "resourceId"); return (Criteria) this; } - public Criteria andTestCaseIdLessThan(String value) { - addCriterion("test_case_id <", value, "testCaseId"); + public Criteria andResourceIdLessThan(String value) { + addCriterion("resource_id <", value, "resourceId"); return (Criteria) this; } - public Criteria andTestCaseIdLessThanOrEqualTo(String value) { - addCriterion("test_case_id <=", value, "testCaseId"); + public Criteria andResourceIdLessThanOrEqualTo(String value) { + addCriterion("resource_id <=", value, "resourceId"); return (Criteria) this; } - public Criteria andTestCaseIdLike(String value) { - addCriterion("test_case_id like", value, "testCaseId"); + public Criteria andResourceIdLike(String value) { + addCriterion("resource_id like", value, "resourceId"); return (Criteria) this; } - public Criteria andTestCaseIdNotLike(String value) { - addCriterion("test_case_id not like", value, "testCaseId"); + public Criteria andResourceIdNotLike(String value) { + addCriterion("resource_id not like", value, "resourceId"); return (Criteria) this; } - public Criteria andTestCaseIdIn(List values) { - addCriterion("test_case_id in", values, "testCaseId"); + public Criteria andResourceIdIn(List values) { + addCriterion("resource_id in", values, "resourceId"); return (Criteria) this; } - public Criteria andTestCaseIdNotIn(List values) { - addCriterion("test_case_id not in", values, "testCaseId"); + public Criteria andResourceIdNotIn(List values) { + addCriterion("resource_id not in", values, "resourceId"); return (Criteria) this; } - public Criteria andTestCaseIdBetween(String value1, String value2) { - addCriterion("test_case_id between", value1, value2, "testCaseId"); + public Criteria andResourceIdBetween(String value1, String value2) { + addCriterion("resource_id between", value1, value2, "resourceId"); return (Criteria) this; } - public Criteria andTestCaseIdNotBetween(String value1, String value2) { - addCriterion("test_case_id not between", value1, value2, "testCaseId"); + public Criteria andResourceIdNotBetween(String value1, String value2) { + addCriterion("resource_id not between", value1, value2, "resourceId"); return (Criteria) this; } @@ -313,6 +313,146 @@ public class TestCaseIssuesExample { addCriterion("issues_id not between", value1, value2, "issuesId"); return (Criteria) this; } + + public Criteria andRefIdIsNull() { + addCriterion("ref_id is null"); + return (Criteria) this; + } + + public Criteria andRefIdIsNotNull() { + addCriterion("ref_id is not null"); + return (Criteria) this; + } + + public Criteria andRefIdEqualTo(String value) { + addCriterion("ref_id =", value, "refId"); + return (Criteria) this; + } + + public Criteria andRefIdNotEqualTo(String value) { + addCriterion("ref_id <>", value, "refId"); + return (Criteria) this; + } + + public Criteria andRefIdGreaterThan(String value) { + addCriterion("ref_id >", value, "refId"); + return (Criteria) this; + } + + public Criteria andRefIdGreaterThanOrEqualTo(String value) { + addCriterion("ref_id >=", value, "refId"); + return (Criteria) this; + } + + public Criteria andRefIdLessThan(String value) { + addCriterion("ref_id <", value, "refId"); + return (Criteria) this; + } + + public Criteria andRefIdLessThanOrEqualTo(String value) { + addCriterion("ref_id <=", value, "refId"); + return (Criteria) this; + } + + public Criteria andRefIdLike(String value) { + addCriterion("ref_id like", value, "refId"); + return (Criteria) this; + } + + public Criteria andRefIdNotLike(String value) { + addCriterion("ref_id not like", value, "refId"); + return (Criteria) this; + } + + public Criteria andRefIdIn(List values) { + addCriterion("ref_id in", values, "refId"); + return (Criteria) this; + } + + public Criteria andRefIdNotIn(List values) { + addCriterion("ref_id not in", values, "refId"); + return (Criteria) this; + } + + public Criteria andRefIdBetween(String value1, String value2) { + addCriterion("ref_id between", value1, value2, "refId"); + return (Criteria) this; + } + + public Criteria andRefIdNotBetween(String value1, String value2) { + addCriterion("ref_id not between", value1, value2, "refId"); + return (Criteria) this; + } + + public Criteria andRefTypeIsNull() { + addCriterion("ref_type is null"); + return (Criteria) this; + } + + public Criteria andRefTypeIsNotNull() { + addCriterion("ref_type is not null"); + return (Criteria) this; + } + + public Criteria andRefTypeEqualTo(String value) { + addCriterion("ref_type =", value, "refType"); + return (Criteria) this; + } + + public Criteria andRefTypeNotEqualTo(String value) { + addCriterion("ref_type <>", value, "refType"); + return (Criteria) this; + } + + public Criteria andRefTypeGreaterThan(String value) { + addCriterion("ref_type >", value, "refType"); + return (Criteria) this; + } + + public Criteria andRefTypeGreaterThanOrEqualTo(String value) { + addCriterion("ref_type >=", value, "refType"); + return (Criteria) this; + } + + public Criteria andRefTypeLessThan(String value) { + addCriterion("ref_type <", value, "refType"); + return (Criteria) this; + } + + public Criteria andRefTypeLessThanOrEqualTo(String value) { + addCriterion("ref_type <=", value, "refType"); + return (Criteria) this; + } + + public Criteria andRefTypeLike(String value) { + addCriterion("ref_type like", value, "refType"); + return (Criteria) this; + } + + public Criteria andRefTypeNotLike(String value) { + addCriterion("ref_type not like", value, "refType"); + return (Criteria) this; + } + + public Criteria andRefTypeIn(List values) { + addCriterion("ref_type in", values, "refType"); + return (Criteria) this; + } + + public Criteria andRefTypeNotIn(List values) { + addCriterion("ref_type not in", values, "refType"); + return (Criteria) this; + } + + public Criteria andRefTypeBetween(String value1, String value2) { + addCriterion("ref_type between", value1, value2, "refType"); + return (Criteria) this; + } + + public Criteria andRefTypeNotBetween(String value1, String value2) { + addCriterion("ref_type not between", value1, value2, "refType"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { @@ -407,4 +547,4 @@ public class TestCaseIssuesExample { this(condition, value, secondValue, null); } } -} \ No newline at end of file +} diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestCaseIssuesMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/TestCaseIssuesMapper.xml index 10755b5265..47c1a95b06 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestCaseIssuesMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/TestCaseIssuesMapper.xml @@ -3,8 +3,10 @@ - + + + @@ -65,7 +67,7 @@ - id, test_case_id, issues_id + id, resource_id, issues_id, ref_id, ref_type @@ -140,12 +154,18 @@ id = #{record.id,jdbcType=VARCHAR}, - - test_case_id = #{record.testCaseId,jdbcType=VARCHAR}, + + resource_id = #{record.resourceId,jdbcType=VARCHAR}, issues_id = #{record.issuesId,jdbcType=VARCHAR}, + + ref_id = #{record.refId,jdbcType=VARCHAR}, + + + ref_type = #{record.refType,jdbcType=VARCHAR}, + @@ -154,8 +174,10 @@ update test_case_issues set id = #{record.id,jdbcType=VARCHAR}, - test_case_id = #{record.testCaseId,jdbcType=VARCHAR}, - issues_id = #{record.issuesId,jdbcType=VARCHAR} + resource_id = #{record.resourceId,jdbcType=VARCHAR}, + issues_id = #{record.issuesId,jdbcType=VARCHAR}, + ref_id = #{record.refId,jdbcType=VARCHAR}, + ref_type = #{record.refType,jdbcType=VARCHAR} @@ -163,19 +185,27 @@ update test_case_issues - - test_case_id = #{testCaseId,jdbcType=VARCHAR}, + + resource_id = #{resourceId,jdbcType=VARCHAR}, issues_id = #{issuesId,jdbcType=VARCHAR}, + + ref_id = #{refId,jdbcType=VARCHAR}, + + + ref_type = #{refType,jdbcType=VARCHAR}, + where id = #{id,jdbcType=VARCHAR} update test_case_issues - set test_case_id = #{testCaseId,jdbcType=VARCHAR}, - issues_id = #{issuesId,jdbcType=VARCHAR} + set resource_id = #{resourceId,jdbcType=VARCHAR}, + issues_id = #{issuesId,jdbcType=VARCHAR}, + ref_id = #{refId,jdbcType=VARCHAR}, + ref_type = #{refType,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} - \ No newline at end of file + diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.java index b12315220a..1be154ab26 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.java @@ -12,7 +12,7 @@ public interface ExtIssuesMapper { List getIssuesByCaseId(@Param("request") IssuesRequest issuesRequest); - List getIssueForMinder(@Param("caseIds") List caseIds); + List getIssueForMinder(@Param("caseIds") List caseIds, @Param("refType") String refType); List getIssues(@Param("request") IssuesRequest issuesRequest); diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.xml index 5341c06b31..9575540d2f 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.xml @@ -7,25 +7,33 @@ from issues inner join test_case_issues on test_case_issues.issues_id = issues.id - - left join - project on issues.project_id = project.id - and (issues.platform_status != 'delete' or issues.platform_status is NULL) @@ -54,13 +62,13 @@ select count(distinct (tci.issues_id)) from test_plan_test_case tptc - join test_case_issues tci on tptc.case_id = tci.test_case_id - right join test_case on test_case.id = tci.test_case_id + join test_case_issues tci on tptc.case_id = tci.resource_id + right join test_case on test_case.id = tci.resource_id join issues on tci.issues_id = issues.id join test_plan on tptc.plan_id = test_plan.id where test_plan.project_id = #{projectId} diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml index 4aace876ec..8a5ac6142c 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml @@ -724,9 +724,9 @@