From 33600ec03e0dc93fe5e4263c90590bfb6b5cf55d Mon Sep 17 00:00:00 2001 From: CaptainB Date: Wed, 19 Jan 2022 22:32:05 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BF=AE=E6=94=B9=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1009781 --user=刘瑞斌 【接口测试】接口定义和场景列表显示的版本不对 https://www.tapd.cn/55049933/s/1094702 --- .../base/mapper/ext/ExtApiDefinitionMapper.xml | 16 ++++------------ .../base/mapper/ext/ExtApiScenarioMapper.xml | 8 ++------ .../base/mapper/ext/ExtLoadTestMapper.xml | 8 ++------ .../base/mapper/ext/ExtTestCaseMapper.xml | 16 ++++------------ .../mapper/ext/ExtTestPlanTestCaseMapper.xml | 8 ++------ .../base/mapper/ext/ExtTestReviewCaseMapper.xml | 8 ++------ 6 files changed, 16 insertions(+), 48 deletions(-) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml index a9c5ae074a..d15a563381 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml @@ -490,14 +490,10 @@ WHERE ref_id = api_definition.ref_id LIMIT 1) OR - version_id = (SELECT project_version.id + version_id = (SELECT tmp.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 = api_definition.ref_id - GROUP BY ref_id - HAVING MAX(latest) = 0 - ORDER BY MAX(project_version.create_time) DESC + ORDER BY tmp.update_time DESC LIMIT 1) ) @@ -754,14 +750,10 @@ WHERE ref_id = api_definition.ref_id LIMIT 1) OR - version_id = (SELECT project_version.id + version_id = (SELECT tmp.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 = api_definition.ref_id - GROUP BY ref_id - HAVING MAX(latest) = 0 - ORDER BY MAX(project_version.create_time) DESC + ORDER BY tmp.update_time DESC LIMIT 1) ) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml index 75651884b7..fab32aeb88 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml @@ -333,14 +333,10 @@ WHERE ref_id = api_scenario.ref_id LIMIT 1) OR - version_id = (SELECT project_version.id + version_id = (SELECT tmp.version_id FROM api_scenario tmp - JOIN project_version ON tmp.project_id = project_version.project_id AND - tmp.version_id = project_version.id WHERE ref_id = api_scenario.ref_id - GROUP BY ref_id - HAVING MAX(latest) = 0 - ORDER BY MAX(project_version.create_time) DESC + ORDER BY tmp.update_time DESC LIMIT 1) ) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml index 95a2955c16..6024d115c3 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml @@ -181,14 +181,10 @@ WHERE ref_id = load_test.ref_id LIMIT 1) OR - version_id = (SELECT project_version.id + version_id = (SELECT tmp.version_id FROM load_test tmp - JOIN project_version ON tmp.project_id = project_version.project_id AND - tmp.version_id = project_version.id WHERE ref_id = load_test.ref_id - GROUP BY ref_id - HAVING MAX(latest) = 0 - ORDER BY MAX(project_version.create_time) DESC + ORDER BY tmp.update_time DESC LIMIT 1) ) 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 1bcf671e9a..1510dd46c2 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 @@ -142,14 +142,10 @@ WHERE ref_id = test_case.ref_id LIMIT 1) OR - version_id = (SELECT project_version.id + version_id = (SELECT tmp.version_id FROM test_case tmp - JOIN project_version ON tmp.project_id = project_version.project_id AND - tmp.version_id = project_version.id WHERE ref_id = test_case.ref_id - GROUP BY ref_id - HAVING MAX(latest) = 0 - ORDER BY MAX(project_version.create_time) DESC + ORDER BY tmp.update_time DESC LIMIT 1) ) @@ -635,14 +631,10 @@ WHERE ref_id = test_case.ref_id LIMIT 1) OR - version_id = (SELECT project_version.id + version_id = (SELECT tmp.version_id FROM test_case tmp - JOIN project_version ON tmp.project_id = project_version.project_id AND - tmp.version_id = project_version.id WHERE ref_id = test_case.ref_id - GROUP BY ref_id - HAVING MAX(latest) = 0 - ORDER BY MAX(project_version.create_time) DESC + ORDER BY tmp.update_time DESC LIMIT 1) ) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml index 396a0842b8..5a08ebc97f 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml @@ -186,14 +186,10 @@ WHERE ref_id = test_case.ref_id LIMIT 1) OR - version_id = (SELECT project_version.id + version_id = (SELECT tmp.version_id FROM test_case tmp - JOIN project_version ON tmp.project_id = project_version.project_id AND - tmp.version_id = project_version.id WHERE ref_id = test_case.ref_id - GROUP BY ref_id - HAVING MAX(latest) = 0 - ORDER BY MAX(project_version.create_time) DESC + ORDER BY tmp.update_time DESC LIMIT 1) ) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.xml index 1ef19687bc..87012c28f9 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.xml @@ -182,14 +182,10 @@ WHERE ref_id = test_case.ref_id LIMIT 1) OR - version_id = (SELECT project_version.id + version_id = (SELECT tmp.version_id FROM test_case tmp - JOIN project_version ON tmp.project_id = project_version.project_id AND - tmp.version_id = project_version.id WHERE ref_id = test_case.ref_id - GROUP BY ref_id - HAVING MAX(latest) = 0 - ORDER BY MAX(project_version.create_time) DESC + ORDER BY tmp.update_time DESC LIMIT 1) )