From 43f37853d041c15b78086a2b68f49395de079178 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Tue, 26 Jul 2022 23:23:38 +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=E5=85=B3?= =?UTF-8?q?=E8=81=94=E7=94=A8=E4=BE=8B=E6=95=B0=E9=87=8F=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E5=BF=BD=E7=95=A5=E6=8E=89=E5=9B=9E=E6=94=B6=E7=AB=99=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3=E5=92=8C=E5=9C=BA=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1015414 --user=宋天阳 【测试跟踪】首页-关联用例数量统计,统计了回收站中的接口用例和场景 https://www.tapd.cn/55049933/s/1212890 --- .../base/mapper/ext/ExtTestCaseMapper.xml | 361 +++++++++++------- 1 file changed, 223 insertions(+), 138 deletions(-) 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 5e147b6acc..cb3236a1bb 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 @@ -78,9 +78,9 @@ and (test_case.tags is null or test_case.tags - - - + + + ) @@ -109,36 +109,39 @@ and test_case.id in ( - select resource_id from custom_field_test_case where field_id = #{custom.id} - - - and JSON_CONTAINS(`value`, #{custom.value}) - - - and left(replace(unix_timestamp(trim(both '"' from `value`)), '.', ''), 13) - - - - - - and text_value - - - - - - and trim(both '"' from value) - - - - - + select resource_id from custom_field_test_case where field_id = #{custom.id} + + + and JSON_CONTAINS(`value`, #{custom.value}) + + + and left(replace(unix_timestamp(trim(both '"' from `value`)), '.', ''), 13) + + + + + + and text_value + + + + + + and trim(both '"' from value) + + + + + ) - update test_case set custom_num = num where (custom_num is null or custom_num = '') and project_id = #{projectId} + update test_case + set custom_num = num + where (custom_num is null or custom_num = '') + and project_id = #{projectId} select tcn.id, count(*) as caseNum, test_case.project_id from test_case - left join test_case_review_test_case tcrtc on tcrtc.case_id = test_case.id and tcrtc.review_id = #{request.reviewId} + left join test_case_review_test_case tcrtc on tcrtc.case_id = test_case.id and tcrtc.review_id = + #{request.reviewId} left join test_case_node tcn on test_case.node_id = tcn.id and tcrtc.case_id is null @@ -333,15 +340,18 @@ @@ -384,8 +394,7 @@ SELECT * FROM test_case WHERE test_case.project_id = #{projectId} - ORDER BY num DESC - LIMIT 1; + ORDER BY num DESC LIMIT 1; @@ -961,27 +1052,27 @@ update test_case set original_status=status, - status = 'Trash', - delete_time = #{request.deleteTime}, - delete_user_id = #{request.deleteUserId} + status = 'Trash', + delete_time = #{request.deleteTime}, + delete_user_id = #{request.deleteUserId} where ref_id in ( - select a.ref_id from ( - select ref_id from test_case + select a.ref_id from ( + select ref_id from test_case - - - id = #{request.id} - - - and id in - - #{id} - - - + + + id = #{request.id} + + + and id in + + #{id} + + + - ) a - ) + ) a + ) @@ -992,7 +1083,7 @@ ref_id =#{request.refId} - and version_id =#{request.versionId} + and version_id =#{request.versionId} @@ -1027,21 +1118,17 @@ @@ -1060,12 +1147,10 @@ select id, custom_fields from test_case - where project_id = #{projectId} - limit #{offset},#{pageSize} + where project_id = #{projectId} limit #{offset} + , #{pageSize}