From 1a8a5997fbbc2c34effcafdaf57f138a51fde9aa Mon Sep 17 00:00:00 2001 From: buaixuexideshitongxue <2936013465@qq.com> Date: Tue, 20 Jan 2026 17:53:37 +0800 Subject: [PATCH] =?UTF-8?q?fix-=E8=A7=86=E9=A2=91=E7=9D=A3=E5=AF=9F?= =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E5=A4=A7=E5=B1=8F--=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E8=B6=8B=E5=8A=BF=E6=95=B0=E9=87=8F=E4=B8=8D=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supervision/mapper/NegativeMapper.java | 26 +-------------- .../resources/mapper/SupTaskProblemMapper.xml | 33 ++++++++++++------- 2 files changed, 23 insertions(+), 36 deletions(-) diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java index 2770bf4..4607dc0 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java @@ -203,20 +203,6 @@ public interface NegativeMapper extends BaseMapper { SupervisionNotifyOverView getAllSupervisionNotifyCount(Date beginTime, Date endTime); -// @Select("SELECT " + -// " sd.short_name as label, " + -// "COUNT(DISTINCT ng.id) AS denominator, " + -// "COUNT( DISTINCT IF(ng.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL) ) AS processingNumber, " + -// "COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS numerator, " + -// "IFNULL(ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) AS value " + -// "FROM negative ng " + -// "LEFT JOIN sup_depart sd ON ng.second_involve_depart_id=sd.id " + -// "WHERE problemSourcesCode IN (27,28,29,30) " + -// "AND sd.statistics_group_id=#{groupId} " + -// "AND crtTime BETWEEN #{beginTime} AND #{endTime} " + -// " GROUP BY sd.short_name " + -// " ORDER BY value desc ") -// List getAuditNegativeVo(Date beginTime, Date endTime,String groupId); @Select("SELECT " + @@ -681,17 +667,7 @@ public interface NegativeMapper extends BaseMapper { List getSuboOneVideoSuperviseTeamProblemRank(Date beginTime, Date endTime, Integer groupId, Integer departId); List getSubOneVideoSuperviseTrend(@Param("year") String year, @Param("problemCode") String problemCode, @Param("departIds") List departIds); -// @Select("SELECT COUNT(DISTINCT ng.id) AS discoverProblem, " + -// "COUNT(DISTINCT IF(ng.processing_status='completed', ng.id, NULL)) AS completionProblem, " + -// "COUNT(DISTINCT ng.involveDepartId) AS relativeOrg, " + -// "COUNT(DISTINCT nb.blameName) AS relativePer, " + -// "IFNULL( ROUND((COUNT(DISTINCT IF(ng.processing_status='completed', ng.id, NULL)) / COUNT(DISTINCT ng.id)) * 100, 1), 0) AS completionRate " + -// "FROM sup_depart sd " + -// "INNER JOIN negative ng ON sd.id = ng.involveDepartId AND sd.pid=#{departId} " + -// "LEFT JOIN negative_blame nb ON ng.id = nb.negativeId " + -// "WHERE ng.checkStatus IN ('1','2') " + -// "AND problemSourcesCode = 16 " + -// "AND ng.crtTime BETWEEN #{beginTime} AND #{endTime}; ") + @Select("SELECT " + "COUNT(DISTINCT ng.id) total, " + "COUNT(DISTINCT IF(ng.checkStatus IN ('1','2'), ng.id, NULL)) AS discoverProblem, " + diff --git a/src/main/resources/mapper/SupTaskProblemMapper.xml b/src/main/resources/mapper/SupTaskProblemMapper.xml index 8b34420..5ec3012 100644 --- a/src/main/resources/mapper/SupTaskProblemMapper.xml +++ b/src/main/resources/mapper/SupTaskProblemMapper.xml @@ -53,18 +53,29 @@ ORDER BY m.`month` ASC; - + SELECT + m.month_name AS `name`, + IFNULL(COUNT(temp.id), 0) AS `value` FROM sup_month_monthname m - LEFT JOIN (SELECT ng.* - FROM negative ng - INNER JOIN sup_depart sd ON ng.involveDepartId = sd.id AND sd.pid = #{departId}) AS temp -- 加上 AS temp - ON DATE_FORMAT(temp.crtTime, '%m') = m.month - AND YEAR(temp.crtTime) = #{year} - AND temp.checkStatus != 3 - AND temp.problemSourcesCode = 16 - GROUP BY m.month_name - ORDER BY m.month ASC; + LEFT JOIN ( + SELECT ng.id, ng.crtTime + FROM negative ng + WHERE ng.problemSourcesCode = #{problemCode} + AND YEAR(ng.crtTime) = #{year} + AND ng.involveDepartId IN + + #{did} + + ) temp + ON DATE_FORMAT(temp.crtTime, '%m') = m.month + GROUP BY m.month_name, m.month + ORDER BY m.month ASC