Ver código fonte

大屏统计优化

xuxiaofei 2 anos atrás
pai
commit
8fd0c5e6eb

+ 3 - 3
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabRiskPlanAbnormalGroupController.java

@@ -74,10 +74,10 @@ public class LabRiskPlanAbnormalGroupController extends BaseController {
 
 
     /**
     /**
      * 东北大学,数据大屏, 预案执行统计
      * 东北大学,数据大屏, 预案执行统计
-     * @param group
+     * @param
      * @return
      * @return
      */
      */
-    @GetMapping("/riskRecordCount")
+    /*@GetMapping("/riskRecordCount")
     @ApiOperation(value = "查询预案执行记录")
     @ApiOperation(value = "查询预案执行记录")
     public TableDataInfo riskRecordCount(LabRiskPlanAbnormalGroup group) {
     public TableDataInfo riskRecordCount(LabRiskPlanAbnormalGroup group) {
         //结束时间
         //结束时间
@@ -114,7 +114,7 @@ public class LabRiskPlanAbnormalGroupController extends BaseController {
             }
             }
         }
         }
         return getDataTable(backList);
         return getDataTable(backList);
-    }
+    }*/
 
 
     public static void main(String[] args) {
     public static void main(String[] args) {
         System.out.println(Integer.valueOf("09"));
         System.out.println(Integer.valueOf("09"));

+ 2 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/WarningNoticeLogController.java

@@ -172,10 +172,11 @@ public class WarningNoticeLogController extends AbstractController {
 
 
 
 
     @GetMapping("/warningCollect")
     @GetMapping("/warningCollect")
-    @ApiOperation("数据大屏-校级,预警通知统计")
+    @ApiOperation("数据大屏-校级,预警通知统计 Top5")
     public ResultData warningCollect(WarningNoticeLogVO vo) {
     public ResultData warningCollect(WarningNoticeLogVO vo) {
         List<WarningNoticeLogVO> backList = new ArrayList<>();
         List<WarningNoticeLogVO> backList = new ArrayList<>();
         //集合查询
         //集合查询
+        vo.setWarningType(3);
         List<WarningNoticeLogVO> list = warningNoticeLogService.selectWarningNoticelist(vo);
         List<WarningNoticeLogVO> list = warningNoticeLogService.selectWarningNoticelist(vo);
 
 
         if(list!=null && list.size()>0 && list.get(0).getDeptName()!=null){
         if(list!=null && list.size()>0 && list.get(0).getDeptName()!=null){

+ 3 - 3
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabControlMapper.xml

@@ -203,10 +203,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         FROM
         FROM
         lab_risk_plan_abnormal_group gp
         lab_risk_plan_abnormal_group gp
         INNER JOIN lab_subject s ON gp.`subject_id` = s.`id`
         INNER JOIN lab_subject s ON gp.`subject_id` = s.`id`
-        INNER JOIN lab_risk_plan_abnormal_log al ON gp.`id` = al.`group_id`
-        INNER JOIN sys_dept x2 ON s.`dept_id` = x2.`dept_id`
         <where>
         <where>
-            1=1 and al.`risk_status`=1
             <if test="deptId != null and deptId !=''">
             <if test="deptId != null and deptId !=''">
                 and ( s.dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE find_in_set(#{deptId} ,ancestors )) or s.dept_id = #{deptId} )
                 and ( s.dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE find_in_set(#{deptId} ,ancestors )) or s.dept_id = #{deptId} )
             </if>
             </if>
@@ -253,6 +250,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="subjectId != null and subjectId != '' ">
             <if test="subjectId != null and subjectId != '' ">
                 AND s.`id` = #{subjectId}
                 AND s.`id` = #{subjectId}
             </if>
             </if>
+            <if test="deptId != null and deptId !=''"> <!-- 部门id-->
+                and ( s.dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE find_in_set(#{deptId} ,ancestors )) or s.dept_id = #{deptId} )
+            </if>
             <if test="beginTimeStr != null and beginTimeStr != ''"><!-- 开始时间检索 -->
             <if test="beginTimeStr != null and beginTimeStr != ''"><!-- 开始时间检索 -->
                 AND date_format(gp.create_time,'%y%m%d') &gt;= date_format(#{beginTimeStr},'%y%m%d')
                 AND date_format(gp.create_time,'%y%m%d') &gt;= date_format(#{beginTimeStr},'%y%m%d')
             </if>
             </if>

+ 3 - 2
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabRiskPlanAbnormalGroupMapper.xml

@@ -170,9 +170,10 @@
                 or s.name like concat('%', #{searchValue}, '%')
                 or s.name like concat('%', #{searchValue}, '%')
                 )
                 )
             </if>
             </if>
-            <if test="deptId != null ">and s.dept_id = #{deptId}</if>
             <if test="riskAttribute != null ">and g.risk_attribute = #{riskAttribute}</if>
             <if test="riskAttribute != null ">and g.risk_attribute = #{riskAttribute}</if>
-
+            <if test="deptId != null and deptId !=''">
+                and ( s.dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE find_in_set(#{deptId} ,ancestors )) or s.dept_id = #{deptId} )
+            </if>
             <if test="startTime != null ">
             <if test="startTime != null ">
                 and date_format(g.create_time,'%Y-%m-%d') &gt;= date_format(#{startTime},'%Y-%m-%d')
                 and date_format(g.create_time,'%Y-%m-%d') &gt;= date_format(#{startTime},'%Y-%m-%d')
             </if>
             </if>

+ 3 - 0
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/WarningNoticeLogMapper.xml

@@ -59,6 +59,9 @@
         count(id)              totalNum
         count(id)              totalNum
         from lab_warning_notice_log
         from lab_warning_notice_log
         where DATE_FORMAT(create_time, '%Y%m') = DATE_FORMAT(NOW(), '%Y%m')
         where DATE_FORMAT(create_time, '%Y%m') = DATE_FORMAT(NOW(), '%Y%m')
+        <if test="warningType != null and warningType !=''">
+            and warning_type = #{warningType}
+        </if>
         <if test="deptId != null and deptId !=''">
         <if test="deptId != null and deptId !=''">
             and ( college_id in (SELECT dt.dept_id FROM sys_dept dt WHERE find_in_set(#{deptId} ,ancestors )) or college_id = #{deptId} )
             and ( college_id in (SELECT dt.dept_id FROM sys_dept dt WHERE find_in_set(#{deptId} ,ancestors )) or college_id = #{deptId} )
         </if>
         </if>