diff --git a/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.java b/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.java index 779c689ebc..d86b1ca336 100644 --- a/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.java +++ b/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.java @@ -22,7 +22,7 @@ public interface ExtApiDefinitionMapper { List selectByIds(@Param("ids") List ids, @Param("projectId") String projectId); - List selectByIdsAndStatusIsNotTrash(@Param("ids") List ids, @Param("projectId") String projectId); + List countByApiIdAndStatusIsNotTrash(@Param("ids") List ids, @Param("projectId") String projectId); int removeToGcByExample(ApiDefinitionExampleWithOperation example); diff --git a/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml b/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml index 99b952444e..a023ef07b1 100644 --- a/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml +++ b/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml @@ -117,15 +117,10 @@ - + SELECT t1.api_definition_id apiDefinitionId,count(t1.id) caseTotal FROM api_test_case t1 - LEFT JOIN api_definition_exec_result t2 ON t1.last_result_id=t2.id - WHERE t1.project_id = #{projectId} and (t1.status is null or t1.status != 'Trash') + WHERE (t1.status is null or t1.status != 'Trash') group by t1.api_definition_id having t1.api_definition_id in #{v} @@ -368,13 +363,12 @@ api_definition.description,api_definition.environment_id, api_definition.status, api_definition.user_id, api_definition.create_time, api_definition.update_time, project.name as - project_name, user.name as user_name,deleteUser.name AS delete_user,api_definition.delete_time, + project_name, user.name as user_name,api_definition.delete_user_id AS delete_user,api_definition.delete_time, api_definition.remark from (select * from api_definition where update_time >= #{startTimestamp} order by update_time desc)api_definition - left join project on api_definition.project_id = project.id - left join user on api_definition.user_id = user.id - left join user deleteUser on api_definition.delete_user_id = deleteUser.id + INNER join project on api_definition.project_id = project.id + INNER join user on api_definition.user_id = user.id order by @@ -1134,7 +1128,7 @@