From 013b37d4099b2648dfb670ac4e25c70526ed92c7 Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Tue, 7 Nov 2023 10:17:01 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E7=94=A8=E4=BE=8B=E7=AE=A1=E7=90=86):?= =?UTF-8?q?=20=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/ExtFunctionalCaseMapper.xml | 29 ++++++++++++++++--- .../request/FunctionalCasePageRequest.java | 3 ++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseMapper.xml b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseMapper.xml index 06d8eadc2d..1f5e68e010 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseMapper.xml +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseMapper.xml @@ -102,6 +102,9 @@ + + + @@ -121,13 +124,20 @@ and functional_case.version_id in - - and functional_case.id in ( - select case_id from functional_case_custom_field where field_id = + + and test_case.id in ( + select resource_id from custom_field_test_case where concat('custom_single-',field_id) = #{key} - and JSON_CONTAINS(value, json_array(#{value})) + and trim(both '"' from `value`) in + ) + + and test_case.id in ( + select resource_id from custom_field_test_case where concat('custom_multiple-',field_id) = + #{key} + and and JSON_CONTAINS(`value`, json_array(#{value})) + and functional_case.create_user in @@ -179,4 +189,15 @@ + + + and ${versionTable}.version_id = #{request.versionId} + + + and ${versionTable}.ref_id = #{request.refId} + + + AND ${versionTable}.latest = 0 + + \ No newline at end of file diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/request/FunctionalCasePageRequest.java b/backend/services/case-management/src/main/java/io/metersphere/functional/request/FunctionalCasePageRequest.java index 28ce38c4e9..7d2cd2da04 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/request/FunctionalCasePageRequest.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/request/FunctionalCasePageRequest.java @@ -21,4 +21,7 @@ public class FunctionalCasePageRequest extends BasePageRequest { @Schema(description = "版本id") private String versionId; + + @Schema(description = "版本来源") + private String refId; }