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}