diff --git a/backend/src/main/java/io/metersphere/base/domain/IssuesDao.java b/backend/src/main/java/io/metersphere/base/domain/IssuesDao.java index fe2587f8d7..b5a76c9a92 100644 --- a/backend/src/main/java/io/metersphere/base/domain/IssuesDao.java +++ b/backend/src/main/java/io/metersphere/base/domain/IssuesDao.java @@ -3,6 +3,8 @@ package io.metersphere.base.domain; import lombok.Getter; import lombok.Setter; +import java.util.List; + @Getter @Setter public class IssuesDao extends IssuesWithBLOBs { @@ -11,4 +13,5 @@ public class IssuesDao extends IssuesWithBLOBs { private String creatorName; private String resourceName; private long caseCount; + private List caseIds; } diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml index a15f673c14..04830ebada 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml @@ -348,6 +348,12 @@ or test_case.tags like CONCAT('%', #{request.name},'%') or test_case.custom_num like CONCAT('%', #{request.name},'%')) + + and test_case.id in + + #{id} + + and test_case.id in (select test_case_id from test_case_test where test_case_test.create_time >= #{request.createTime}) diff --git a/backend/src/main/java/io/metersphere/track/service/IssuesService.java b/backend/src/main/java/io/metersphere/track/service/IssuesService.java index 450b720a8f..9630e4441b 100644 --- a/backend/src/main/java/io/metersphere/track/service/IssuesService.java +++ b/backend/src/main/java/io/metersphere/track/service/IssuesService.java @@ -363,8 +363,12 @@ public class IssuesService { } TestCaseIssuesExample example = new TestCaseIssuesExample(); example.createCriteria().andIssuesIdEqualTo(item.getId()); - long caseCount = testCaseIssuesMapper.countByExample(example); - item.setCaseCount(caseCount); + List testCaseIssues = testCaseIssuesMapper.selectByExample(example); + List caseIds = testCaseIssues.stream() + .map(TestCaseIssues::getTestCaseId) + .collect(Collectors.toList()); + item.setCaseIds(caseIds); + item.setCaseCount(testCaseIssues.size()); }); return issues; } diff --git a/frontend/src/business/components/track/case/components/TestCaseList.vue b/frontend/src/business/components/track/case/components/TestCaseList.vue index 6c2618b17c..0dd901735f 100644 --- a/frontend/src/business/components/track/case/components/TestCaseList.vue +++ b/frontend/src/business/components/track/case/components/TestCaseList.vue @@ -388,7 +388,12 @@ export default { activated() { this.getTemplateField(); this.condition.filters = {reviewStatus: ["Prepare", "Pass", "UnPass"]}; + let ids = this.$route.params.ids; + if (ids) { + this.condition.ids = ids; + } this.initTableData(); + this.condition.ids = null; }, watch: { selectNodeIds() { diff --git a/frontend/src/business/components/track/issue/IssueList.vue b/frontend/src/business/components/track/issue/IssueList.vue index 01fd791929..65246eb76d 100644 --- a/frontend/src/business/components/track/issue/IssueList.vue +++ b/frontend/src/business/components/track/issue/IssueList.vue @@ -120,7 +120,7 @@ :label="item.label" prop="caseCount">