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 753ea19e2b..04b1cc8b73 100644 --- a/backend/src/main/java/io/metersphere/base/domain/IssuesDao.java +++ b/backend/src/main/java/io/metersphere/base/domain/IssuesDao.java @@ -17,7 +17,6 @@ public class IssuesDao extends IssuesWithBLOBs { private long caseCount; private List caseIds; private String caseId; - private int totalIssueCount; private List tapdUsers; private ListzentaoBuilds; private String zentaoAssigned; diff --git a/backend/src/main/java/io/metersphere/base/domain/IssuesStatusCountDao.java b/backend/src/main/java/io/metersphere/base/domain/IssuesStatusCountDao.java new file mode 100644 index 0000000000..92b47798da --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/domain/IssuesStatusCountDao.java @@ -0,0 +1,12 @@ +package io.metersphere.base.domain; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class IssuesStatusCountDao { + private int count; + private String statusValue; + private String platform; +} diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.java index a9b13e86fd..b2509aedaa 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.java @@ -2,9 +2,11 @@ package io.metersphere.base.mapper.ext; import io.metersphere.base.domain.Issues; import io.metersphere.base.domain.IssuesDao; +import io.metersphere.base.domain.IssuesStatusCountDao; import io.metersphere.dto.CustomFieldItemDTO; import io.metersphere.track.dto.CustomFieldResourceCompatibleDTO; import io.metersphere.track.dto.PlanReportIssueDTO; +import io.metersphere.track.request.testcase.IssuesCountRequest; import io.metersphere.track.request.testcase.IssuesRequest; import org.apache.ibatis.annotations.Param; @@ -26,7 +28,7 @@ public interface ExtIssuesMapper { List selectForPlanReport(String planId); - List getCountByStatus(@Param("request") IssuesRequest issuesRequest); + List getCountByStatus(@Param("request") IssuesCountRequest issuesRequest); List selectIdNotInUuIds(@Param("projectId") String projectId, @Param("platform") String platform, @Param("platformIds") List platformIds); diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.xml index 96a146972c..d4a8aed3e3 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.xml @@ -83,11 +83,22 @@ - + select count(1) as `count`, if(i.platform = 'Local', cfi.value, i.platform_status) as statusValue, i.platform + from issues i + inner join project p + on i.project_id = p.id and p.workspace_id = #{request.workspaceId} + left join custom_field_issues cfi + on i.id = cfi.resource_id and field_id in ( + select cf.id + from custom_field cf + left join project pr + on cf.project_id = pr.id + where cf.scene = 'ISSUE' and cf.name = '状态' + and (pr.workspace_id = #{request.workspaceId} or global = true) + ) + where i.creator = #{request.creator} + group by statusValue;