From 55b475047cbc6aa477080ba3d6966686b1d8a889 Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Wed, 26 Apr 2023 14:48:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA)?= =?UTF-8?q?=EF=BC=9A=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=85=B3=E8=81=94=E7=94=A8=E4=BE=8B=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E7=BB=9F=E8=AE=A1-=E6=8E=A5=E5=8F=A3=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E6=95=B0=E9=87=8F=E7=BB=9F=E8=AE=A1=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1025819 --user=王旭 【测试跟踪】首页-关联用例数量统计-接口用例数量统计数量错误 https://www.tapd.cn/55049933/s/1367024 --- .../base/mapper/ext/ExtTestCaseMapper.java | 3 ++ .../base/mapper/ext/ExtTestCaseMapper.xml | 51 +++++++++++++++++++ .../metersphere/service/TestCaseService.java | 5 +- 3 files changed, 55 insertions(+), 4 deletions(-) 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 64b7c3fb9a..f81eb7a4d4 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 @@ -1,6 +1,7 @@ package io.metersphere.base.mapper.ext; import io.metersphere.base.domain.TestCase; +import io.metersphere.base.domain.TestCaseTest; import io.metersphere.base.domain.TestCaseWithBLOBs; import io.metersphere.dto.*; @@ -167,4 +168,6 @@ public interface ExtTestCaseMapper { void updateNoModuleTrashNodeToDefault(@Param("projectId") String projectId, @Param("defaultNodeId") String defaultNodeId, @Param("defaultNodePath") String defaultNodePath); void clearLatestVersion(@Param("refId") String refId); + + List getTestCaseRelateList(@Param("testCaseId") String testCaseId); } 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 1745f55d28..e8ff203b7c 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 @@ -1477,4 +1477,55 @@ SET latest = 0 where ref_id = #{refId} + + diff --git a/test-track/backend/src/main/java/io/metersphere/service/TestCaseService.java b/test-track/backend/src/main/java/io/metersphere/service/TestCaseService.java index 35887d4834..5fba53c90b 100644 --- a/test-track/backend/src/main/java/io/metersphere/service/TestCaseService.java +++ b/test-track/backend/src/main/java/io/metersphere/service/TestCaseService.java @@ -2731,10 +2731,7 @@ public class TestCaseService { } public List getRelateTest(String caseId) { - TestCaseTestExample example = new TestCaseTestExample(); - example.createCriteria() - .andTestCaseIdEqualTo(caseId); - List testCaseTests = testCaseTestMapper.selectByExample(example); + List testCaseTests = extTestCaseMapper.getTestCaseRelateList(caseId); Map testCaseTestsMap = testCaseTests.stream() .collect(Collectors.toMap(TestCaseTest::getTestId, i -> i));