fix(测试跟踪):修复测试跟踪首页关联用例数量统计-接口用例数量统计数量不正确
--bug=1025819 --user=王旭 【测试跟踪】首页-关联用例数量统计-接口用例数量统计数量错误 https://www.tapd.cn/55049933/s/1367024
This commit is contained in:
parent
724981b469
commit
55b475047c
|
@ -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<TestCaseTest> getTestCaseRelateList(@Param("testCaseId") String testCaseId);
|
||||
}
|
||||
|
|
|
@ -1477,4 +1477,55 @@
|
|||
SET latest = 0
|
||||
where ref_id = #{refId}
|
||||
</update>
|
||||
|
||||
<select id="getTestCaseRelateList" resultType="io.metersphere.base.domain.TestCaseTest" parameterType="java.lang.String">
|
||||
SELECT
|
||||
test_case_test.test_case_id as testCaseId,
|
||||
test_case_test.test_id as testId,
|
||||
test_case_test.test_type as testType,
|
||||
test_case_test.create_time as createTime,
|
||||
test_case_test.update_time as updateTime
|
||||
FROM
|
||||
test_case_test
|
||||
LEFT JOIN api_test_case ON test_case_test.test_id = api_test_case.id
|
||||
WHERE
|
||||
( test_case_id = #{testCaseId} AND test_case_test.test_type = 'testcase' AND ( api_test_case.STATUS != 'Trash' OR api_test_case.STATUS IS NULL ) ) UNION ALL
|
||||
SELECT
|
||||
test_case_test.test_case_id,
|
||||
test_case_test.test_id,
|
||||
test_case_test.test_type,
|
||||
test_case_test.create_time,
|
||||
test_case_test.update_time
|
||||
FROM
|
||||
test_case_test
|
||||
LEFT JOIN api_scenario ON test_case_test.test_id = api_scenario.id
|
||||
WHERE
|
||||
( test_case_id = #{testCaseId} AND test_case_test.test_type = 'automation' AND api_scenario.STATUS != 'Trash' ) UNION ALL
|
||||
SELECT
|
||||
test_case_test.test_case_id,
|
||||
test_case_test.test_id,
|
||||
test_case_test.test_type,
|
||||
test_case_test.create_time,
|
||||
test_case_test.update_time
|
||||
FROM
|
||||
test_case_test
|
||||
LEFT JOIN load_test ON test_case_test.test_id = load_test.id
|
||||
WHERE
|
||||
( test_case_id = #{testCaseId} AND test_case_test.test_type = 'performance' ) UNION ALL
|
||||
SELECT
|
||||
test_case_test.test_case_id,
|
||||
test_case_test.test_id,
|
||||
test_case_test.test_type,
|
||||
test_case_test.create_time,
|
||||
test_case_test.update_time
|
||||
FROM
|
||||
test_case_test
|
||||
LEFT JOIN ui_scenario ON test_case_test.test_id = ui_scenario.id
|
||||
WHERE
|
||||
(
|
||||
test_case_id = #{testCaseId}
|
||||
AND test_case_test.test_type = 'uiAutomation'
|
||||
AND ui_scenario.STATUS != 'Trash'
|
||||
)
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -2731,10 +2731,7 @@ public class TestCaseService {
|
|||
}
|
||||
|
||||
public List<TestCaseTestDao> getRelateTest(String caseId) {
|
||||
TestCaseTestExample example = new TestCaseTestExample();
|
||||
example.createCriteria()
|
||||
.andTestCaseIdEqualTo(caseId);
|
||||
List<TestCaseTest> testCaseTests = testCaseTestMapper.selectByExample(example);
|
||||
List<TestCaseTest> testCaseTests = extTestCaseMapper.getTestCaseRelateList(caseId);
|
||||
Map<String, TestCaseTest> testCaseTestsMap = testCaseTests.stream()
|
||||
.collect(Collectors.toMap(TestCaseTest::getTestId, i -> i));
|
||||
|
||||
|
|
Loading…
Reference in New Issue