Эх сурвалжийг харах

APP驾驶舱-综合数据隐患问题功能

jiawuxian 1 жил өмнө
parent
commit
00432e3fa6

+ 10 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/controller/AppCockpitController.java

@@ -126,6 +126,16 @@ public class AppCockpitController extends BaseController {
     /**
      * 综合数据-安全检查
      */
+    @ApiOperation(value = "综合数据-预案演练", response = AppSyntheticSafetycheckVo.class)
+    @GetMapping("/synthetic/drill")
+    public AjaxResult syntheticDrill(Date month) {
+        AppSyntheticDrillVo vo = appCockpitService.syntheticDrill(month);
+        return success(vo);
+    }
+
+    /**
+     * 综合数据-安全检查
+     */
     @ApiOperation(value = "综合数据-其它", response = AppSyntheticOtherVo.class)
     @GetMapping("/synthetic/other")
     public AjaxResult syntheticOther(Date month) {

+ 32 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/dto/app/AppSyntheticQuestionDto.java

@@ -0,0 +1,32 @@
+package com.xunmei.core.board.dto.app;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class AppSyntheticQuestionDto {
+    @ApiModelProperty("已确认")
+    private int confirmedCount;
+    @ApiModelProperty("有异议(只有安全检查才会)")
+    private int dissentCount;
+    @ApiModelProperty("已取消(只有安全检查才会)")
+    private int cancelCount;
+    @ApiModelProperty("待整改")
+    private int waitReformCount;
+    @ApiModelProperty("已整改")
+    private int reformedCount;
+    @ApiModelProperty("履职隐患数")
+    private int resumptionCount;
+    @ApiModelProperty("履职已整改")
+    private int resumptionReformedCount;
+    @ApiModelProperty("离行巡检隐患数")
+    private int offATMResumptionCount;
+    @ApiModelProperty("离行巡检已整改数")
+    private int offATMResumptionReformedCount;
+    @ApiModelProperty("安全检查隐患数")
+    private int safetyCheckCount;
+    @ApiModelProperty("安全检查已整改数")
+    private int safetyCheckReformCount;
+    @ApiModelProperty("安全检查已确认数")
+    private int safetyCheckConfirmedCount;
+}

+ 27 - 4
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/mapper/AppCockpitMapper.java

@@ -1,10 +1,7 @@
 package com.xunmei.core.board.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.xunmei.core.board.dto.app.AppGA38InfoDto;
-import com.xunmei.core.board.dto.app.AppOrgBaseInfoDto;
-import com.xunmei.core.board.dto.app.AppOverviewTaskInfoDto;
-import com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto;
+import com.xunmei.core.board.dto.app.*;
 import com.xunmei.core.board.vo.app.AppOverviewVo;
 import org.apache.ibatis.annotations.Param;
 import  java.util.Date;
@@ -103,4 +100,30 @@ public interface AppCockpitMapper extends BaseMapper {
      * @return
      */
     List<AppSyntheticTaskCategoryDto> selectSyntheticSafetyCheck (@Param("orgPath") String orgPath,@Param("startDate") Date startDate,@Param("endDate") Date endDate);
+
+    /**
+     * 综合数据-预案演练
+     * @param orgPath
+     * @param startDate
+     * @param endDate
+     * @return
+     */
+    List<AppSyntheticTaskCategoryDto> selectSyntheticDrill (@Param("orgPath") String orgPath,@Param("startDate") Date startDate,@Param("endDate") Date endDate);
+
+    /**
+     *
+     * @param orgPath
+     * @param startDate
+     * @param endDate
+     * @return
+     */
+    AppSyntheticQuestionDto selectSyntheticQuestion(@Param("orgPath") String orgPath, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
+    /**
+     * 获取逾期未整改数量
+     * @param orgPath
+     * @param startDate
+     * @param endDate
+     * @return
+     */
+    int selectOverDueQuestionCount(@Param("orgPath") String orgPath,@Param("startDate") Date startDate,@Param("endDate") Date endDate);
 }

+ 7 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/service/AppCockpitService.java

@@ -50,6 +50,13 @@ public interface AppCockpitService {
     AppSyntheticSafetycheckVo syntheticSafetyCheck(Date month);
 
     /**
+     * 综合数据-预案演练
+     * @param month
+     * @return
+     */
+    AppSyntheticDrillVo syntheticDrill(Date month);
+
+    /**
      * 综合数据-其它
      * @param month
      * @return

+ 80 - 10
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/service/impl/AppCockpitServiceImpl.java

@@ -274,14 +274,43 @@ public class AppCockpitServiceImpl implements AppCockpitService {
 
     @Override
     public AppSyntheticQuestionVo syntheticQuestion(Date month) {
-        return new AppSyntheticQuestionVo();
+        SysOrg org = getLoginOrg();
+        DateRange range = DateUtils.getStartAndEnd(month, CycleCommonEnum.MONTHLY);
+        AppSyntheticQuestionDto questionDto = appCockpitMapper.selectSyntheticQuestion(org.getPath(), range.getStartTime(), range.getEndTime());
+        int overdueCount = appCockpitMapper.selectOverDueQuestionCount(org.getPath(), range.getStartTime(), range.getEndTime());
+        AppSyntheticQuestionVo vo = new AppSyntheticQuestionVo();
+        vo.getRateByState().put("已确认", (float) questionDto.getConfirmedCount());
+        vo.getRateByState().put("有异议", (float) questionDto.getDissentCount());
+        vo.getRateByState().put("已取消", (float) questionDto.getCancelCount());
+        vo.getRateByState().put("待整改", (float) questionDto.getWaitReformCount());
+        vo.getRateByState().put("已逾期", (float) overdueCount);
+        vo.getRateByState().put("已整改", (float) questionDto.getReformedCount());
+        vo.getRateByState().put("整改率", computeRate(questionDto.getConfirmedCount(), questionDto.getReformedCount()));
+
+        vo.getResumption().put("隐患数", (float) questionDto.getResumptionCount());
+        vo.getResumption().put("已整改", (float) questionDto.getResumptionReformedCount());
+        vo.getResumption().put("整改率", computeRate(questionDto.getResumptionCount(), questionDto.getResumptionReformedCount()));
+
+        vo.getOffATMCheck().put("隐患数", (float) questionDto.getOffATMResumptionCount());
+        vo.getOffATMCheck().put("已整改", (float) questionDto.getOffATMResumptionReformedCount());
+        vo.getOffATMCheck().put("整改率", computeRate(questionDto.getOffATMResumptionCount(), questionDto.getOffATMResumptionReformedCount()));
+
+        vo.getSafetyCheck().put("隐患数", (float) questionDto.getSafetyCheckCount());
+        vo.getSafetyCheck().put("有异议", (float) questionDto.getDissentCount());
+        vo.getSafetyCheck().put("已取消", (float) questionDto.getCancelCount());
+        vo.getSafetyCheck().put("已确认", (float) questionDto.getSafetyCheckConfirmedCount());
+        vo.getSafetyCheck().put("已整改", (float) questionDto.getSafetyCheckReformCount());
+        vo.getSafetyCheck().put("整改率", computeRate(questionDto.getSafetyCheckConfirmedCount(), questionDto.getSafetyCheckReformCount()));
+
+        return vo;
+
     }
 
     @Override
     public AppSyntheticSafetycheckVo syntheticSafetyCheck(Date month) {
         SysOrg org = getLoginOrg();
         DateRange range = DateUtils.getStartAndEnd(month, CycleCommonEnum.MONTHLY);
-        List<AppSyntheticTaskCategoryDto> taskCategoryDtos = appCockpitMapper.selectSyntheticResumption(org.getPath(), range.getStartTime(), range.getEndTime());
+        List<AppSyntheticTaskCategoryDto> taskCategoryDtos = appCockpitMapper.selectSyntheticSafetyCheck(org.getPath(), range.getStartTime(), range.getEndTime());
 
         AppSyntheticSafetycheckVo vo = new AppSyntheticSafetycheckVo();
         vo.setTaskInfoByType(new HashMap<>());
@@ -304,14 +333,55 @@ public class AppCockpitServiceImpl implements AppCockpitService {
             return true;
         };
 
-        predicate3.test(Arrays.asList("3"),"网点自查",null);
-        predicate3.test(Arrays.asList("4"),"全面检查",null);
-        predicate3.test(Arrays.asList("2"),"办事处检查",null);
-        predicate3.test(Arrays.asList("1"),"省联社检查",null);
-        predicate3.test(Arrays.asList("5"),"阶段性检查",null);
-        predicate3.test(Arrays.asList("6"),"专项检查",null);
-        predicate3.test(Arrays.asList("7"),"其它检查",null);
-        return  vo;
+        predicate3.test(Arrays.asList("3"), "网点自查", null);
+        predicate3.test(Arrays.asList("4"), "全面检查", null);
+        predicate3.test(Arrays.asList("2"), "办事处检查", null);
+        predicate3.test(Arrays.asList("1"), "省联社检查", null);
+        predicate3.test(Arrays.asList("5"), "阶段性检查", null);
+        predicate3.test(Arrays.asList("6"), "专项检查", null);
+        predicate3.test(Arrays.asList("7"), "其它检查", null);
+        return vo;
+    }
+
+    /**
+     * 综合数据-预案演练
+     *
+     * @param month
+     * @return
+     */
+    @Override
+    public AppSyntheticDrillVo syntheticDrill(Date month) {
+        SysOrg org = getLoginOrg();
+        DateRange range = DateUtils.getStartAndEnd(month, CycleCommonEnum.QUARTERLY);
+        List<AppSyntheticTaskCategoryDto> taskCategoryDtos = appCockpitMapper.selectSyntheticDrill(org.getPath(), range.getStartTime(), range.getEndTime());
+        AppSyntheticDrillVo vo = new AppSyntheticDrillVo();
+        vo.setInfoByType(new HashMap<>());
+        vo.setRateByType(new HashMap<>());
+
+        Predicate3<List<String>, String, String> predicate3 = (List<String> types, String label, String no) -> {
+            List<AppSyntheticTaskCategoryDto> used = taskCategoryDtos.stream().filter(d -> types.contains(d.getPlanType())).collect(Collectors.toList());
+            int total = used.stream().mapToInt(AppSyntheticTaskCategoryDto::getTotal).sum();
+            int completed = used.stream().mapToInt(AppSyntheticTaskCategoryDto::getCompleted).sum();
+            Float rate = computeRate(total, completed);
+
+            vo.getRateByType().put(label, rate);
+            vo.getInfoByType().put(label, AppSyntheticTaskInfoVo.builder()
+                    .shouldCompleteCount(total)
+                    .completedCount(completed)
+                    .completedRate(rate)
+                    .build());
+
+            return true;
+        };
+
+        predicate3.test(Arrays.asList("3"), "网点自查", null);
+        predicate3.test(Arrays.asList("4"), "全面检查", null);
+        predicate3.test(Arrays.asList("2"), "办事处检查", null);
+        predicate3.test(Arrays.asList("1"), "省联社检查", null);
+        predicate3.test(Arrays.asList("5"), "阶段性检查", null);
+        predicate3.test(Arrays.asList("6"), "专项检查", null);
+        predicate3.test(Arrays.asList("7"), "其它检查", null);
+        return vo;
     }
 
     @Override

+ 2 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/vo/app/AppBaseInfoVo.java

@@ -32,9 +32,9 @@ public class AppBaseInfoVo {
     @ApiModelProperty("安保人员配备情况(已配备、未配备)")
     private Map<String,Integer> securityPeopleInfo;
 
-    @ApiModelProperty("在行产权信息")
+    @ApiModelProperty("在行产权信息(大堂式设备、穿墙式设备)")
     private Map<String,Integer> onlineATMPropertyRight;
 
-    @ApiModelProperty("离行产权信息")
+    @ApiModelProperty("离行产权信息(大堂式设备、穿墙式设备)")
     private Map<String,Integer> offlineATMPropertyRight;
 }

+ 18 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/vo/app/AppSyntheticDrillVo.java

@@ -0,0 +1,18 @@
+package com.xunmei.core.board.vo.app;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Map;
+
+/**
+ * 综合数据-预案演练
+ */
+@Data
+public class AppSyntheticDrillVo {
+    @ApiModelProperty("各类型完成率")
+    private Map<String,Float> rateByType;
+
+    @ApiModelProperty("各类型完成情况")
+    private Map<String,AppSyntheticTaskInfoVo> infoByType;
+}

+ 15 - 4
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/vo/app/AppSyntheticQuestionVo.java

@@ -3,6 +3,7 @@ package com.xunmei.core.board.vo.app;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.HashMap;
 import java.util.Map;
 
 /**
@@ -10,12 +11,22 @@ import java.util.Map;
  */
 @Data
 public class AppSyntheticQuestionVo {
-    @ApiModelProperty("各种状态下的整改数据:已确认、有异议 、已取消、待整改、未整改、已整改、整改率")
-    private Map<String,Float>  rateByState;
+    @ApiModelProperty("各种状态下的整改数据:已确认、有异议 、已取消、待整改、已逾期、已整改、整改率")
+    private Map<String, Float> rateByState;
 
     @ApiModelProperty("每日履职:隐患数、已整改、整改率")
-    private  Map<String,Float> resumption;
+    private Map<String, Float> resumption;
+
+    @ApiModelProperty("离行巡检:隐患数、已整改、整改率")
+    private Map<String, Float> offATMCheck;
 
     @ApiModelProperty("安全检查:隐患数、有异议、已取消、已确认、已整改、整改率")
-    private  Map<String,Float> safetyCheck;
+    private Map<String, Float> safetyCheck;
+
+    public AppSyntheticQuestionVo(){
+        this.resumption=new HashMap<>();
+        this.rateByState=new HashMap<>();
+        this.offATMCheck=new HashMap<>();
+        this.safetyCheck=new HashMap<>();
+    }
 }

+ 127 - 68
soc-modules/soc-modules-core/src/main/resources/mapper/board/AppCockpitMapper.xml

@@ -17,25 +17,25 @@
           and o.path like concat(#{orgPath}, '%')
     </select>
     <select id="selectOrgGa38" resultType="com.xunmei.core.board.dto.app.AppGA38InfoDto">
-        SELECT count(0)            as total,
-               sum(m.ga382021)     as ga382021,
+        SELECT count(0)               as total,
+               sum(m.ga382021)        as ga382021,
                sum(m.ga382021current) as ga382021current,
-               sum(m.ga382021prev) as ga382021prev,
-               sum(m.ga382015)     as ga382015,
+               sum(m.ga382021prev)    as ga382021prev,
+               sum(m.ga382015)        as ga382015,
                sum(m.ga382015current) as ga382015current,
-               sum(m.ga382021prev) as ga382021prev
+               sum(m.ga382021prev)    as ga382021prev
         from sys_org o
                  LEFT JOIN (SELECT org_id,
                                    IF
                                        (standard = 1, 1, 0)                                         AS ga382021,
                                    IF
-                                       (standard = 1, IF(date_of_compliance >= #{date}, 1, 0), 0) AS ga382021current,
+                                       (standard = 1, IF(date_of_compliance >= #{date}, 1, 0), 0)   AS ga382021current,
                                    IF
                                        (standard = 1, IF(date_of_compliance &lt; #{date}, 1, 0), 0) AS ga382021prev,
                                    IF
                                        (standard = 2, 1, 0)                                         AS ga382015,
                                    IF
-                                       (standard = 2, IF(date_of_compliance >= #{date}, 1, 0), 0) AS ga382015current,
+                                       (standard = 2, IF(date_of_compliance >= #{date}, 1, 0), 0)   AS ga382015current,
                                    IF
                                        (standard = 2, IF(date_of_compliance &lt; #{date}, 1, 0), 0) AS ga382015prev
                             FROM sys_org_physical_defense_construction
@@ -58,12 +58,12 @@
     </select>
 
     <select id="selectOverViewSafetyCheckTaskInfo" resultType="com.xunmei.core.board.dto.app.AppOverviewTaskInfoDto">
-        SELECT sum(if(t.ymd_date >= #{date}, 1, 0))                          as total,
+        SELECT sum(if(t.ymd_date >= #{date}, 1, 0))                            as total,
                sum(if(t.ymd_date >= #{date}, (if(t.`status` = 3, 1, 0)), 0))   as completed,
-               sum(if(t.ymd_date &lt; #{date}, 1, 0))                        as prevcount,
+               sum(if(t.ymd_date &lt; #{date}, 1, 0))                          as prevcount,
                sum(if(t.ymd_date &lt; #{date}, (if(t.`status` = 3, 1, 0)), 0)) as prevcompleted
         FROM core_safety_task t
-        INNER JOIN core_safecheck_plan p on t.plan_id=p.id and p.check_type=3
+                 INNER JOIN core_safecheck_plan p on t.plan_id = p.id and p.check_type = 3
         WHERE ymd_date >= #{prevdate}
           and org_path like concat(#{orgPath}, '%')
     </select>
@@ -106,79 +106,138 @@
     </select>
 
     <select id="selectOrgBaseInfo" resultType="com.xunmei.core.board.dto.app.AppOrgBaseInfoDto">
-        SELECT
-            count(0) as total,
-            sum(if(oh.org_id is null,1,0)) as unreachedCount,
-            sum(if(o.type=4,1,0)) as bankingCount,
-            sum(if(o.type=5,1,0)) as offATMCount,
-            sum(if(o.type=4 and oh.ga382021 is not null,1,0)) as bankingGA382021 ,
-            sum(if(o.type=4 and oh.ga382015 is not null,1,0)) as bankingGA382015 ,
-            sum(if(o.type=5 and oh.ga382021 is not null,1,0)) as offATMGA382021 ,
-            sum(if(o.type=5 and oh.ga382015 is not null,1,0)) as offATMGA382015,
-            sum(if(oe.business_library_type=1,1,0)) as businessLibraryOne,
-            sum(if(oe.business_library_type=2,1,0)) as businessLibraryTwo,
-            sum(if(oe.business_library_type=3,1,0)) as businessLibraryThree,
-            sum(if(oe.business_library_type=4,1,0)) as businessLibraryFour,
-            sum(if(oe.askari=1,1,0)) as orgWithSecurityCount,
-            sum(if(o.type=4 and oe.lobby_equipment is not null,oe.lobby_equipment,0)) as bankingObbyDeviceCount,
-            sum(if(o.type=4 and oe.wall_penetrating_equipment is not null,oe.wall_penetrating_equipment,0)) as bankingWallDeviceCount,
-            sum(if(o.type=5 and oe.lobby_equipment is not null,oe.lobby_equipment,0)) as offATMObbyDeviceCount,
-            sum(if(o.type=5 and oe.wall_penetrating_equipment is not null,oe.wall_penetrating_equipment,0)) as offATMWallDeviceCount
-        FROM
-            sys_org o
-                LEFT  JOIN (SELECT org_id,
+        SELECT count(0)                                                                                            as total,
+               sum(if(oh.org_id is null, 1, 0))                                                                    as unreachedCount,
+               sum(if(o.type = 4, 1, 0))                                                                           as bankingCount,
+               sum(if(o.type = 5, 1, 0))                                                                           as offATMCount,
+               sum(if(o.type = 4 and oh.ga382021 is not null, 1, 0))                                               as bankingGA382021,
+               sum(if(o.type = 4 and oh.ga382015 is not null, 1, 0))                                               as bankingGA382015,
+               sum(if(o.type = 5 and oh.ga382021 is not null, 1, 0))                                               as offATMGA382021,
+               sum(if(o.type = 5 and oh.ga382015 is not null, 1, 0))                                               as offATMGA382015,
+               sum(if(oe.business_library_type = 1, 1, 0))                                                         as businessLibraryOne,
+               sum(if(oe.business_library_type = 2, 1, 0))                                                         as businessLibraryTwo,
+               sum(if(oe.business_library_type = 3, 1, 0))                                                         as businessLibraryThree,
+               sum(if(oe.business_library_type = 4, 1, 0))                                                         as businessLibraryFour,
+               sum(if(oe.askari = 1, 1, 0))                                                                        as orgWithSecurityCount,
+               sum(if(o.type = 4 and oe.lobby_equipment is not null, oe.lobby_equipment,
+                      0))                                                                                          as bankingObbyDeviceCount,
+               sum(if(o.type = 4 and oe.wall_penetrating_equipment is not null, oe.wall_penetrating_equipment,
+                      0))                                                                                          as bankingWallDeviceCount,
+               sum(if(o.type = 5 and oe.lobby_equipment is not null, oe.lobby_equipment,
+                      0))                                                                                          as offATMObbyDeviceCount,
+               sum(if(o.type = 5 and oe.wall_penetrating_equipment is not null, oe.wall_penetrating_equipment,
+                      0))                                                                                          as offATMWallDeviceCount
+        FROM sys_org o
+                 LEFT JOIN (SELECT org_id,
                                    IF
-                                       (standard = 1, 1, 0)                                         AS ga382021,
+                                       (standard = 1, 1, 0) AS ga382021,
 
 
                                    IF
-                                       (standard = 2, 1, 0)                                         AS ga382015
+                                       (standard = 2, 1, 0) AS ga382015
 
                             FROM sys_org_physical_defense_construction
                             WHERE type = 1
                                OR type = 3
                             GROUP BY org_id) oh ON o.id = oh.org_id
-                LEFT JOIN sys_org_extend oe on o.id=oe.org_id
-        WHERE
-            o.deleted = 0 and path like concat(#{orgPath}, '%')
+                 LEFT JOIN sys_org_extend oe on o.id = oe.org_id
+        WHERE o.deleted = 0
+          and path like concat(#{orgPath}, '%')
           AND (
                     o.type = 4
                 OR o.type = 5)
     </select>
     <select id="selectSyntheticResumption" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">
-        SELECT
-            p.plan_type,
-            count( 0 ) AS total,
-            sum(
-                    IF
-                        ( r.STATUS = 3, 1, 0 )) AS completed,
-            sum( r.exception_count ) AS exceptionCount
-        FROM
-            core_resumption r
-                INNER JOIN core_resumption_plan p ON r.plan_id = p.id
-        WHERE
-            r.ymd_date BETWEEN #{startDate}
-                AND #{endDate}
-          AND r.org_path LIKE CONCAT( #{orgPath}, '%' )
-        GROUP BY
-            p.plan_type
+        SELECT p.plan_type,
+               count(0)                          AS total,
+               sum(
+                       IF
+                           (r.STATUS = 3, 1, 0)) AS completed,
+               sum(r.exception_count)            AS exceptionCount
+        FROM core_resumption r
+                 INNER JOIN core_resumption_plan p ON r.plan_id = p.id
+        WHERE r.ymd_date BETWEEN #{startDate}
+            AND #{endDate}
+          AND r.org_path LIKE CONCAT(#{orgPath}, '%')
+        GROUP BY p.plan_type
     </select>
     <select id="selectSyntheticSafetyCheck" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">
-        SELECT
-            p.plan_type,
-            count( 0 ) AS total,
-            sum(
-                    IF
-                        ( r.STATUS = 3, 1, 0 )) AS completed,
-            sum( r.exception_count ) AS exceptionCount
-        FROM
-            core_safety_task r
-                INNER JOIN core_safecheck_plan p ON r.plan_id = p.id
-        WHERE
-            r.ymd_date BETWEEN #{startDate}
-                AND #{endDate}
-          AND r.org_path LIKE CONCAT( #{orgPath}, '%' )
-        GROUP BY
-            p.plan_type
+        SELECT p.check_type as plan_type,
+               count(0)                          AS total,
+               sum(
+                       IF
+                           (r.STATUS = 3, 1, 0)) AS completed,
+               sum(r.exception_count)            AS exceptionCount
+        FROM core_safety_task r
+                 INNER JOIN core_safecheck_plan p ON r.plan_id = p.id
+        WHERE r.ymd_date BETWEEN #{startDate}
+            AND #{endDate}
+          AND r.org_path LIKE CONCAT(#{orgPath}, '%')
+        GROUP BY p.check_type
+    </select>
+    <select id="selectSyntheticDrill" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">
+        SELECT r.type                            as plan_type,
+               count(0)                          AS total,
+               sum(
+                       IF
+                           (r.STATUS = 3, 1, 0)) AS completed
+        FROM core_drill_task r
+        WHERE r.start_date BETWEEN #{startDate}
+            AND #{endDate}
+          AND r.org_path LIKE CONCAT(#{orgPath}, '%')
+        GROUP BY r.type
+    </select>
+    <select id="selectSyntheticQuestion" resultType="com.xunmei.core.board.dto.app.AppSyntheticQuestionDto">
+        SELECT sum(
+                       IF
+                           (q.confirm_status >= 2, 1, 0))                            AS confirmedCount,
+               sum(qf.count)                                                         AS dissentCount,
+               sum(
+                       IF
+                           (q.confirm_status = 3 AND q.reform_status IS NULL, 1, 0)) AS cancelCount,
+               sum(
+                       IF
+                           (q.confirm_status = 2, 1, 0))                             AS waitReformCount,
+               sum(
+                       IF
+                           (q.reform_status = 11, 1, 0))                             AS reformedCount,
+               sum(
+                       IF
+                           (q.src_type = 1 AND q.src_task_type != 6, 1, 0))          AS resumptionCount,
+               sum(
+                       IF
+                           (q.src_type = 1 AND q.src_task_type != 6 AND q.reform_status = 11, 1,
+                            0))                                                         resumptionReformedCount,
+               sum(
+                       IF
+                           (q.src_type = 1 AND q.src_task_type = 6, 1, 0))           AS offATMResumptionCount,
+               sum(
+                       IF
+                           (q.src_type = 1 AND q.src_task_type = 6 AND q.reform_status = 11, 1,
+                            0))                                                         offATMResumptionReformedCount,
+               sum(
+                       IF
+                           (q.src_type = 2, 1, 0))                                   AS safetyCheckCount,
+               sum(
+                       IF
+                           (q.src_type = 2 AND q.reform_status = 11, 1, 0))             safetyCheckReformedCount,
+               sum(
+                       IF
+                           (q.confirm_status >= 2 AND q.src_type = 2, 1, 0))         AS safetyCheckConfirmedCount
+        FROM core_question q
+                 LEFT JOIN (SELECT question_id, count(0) AS count
+                            FROM core_question_flow
+                            WHERE execute_step = 1
+                              AND execute_status = 1
+                            GROUP BY question_id) qf ON q.id = qf.question_id
+        WHERE q.submit_time BETWEEN #{startDate} AND #{endDate}
+          AND q.org_path LIKE CONCAT(#{orgPath}, '%')
+    </select>
+    <select id="selectOverDueQuestionCount" resultType="java.lang.Integer">
+        SELECT count(0)
+        FROM core_question
+        WHERE reform_deadline BETWEEN '2023-10-01 00:00:00' AND '2023-11-30 23:59'
+          and reform_status != 11
+          and confirm_status != 3
     </select>
 </mapper>