diff --git a/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java b/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java index bae8ebfcfb..5e77219593 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java @@ -157,6 +157,14 @@ public class ApiTestCaseService { i.setPrefix("t1"); } }); + if (request.getFilters() != null) { + Map> filters = request.getFilters(); + List status = filters.get("status"); + if (status == null) { + // sql 需要有这个字段 + filters.put("status", new ArrayList<>()); + } + } request.setOrders(orders); } if (checkThisWeekData) { 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 750a2291b9..d42f2d771a 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 @@ -621,7 +621,7 @@ update api_test_case set original_status=status, status = 'Trash',delete_time = #{deleteTime},delete_user_id = #{deleteUserId} - where status != 'Trash' AND id IN + where id IN #{v}