From c64211a2b9e6594fbd29e64cc40cf314de8a3736 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Thu, 6 Apr 2023 11:02:36 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3case=E6=94=AF=E6=8C=81=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --story=1011245 --user=宋天阳 接口case支持通过路径搜索 https://www.tapd.cn/55049933/s/1359680 --- .../base/mapper/ext/ExtApiTestCaseMapper.xml | 69 ++++++++++--------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml b/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml index 277f5ad147..7a79891a5d 100644 --- a/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml +++ b/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml @@ -453,9 +453,12 @@ - and (t1.name like CONCAT('%', #{request.name},'%') + and ( + t1.name like CONCAT('%', #{request.name},'%') or t1.tags like CONCAT('%', #{request.name},'%') - or t1.num like CONCAT('%', #{request.name},'%')) + or t1.num like CONCAT('%', #{request.name},'%') + or a.path like CONCAT('%', #{request.name},'%') + ) and t1.create_time >= #{request.createTime} @@ -664,9 +667,9 @@ SELECT count(testCase.id) AS countNumber FROM api_test_case testCase - INNER JOIN api_definition apiDef ON testCase.api_definition_id = apiDef.id + INNER JOIN api_definition apiDef ON testCase.api_definition_id = apiDef.id WHERE testCase.project_id = #{projectId} AND apiDef.status != "Trash" - AND (testCase.create_time BETWEEN #{firstDayTimestamp} - AND #{lastDayTimestamp}) - AND (testCase.status is null - or testCase.status != 'Trash') + AND (testCase.create_time BETWEEN #{firstDayTimestamp} + AND #{lastDayTimestamp}) + AND (testCase.status is null + or testCase.status != 'Trash') AND apiDef.version_id = #{versionId} @@ -744,7 +747,8 @@ SELECT * FROM api_test_case WHERE api_test_case.api_definition_id = #{definitionId} - ORDER BY num DESC LIMIT 1; + ORDER BY num DESC + LIMIT 1; select id, project_id, name, version_id FROM api_definition - WHERE id IN ( - SELECT api_definition_id FROM api_test_case WHERE id = #{0} - ) + WHERE id IN (SELECT api_definition_id + FROM api_test_case + WHERE id = #{0})