diff --git a/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java b/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java index 1c7338facb..f66f3198ec 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java +++ b/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioExecuteService.java @@ -195,7 +195,9 @@ public class ApiScenarioExecuteService { // 测试计划执行数据查询 List testPlanApiScenarioList; if (CollectionUtils.isNotEmpty(request.getPlanScenarioIds())) { - testPlanApiScenarioList = extTestPlanScenarioCaseMapper.selectByPlanIds(request.getPlanScenarioIds()); + testPlanApiScenarioList = extTestPlanScenarioCaseMapper.selectByPlanScenarioIds(request.getPlanScenarioIds(), + "\"" + StringUtils.join(request.getPlanScenarioIds(), ",") + "\""); + } else { testPlanApiScenarioList = extTestPlanScenarioCaseMapper.selectLegalDataByTestPlanId(request.getTestPlanId()); } diff --git a/api-test/backend/src/main/java/io/metersphere/base/mapper/plan/ext/ExtTestPlanScenarioCaseMapper.java b/api-test/backend/src/main/java/io/metersphere/base/mapper/plan/ext/ExtTestPlanScenarioCaseMapper.java index d6aaa24304..e010a2d17a 100644 --- a/api-test/backend/src/main/java/io/metersphere/base/mapper/plan/ext/ExtTestPlanScenarioCaseMapper.java +++ b/api-test/backend/src/main/java/io/metersphere/base/mapper/plan/ext/ExtTestPlanScenarioCaseMapper.java @@ -22,19 +22,19 @@ public interface ExtTestPlanScenarioCaseMapper { List getNotRelevanceCaseIds(String planId, List relevanceProjectIds); - List selectIds(@Param("request")TestPlanScenarioRequest request); + List selectIds(@Param("request") TestPlanScenarioRequest request); - List selectByIds(@Param("ids")String ids ,@Param("order")String order ); + List selectByIds(@Param("ids") String ids, @Param("order") String order); List selectLegalDataByTestPlanId(String planId); - List selectByPlanIds(List planScenarioIds); + List selectByPlanScenarioIds(@Param("planScenarioIds") List planScenarioIds, @Param("order") String order); List selectForPlanReport(String planId); List getFailureList(@Param("planId") String planId, @Param("status") String status); - List getFailureListByIds(@Param("ids") Collection ids,@Param("status") String status); + List getFailureListByIds(@Param("ids") Collection ids, @Param("status") String status); List getUnderwaySteps(@Param("ids") List underwayIds); @@ -49,5 +49,6 @@ public interface ExtTestPlanScenarioCaseMapper { Long getLastOrder(@Param("planId") String planId, @Param("baseOrder") Long baseOrder); List selectNameByIdIn(List ids); + String selectProjectId(String testPlanId); } diff --git a/api-test/backend/src/main/java/io/metersphere/base/mapper/plan/ext/ExtTestPlanScenarioCaseMapper.xml b/api-test/backend/src/main/java/io/metersphere/base/mapper/plan/ext/ExtTestPlanScenarioCaseMapper.xml index 70ccfe9627..e6d132cf03 100644 --- a/api-test/backend/src/main/java/io/metersphere/base/mapper/plan/ext/ExtTestPlanScenarioCaseMapper.xml +++ b/api-test/backend/src/main/java/io/metersphere/base/mapper/plan/ext/ExtTestPlanScenarioCaseMapper.xml @@ -402,7 +402,7 @@ ) - SELECT tpas.id, tpas.api_scenario_id, tpas.environment, @@ -416,5 +416,6 @@ #{id} + ORDER BY FIND_IN_SET(tpas.id, ${order})