From e6b33eae2fab8485a604a7d5238a47f66952c14d Mon Sep 17 00:00:00 2001 From: CaptainB Date: Mon, 17 Jan 2022 13:13:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9F=A5=E8=AF=A2case=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E9=BB=98=E8=AE=A4=E6=98=BE=E7=A4=BA=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1009672 --user=刘瑞斌 [接口CASE]-同一个接口不同版本CASE 的ID是相同的 https://www.tapd.cn/55049933/s/1092827 --- .../base/mapper/ext/ExtApiTestCaseMapper.xml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml index f492cec29a..ee1a5bc108 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml @@ -416,6 +416,26 @@ AND t1.version_id = #{request.versionId} + + AND ( + t1.version_id = (SELECT project_version.id + FROM api_definition tmp + JOIN project_version + ON tmp.project_id = project_version.project_id AND tmp.version_id = project_version.id AND latest = TRUE + WHERE ref_id = a.ref_id + LIMIT 1) + OR + t1.version_id = (SELECT project_version.id + FROM api_definition tmp + JOIN project_version ON tmp.project_id = project_version.project_id AND + tmp.version_id = project_version.id + WHERE ref_id = a.ref_id + GROUP BY ref_id + HAVING MAX(latest) = 0 + ORDER BY MAX(project_version.create_time) DESC + LIMIT 1) + ) + GROUP BY t1.id, t1.project_id, t1.name,