diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugRelateCaseMapper.xml b/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugRelateCaseMapper.xml index 4f40a08c96..c6e64ca2e9 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugRelateCaseMapper.xml +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugRelateCaseMapper.xml @@ -298,12 +298,12 @@ bug_relation_case brc INNER JOIN bug b ON brc.bug_id = b.id INNER JOIN bug_content bc ON brc.bug_id = bc.bug_id - left join test_plan tp on brc.test_plan_id = tp.id + LEFT JOIN test_plan tp on brc.test_plan_id = tp.id LEFT JOIN user createUser ON b.create_user = createUser.id + b.deleted = false and brc.test_plan_case_id = #{request.testPlanCaseId} - and b.title like concat('%', #{request.keyword},'%') diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java index c6e487cb5b..dea41d35be 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java @@ -700,7 +700,11 @@ public class TestPlanFunctionalCaseService extends TestPlanResourceService { testPlanCaseExecuteHistoryExample.createCriteria().andCaseIdEqualTo(caseId).andTestPlanCaseIdEqualTo(id).andDeletedEqualTo(false); testPlanCaseExecuteHistoryExample.setOrderByClause("create_time DESC"); response.setRunListCount((int) testPlanCaseExecuteHistoryMapper.countByExample(testPlanCaseExecuteHistoryExample)); - response.setBugListCount(getBugListCount(id, planFunctionalCase.getTestPlanId())); + AssociateBugPageRequest associateBugPageRequest = new AssociateBugPageRequest(); + associateBugPageRequest.setTestPlanCaseId(id); + associateBugPageRequest.setProjectId(functionalCaseDetail.getProjectId()); + List associateBugs = hasAssociateBugPage(associateBugPageRequest); + response.setBugListCount(CollectionUtils.isNotEmpty(associateBugs) ? associateBugs.size() : 0); return response; }