From e88ef257c2017e80db2e21f40982ca954f3a543d Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Mon, 21 Nov 2022 20:54:49 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA=E9=A6=96=E9=A1=B5=E7=BC=BA?= =?UTF-8?q?=E9=99=B7=E7=BB=9F=E8=AE=A1=E6=9C=89=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1019998 --user=宋昌昌 【测试跟踪】首页-测试计划遗留缺陷统计-本周新增统计有误 https://www.tapd.cn/55049933/s/1300156 --- .../base/domain/TestCaseIssues.java | 11 +- .../base/domain/TestCaseIssuesExample.java | 130 +++++++++++++----- .../base/mapper/TestCaseIssuesMapper.java | 3 +- .../base/mapper/TestCaseIssuesMapper.xml | 57 +++++--- .../base/mapper/ext/ExtIssuesMapper.xml | 3 +- .../base/mapper/ext/ExtTestCaseMapper.java | 2 + .../base/mapper/ext/ExtTestCaseMapper.xml | 10 ++ .../service/TestCaseIssueService.java | 1 + .../metersphere/service/TestCaseService.java | 1 + .../io/metersphere/service/TrackService.java | 2 +- .../db/migration/V3__2.4.0_release.sql | 1 + .../business/home/components/BugCountCard.vue | 2 +- 12 files changed, 157 insertions(+), 66 deletions(-) create mode 100644 test-track/backend/src/main/resources/db/migration/V3__2.4.0_release.sql diff --git a/framework/sdk-parent/domain/src/main/java/io/metersphere/base/domain/TestCaseIssues.java b/framework/sdk-parent/domain/src/main/java/io/metersphere/base/domain/TestCaseIssues.java index 82b7bc09bc..4b1c2c05c9 100644 --- a/framework/sdk-parent/domain/src/main/java/io/metersphere/base/domain/TestCaseIssues.java +++ b/framework/sdk-parent/domain/src/main/java/io/metersphere/base/domain/TestCaseIssues.java @@ -1,8 +1,7 @@ package io.metersphere.base.domain; -import lombok.Data; - import java.io.Serializable; +import lombok.Data; @Data public class TestCaseIssues implements Serializable { @@ -12,9 +11,11 @@ public class TestCaseIssues implements Serializable { private String issuesId; - private String refId; - private String refType; + private String refId; + + private Long relateTime; + private static final long serialVersionUID = 1L; -} +} \ No newline at end of file diff --git a/framework/sdk-parent/domain/src/main/java/io/metersphere/base/domain/TestCaseIssuesExample.java b/framework/sdk-parent/domain/src/main/java/io/metersphere/base/domain/TestCaseIssuesExample.java index 6a665564a3..eb79dfbae4 100644 --- a/framework/sdk-parent/domain/src/main/java/io/metersphere/base/domain/TestCaseIssuesExample.java +++ b/framework/sdk-parent/domain/src/main/java/io/metersphere/base/domain/TestCaseIssuesExample.java @@ -314,6 +314,76 @@ public class TestCaseIssuesExample { 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 Criteria andRefIdIsNull() { addCriterion("ref_id is null"); return (Criteria) this; @@ -384,73 +454,63 @@ public class TestCaseIssuesExample { return (Criteria) this; } - public Criteria andRefTypeIsNull() { - addCriterion("ref_type is null"); + public Criteria andRelateTimeIsNull() { + addCriterion("relate_time is null"); return (Criteria) this; } - public Criteria andRefTypeIsNotNull() { - addCriterion("ref_type is not null"); + public Criteria andRelateTimeIsNotNull() { + addCriterion("relate_time is not null"); return (Criteria) this; } - public Criteria andRefTypeEqualTo(String value) { - addCriterion("ref_type =", value, "refType"); + public Criteria andRelateTimeEqualTo(Long value) { + addCriterion("relate_time =", value, "relateTime"); return (Criteria) this; } - public Criteria andRefTypeNotEqualTo(String value) { - addCriterion("ref_type <>", value, "refType"); + public Criteria andRelateTimeNotEqualTo(Long value) { + addCriterion("relate_time <>", value, "relateTime"); return (Criteria) this; } - public Criteria andRefTypeGreaterThan(String value) { - addCriterion("ref_type >", value, "refType"); + public Criteria andRelateTimeGreaterThan(Long value) { + addCriterion("relate_time >", value, "relateTime"); return (Criteria) this; } - public Criteria andRefTypeGreaterThanOrEqualTo(String value) { - addCriterion("ref_type >=", value, "refType"); + public Criteria andRelateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("relate_time >=", value, "relateTime"); return (Criteria) this; } - public Criteria andRefTypeLessThan(String value) { - addCriterion("ref_type <", value, "refType"); + public Criteria andRelateTimeLessThan(Long value) { + addCriterion("relate_time <", value, "relateTime"); return (Criteria) this; } - public Criteria andRefTypeLessThanOrEqualTo(String value) { - addCriterion("ref_type <=", value, "refType"); + public Criteria andRelateTimeLessThanOrEqualTo(Long value) { + addCriterion("relate_time <=", value, "relateTime"); return (Criteria) this; } - public Criteria andRefTypeLike(String value) { - addCriterion("ref_type like", value, "refType"); + public Criteria andRelateTimeIn(List values) { + addCriterion("relate_time in", values, "relateTime"); return (Criteria) this; } - public Criteria andRefTypeNotLike(String value) { - addCriterion("ref_type not like", value, "refType"); + public Criteria andRelateTimeNotIn(List values) { + addCriterion("relate_time not in", values, "relateTime"); return (Criteria) this; } - public Criteria andRefTypeIn(List values) { - addCriterion("ref_type in", values, "refType"); + public Criteria andRelateTimeBetween(Long value1, Long value2) { + addCriterion("relate_time between", value1, value2, "relateTime"); 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"); + public Criteria andRelateTimeNotBetween(Long value1, Long value2) { + addCriterion("relate_time not between", value1, value2, "relateTime"); return (Criteria) this; } } @@ -547,4 +607,4 @@ public class TestCaseIssuesExample { this(condition, value, secondValue, null); } } -} +} \ No newline at end of file diff --git a/test-track/backend/src/main/java/io/metersphere/base/mapper/TestCaseIssuesMapper.java b/test-track/backend/src/main/java/io/metersphere/base/mapper/TestCaseIssuesMapper.java index 5e48cec56a..f389a1c3be 100644 --- a/test-track/backend/src/main/java/io/metersphere/base/mapper/TestCaseIssuesMapper.java +++ b/test-track/backend/src/main/java/io/metersphere/base/mapper/TestCaseIssuesMapper.java @@ -3,7 +3,6 @@ package io.metersphere.base.mapper; import io.metersphere.base.domain.TestCaseIssues; import io.metersphere.base.domain.TestCaseIssuesExample; import java.util.List; - import org.apache.ibatis.annotations.Param; public interface TestCaseIssuesMapper { @@ -29,4 +28,4 @@ public interface TestCaseIssuesMapper { int updateByPrimaryKey(TestCaseIssues record); -} +} \ No newline at end of file diff --git a/test-track/backend/src/main/java/io/metersphere/base/mapper/TestCaseIssuesMapper.xml b/test-track/backend/src/main/java/io/metersphere/base/mapper/TestCaseIssuesMapper.xml index 47c1a95b06..5dc6cbe220 100644 --- a/test-track/backend/src/main/java/io/metersphere/base/mapper/TestCaseIssuesMapper.xml +++ b/test-track/backend/src/main/java/io/metersphere/base/mapper/TestCaseIssuesMapper.xml @@ -5,8 +5,9 @@ - + + @@ -67,7 +68,7 @@ - id, resource_id, issues_id, ref_id, ref_type + id, resource_id, issues_id, ref_type, ref_id, relate_time diff --git a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.java b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.java index 9824c33d26..e2b38b52e0 100644 --- a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.java +++ b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.java @@ -91,6 +91,8 @@ public interface ExtTestCaseMapper { List getTestPlanBug(@Param("planId") String planId); + Long getTestPlanThisWeekBugCount(@Param("planId") String planId, @Param("ids") List ids); + int getTestPlanCase(@Param("planId") String planId); int getTestPlanPassCase(@Param("planId") String planId); diff --git a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml index cb811c4864..fd8e6ac592 100644 --- a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml +++ b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml @@ -894,6 +894,16 @@ join issues on tci.issues_id = issues.id where tptc.plan_id = #{planId} and tptc.is_del != 1 +