Selaa lähdekoodia

1、缺陷详情增加筛选条件

zhaops 5 vuotta sitten
vanhempi
commit
5cbad95fea

+ 1 - 0
src/main/java/com/diagbot/dto/DeptEntryNumDTO.java

@@ -32,4 +32,5 @@ public class DeptEntryNumDTO {
     private String percentStr;
     private Double score;
     private Integer isReject;
+    private Integer ruleType;
 }

+ 1 - 0
src/main/java/com/diagbot/dto/EntryNumDTO.java

@@ -27,4 +27,5 @@ public class EntryNumDTO {
     private String percentStr;
     private Double score;
     private Integer isReject;
+    private Integer ruleType;
 }

+ 2 - 3
src/main/java/com/diagbot/facade/ConsoleByDeptFacade.java

@@ -1,7 +1,6 @@
 package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.dto.CaseAndDeptNumDTO;
 import com.diagbot.dto.DeptBaseDTO;
 import com.diagbot.dto.DeptEntryNumDTO;
 import com.diagbot.dto.DeptNumDTO;
@@ -491,7 +490,7 @@ public class ConsoleByDeptFacade {
      * @param filterPageByDeptVO
      * @return
      */
-    public IPage<CaseAndDeptNumDTO> entryCountGroupByEntryAndDeptPage(FilterPageByDeptVO filterPageByDeptVO) {
+    public IPage<DeptEntryNumDTO> entryCountGroupByEntryAndDeptPage(FilterPageByDeptVO filterPageByDeptVO) {
         if (StringUtil.isBlank(filterPageByDeptVO.getDeptName())) {
             List<DeptBaseDTO> deptList = this.getDept();
             //默认取第一个科室
@@ -500,7 +499,7 @@ public class ConsoleByDeptFacade {
             }
         }
         filterPageByDeptVOSet(filterPageByDeptVO);
-        IPage<CaseAndDeptNumDTO> page = qcresultInfoFacade.entryCountGroupByEntryAndDeptPage(filterPageByDeptVO);
+        IPage<DeptEntryNumDTO> page = qcresultInfoFacade.entryCountGroupByEntryAndDeptPage(filterPageByDeptVO);
         return page;
     }
 

+ 2 - 3
src/main/java/com/diagbot/facade/ConsoleFacade.java

@@ -5,7 +5,6 @@ import com.diagbot.aggregate.AverageStatisticsAggregate;
 import com.diagbot.aggregate.MrStatisticsAggregate;
 import com.diagbot.aggregate.ResultStatisticsAggregate;
 import com.diagbot.dto.AverageStatisticsDTO;
-import com.diagbot.dto.CaseNumDTO;
 import com.diagbot.dto.DeptNumDTO;
 import com.diagbot.dto.EntryNumDTO;
 import com.diagbot.dto.HomePageNumDTO;
@@ -466,9 +465,9 @@ public class ConsoleFacade {
      * @param filterPageVO
      * @return
      */
-    public IPage<CaseNumDTO> entryCountGroupByEntryPage(FilterPageVO filterPageVO) {
+    public IPage<EntryNumDTO> entryCountGroupByEntryPage(FilterPageVO filterPageVO) {
         filterPageVOSet(filterPageVO);
-        IPage<CaseNumDTO> page = qcresultInfoFacade.entryCountGroupByEntryPage(filterPageVO);
+        IPage<EntryNumDTO> page = qcresultInfoFacade.entryCountGroupByEntryPage(filterPageVO);
         return page;
     }
 

+ 2 - 4
src/main/java/com/diagbot/mapper/QcresultInfoMapper.java

@@ -3,8 +3,6 @@ package com.diagbot.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.AverageStatisticsDTO;
-import com.diagbot.dto.CaseAndDeptNumDTO;
-import com.diagbot.dto.CaseNumDTO;
 import com.diagbot.dto.DeptEntryNumDTO;
 import com.diagbot.dto.DeptNumDTO;
 import com.diagbot.dto.EntryNumDTO;
@@ -116,7 +114,7 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
      * @param filterPageVO
      * @return
      */
-    public IPage<CaseNumDTO> entryCountGroupByEntryPage(@Param("filterPageVO") FilterPageVO filterPageVO);
+    public IPage<EntryNumDTO> entryCountGroupByEntryPage(@Param("filterPageVO") FilterPageVO filterPageVO);
 
     /**
      * 各科室质控平均分(分页)
@@ -148,7 +146,7 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
      * @param filterPageByDeptVO
      * @return
      */
-    public IPage<CaseAndDeptNumDTO> entryCountGroupByEntryAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
+    public IPage<DeptEntryNumDTO> entryCountGroupByEntryAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
 
     /**
      * 条目缺陷占比(内页)

+ 2 - 4
src/main/java/com/diagbot/service/QcresultInfoService.java

@@ -3,8 +3,6 @@ package com.diagbot.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.diagbot.dto.AverageStatisticsDTO;
-import com.diagbot.dto.CaseAndDeptNumDTO;
-import com.diagbot.dto.CaseNumDTO;
 import com.diagbot.dto.DeptEntryNumDTO;
 import com.diagbot.dto.DeptNumDTO;
 import com.diagbot.dto.EntryNumDTO;
@@ -117,7 +115,7 @@ public interface QcresultInfoService extends IService<QcresultInfo> {
      * @param filterPageVO
      * @return
      */
-    public IPage<CaseNumDTO> entryCountGroupByEntryPage(@Param("filterPageVO") FilterPageVO filterPageVO);
+    public IPage<EntryNumDTO> entryCountGroupByEntryPage(@Param("filterPageVO") FilterPageVO filterPageVO);
 
     /**
      * 各科室质控平均分(分页)
@@ -149,7 +147,7 @@ public interface QcresultInfoService extends IService<QcresultInfo> {
      * @param filterPageByDeptVO
      * @return
      */
-    public IPage<CaseAndDeptNumDTO> entryCountGroupByEntryAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
+    public IPage<DeptEntryNumDTO> entryCountGroupByEntryAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
 
     /**
      * 条目缺陷占比(内页)

+ 2 - 4
src/main/java/com/diagbot/service/impl/QcresultInfoServiceImpl.java

@@ -3,8 +3,6 @@ package com.diagbot.service.impl;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.diagbot.dto.AverageStatisticsDTO;
-import com.diagbot.dto.CaseAndDeptNumDTO;
-import com.diagbot.dto.CaseNumDTO;
 import com.diagbot.dto.DeptEntryNumDTO;
 import com.diagbot.dto.DeptNumDTO;
 import com.diagbot.dto.EntryNumDTO;
@@ -152,7 +150,7 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
      * @return
      */
     @Override
-    public IPage<CaseNumDTO> entryCountGroupByEntryPage(@Param("filterPageVO") FilterPageVO filterPageVO) {
+    public IPage<EntryNumDTO> entryCountGroupByEntryPage(@Param("filterPageVO") FilterPageVO filterPageVO) {
         return baseMapper.entryCountGroupByEntryPage(filterPageVO);
     }
 
@@ -196,7 +194,7 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
      * @return
      */
     @Override
-    public IPage<CaseAndDeptNumDTO> entryCountGroupByEntryAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO) {
+    public IPage<DeptEntryNumDTO> entryCountGroupByEntryAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO) {
         return baseMapper.entryCountGroupByEntryAndDeptPage(filterPageByDeptVO);
     }
 

+ 5 - 0
src/main/java/com/diagbot/vo/FilterPageVO.java

@@ -65,4 +65,9 @@ public class FilterPageVO extends Page {
      * 单项否决
      */
     private Integer isReject;
+
+    /**
+     * 规则类型(0:无,1:空项,2:错误)
+     */
+    private Integer ruleType;
 }

+ 5 - 4
src/main/java/com/diagbot/web/ConsoleByDeptController.java

@@ -2,7 +2,6 @@ package com.diagbot.web;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.annotation.SysLogger;
-import com.diagbot.dto.CaseAndDeptNumDTO;
 import com.diagbot.dto.DeptBaseDTO;
 import com.diagbot.dto.DeptEntryNumDTO;
 import com.diagbot.dto.DeptNumDTO;
@@ -122,11 +121,13 @@ public class ConsoleByDeptController {
                     "name: 缺陷名称<br>" +
                     "deptName: 科室名称(必填)<br>" +
                     "casesId: 模块id:243=病案首页 <br>" +
-                    "casesName: 模块名称<br>")
+                    "casesName: 模块名称<br>"+
+                    "isReject: 单项否决 1-否决,0-非<br>" +
+                    "ruleType: 规则类型 0:无,1:空项,2:错误<br>")
     @PostMapping("/entryCountGroupByEntryAndDeptPage")
     @SysLogger("entryCountGroupByEntryAndDeptPage")
-    public RespDTO<IPage<CaseAndDeptNumDTO>> entryCountGroupByEntryAndDeptPage(@RequestBody @Valid FilterPageByDeptVO filterPageByDeptVO) {
-        IPage<CaseAndDeptNumDTO> data = consoleByDeptFacade.entryCountGroupByEntryAndDeptPage(filterPageByDeptVO);
+    public RespDTO<IPage<DeptEntryNumDTO>> entryCountGroupByEntryAndDeptPage(@RequestBody @Valid FilterPageByDeptVO filterPageByDeptVO) {
+        IPage<DeptEntryNumDTO> data = consoleByDeptFacade.entryCountGroupByEntryAndDeptPage(filterPageByDeptVO);
         return RespDTO.onSuc(data);
     }
 

+ 3 - 3
src/main/java/com/diagbot/web/ConsoleController.java

@@ -3,7 +3,6 @@ package com.diagbot.web;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.AverageStatisticsDTO;
-import com.diagbot.dto.CaseNumDTO;
 import com.diagbot.dto.DeptNumDTO;
 import com.diagbot.dto.EntryNumDTO;
 import com.diagbot.dto.HomePageNumDTO;
@@ -276,10 +275,11 @@ public class ConsoleController {
                     "deptName: 科室名称 <br>" +
                     "casesId: 模块id:243=病案首页 <br>" +
                     "casesName: 模块名称 <br>" +
-                    "isReject: 单项否决 1-否决,0-非<br>")
+                    "isReject: 单项否决 1-否决,0-非<br>" +
+                    "ruleType: 规则类型 0:无,1:空项,2:错误<br>")
     @PostMapping("/entryCountGroupByEntryPage")
     @SysLogger("entryCountGroupByEntryPage")
-    public RespDTO<IPage<CaseNumDTO>> entryCountGroupByEntryPage(@RequestBody @Valid FilterPageVO filterPageVO) {
+    public RespDTO<IPage<EntryNumDTO>> entryCountGroupByEntryPage(@RequestBody @Valid FilterPageVO filterPageVO) {
         return RespDTO.onSuc(consoleFacade.entryCountGroupByEntryPage(filterPageVO));
     }
 

+ 55 - 7
src/main/resources/mapper/QcresultInfoMapper.xml

@@ -975,7 +975,7 @@
     </select>
 
     <!-- 缺陷详情(分页) -->
-    <select id="entryCountGroupByEntryPage"  resultType="com.diagbot.dto.CaseNumDTO">
+    <select id="entryCountGroupByEntryPage"  resultType="com.diagbot.dto.EntryNumDTO">
         SELECT t.*
         FROM
         (SELECT
@@ -983,6 +983,8 @@
         t1.NAME,
         t1.casesId,
         t1.casesName,
+        t1.ruleType,
+        t1.isReject,
         count(*) AS num,
         t2.totleNum,
         ROUND( count(*) /t2.totleNum , 4 ) AS percent,
@@ -993,7 +995,9 @@
         e.id AS id,
         e.NAME AS NAME,
         e.cases_id as casesId,
-        e.cases_name as casesName
+        e.cases_name as casesName,
+        e.rule_type as ruleType,
+        f.is_reject as isReject
         FROM
         med_behospital_info a,
         <if test="filterPageVO.casesId != null and filterPageVO.casesId ==243">
@@ -1003,14 +1007,17 @@
             med_qcresult_info c,
         </if>
         med_qcresult_detail d,
-        qc_cases_entry e
+        qc_cases_entry e,
+        qc_cases_entry_hospital f
         WHERE
         a.is_deleted = 'N'
         AND c.is_deleted = 'N'
         AND d.is_deleted = 'N'
         and e.is_deleted='N'
+        and f.is_deleted='N'
         AND a.hospital_id = c.hospital_id
         and a.hospital_id = d.hospital_id
+        and a.hospital_id = f.hospital_id
         AND a.behospital_code = c.behospital_code
         AND a.behospital_code = d.behospital_code
         AND a.is_placefile = '1'
@@ -1019,6 +1026,7 @@
         </if>
         AND d.cases_id = e.cases_id
         AND d.cases_entry_id = e.id
+        and e.id = f.cases_entry_id
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="filterPageVO.casesId != null and filterPageVO.casesId != 0">
             AND d.cases_id = #{filterPageVO.casesId}
@@ -1041,6 +1049,12 @@
         <if test="filterPageVO.deptName != null and filterPageVO.deptName != ''">
             AND a.beh_dept_name like CONCAT('%', #{filterPageVO.deptName},'%')
         </if>
+        <if test="filterPageVO.ruleType != null">
+            AND e.rule_type = #{filterPageVO.ruleType}
+        </if>
+        <if test="filterPageVO.isReject != null">
+            AND f.is_reject = #{filterPageVO.isReject}
+        </if>
         ) t1,(
         SELECT
         count(*) AS totleNum
@@ -1053,14 +1067,17 @@
             med_qcresult_info c,
         </if>
         med_qcresult_detail d,
-        qc_cases_entry e
+        qc_cases_entry e,
+        qc_cases_entry_hospital f
         WHERE
         a.is_deleted = 'N'
         AND c.is_deleted = 'N'
         AND d.is_deleted = 'N'
         and e.is_deleted='N'
+        and f.is_deleted='N'
         AND a.hospital_id = c.hospital_id
         and a.hospital_id = d.hospital_id
+        and a.hospital_id = f.hospital_id
         AND a.behospital_code = c.behospital_code
         AND a.behospital_code = d.behospital_code
         AND a.is_placefile = '1'
@@ -1069,6 +1086,7 @@
         </if>
         AND d.cases_id = e.cases_id
         AND d.cases_entry_id = e.id
+        and e.id = f.cases_entry_id
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="filterPageVO.casesId != null and filterPageVO.casesId != 0">
             AND d.cases_id = #{filterPageVO.casesId}
@@ -1091,6 +1109,12 @@
         <if test="filterPageVO.deptName != null and filterPageVO.deptName != ''">
             AND a.beh_dept_name like CONCAT('%', #{filterPageVO.deptName},'%')
         </if>
+        <if test="filterPageVO.ruleType != null">
+            AND e.rule_type = #{filterPageVO.ruleType}
+        </if>
+        <if test="filterPageVO.isReject != null">
+            AND f.is_reject = #{filterPageVO.isReject}
+        </if>
         ) t2
         GROUP BY
         t1.id,
@@ -1324,7 +1348,7 @@
     </select>
 
     <!-- 缺陷详情-科室(分页) -->
-    <select id="entryCountGroupByEntryAndDeptPage"  resultType="com.diagbot.dto.CaseAndDeptNumDTO">
+    <select id="entryCountGroupByEntryAndDeptPage"  resultType="com.diagbot.dto.DeptEntryNumDTO">
         SELECT
         t.*
         FROM
@@ -1334,6 +1358,8 @@
         t1.NAME,
         t1.casesId,
         t1.casesName,
+        t1.ruleType,
+        t1.isReject,
         t1.deptId,
         t1.deptName,
         count(*) AS num,
@@ -1347,6 +1373,8 @@
         e.NAME,
         e.cases_id as casesId,
         e.cases_name as casesName,
+        e.rule_type as ruleType,
+        g.is_reject as isReject,
         a.beh_dept_id AS deptId,
         a.beh_dept_name AS deptName
         FROM
@@ -1359,16 +1387,19 @@
         </if>
         med_qcresult_detail d,
         qc_cases_entry e,
-        sys_user_dept f
+        sys_user_dept f,
+        qc_cases_entry_hospital g
         WHERE
         a.is_deleted = 'N'
         AND c.is_deleted = 'N'
         AND d.is_deleted = 'N'
         AND e.is_deleted = 'N'
         AND f.is_deleted = 'N'
+        AND g.is_deleted = 'N'
         AND a.hospital_id = c.hospital_id
         AND a.hospital_id = d.hospital_id
         AND a.hospital_id = f.hospital_id
+        AND a.hospital_id = g.hospital_id
         AND a.behospital_code = c.behospital_code
         AND a.behospital_code = d.behospital_code
         AND a.is_placefile = '1'
@@ -1377,6 +1408,7 @@
         </if>
         AND d.cases_id = e.cases_id
         AND d.cases_entry_id = e.id
+        AND g.cases_entry_id = e.id
         AND a.beh_dept_id = f.dept_id
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="filterPageByDeptVO.casesId != null and filterPageByDeptVO.casesId != 0">
@@ -1406,6 +1438,12 @@
         <if test="filterPageByDeptVO.doctorName != null and filterPageByDeptVO.doctorName != ''">
             AND a.doctor_name like CONCAT('%', #{filterPageByDeptVO.doctorName},'%')
         </if>
+        <if test="filterPageByDeptVO.ruleType != null ">
+            AND e.rule_type = #{filterPageByDeptVO.ruleType}
+        </if>
+        <if test="filterPageByDeptVO.isReject != null ">
+            AND g.is_reject = #{filterPageByDeptVO.isReject}
+        </if>
         ) t1,(
         SELECT
         count(*) AS totleNum
@@ -1419,16 +1457,19 @@
         </if>
         med_qcresult_detail d,
         qc_cases_entry e,
-        sys_user_dept f
+        sys_user_dept f,
+        qc_cases_entry_hospital g
         WHERE
         a.is_deleted = 'N'
         AND c.is_deleted = 'N'
         AND d.is_deleted = 'N'
         AND e.is_deleted = 'N'
         AND f.is_deleted = 'N'
+        AND g.is_deleted = 'N'
         AND a.hospital_id = c.hospital_id
         AND a.hospital_id = d.hospital_id
         AND a.hospital_id = f.hospital_id
+        AND a.hospital_id = g.hospital_id
         AND a.behospital_code = c.behospital_code
         AND a.behospital_code = d.behospital_code
         AND a.is_placefile = '1'
@@ -1437,6 +1478,7 @@
         </if>
         AND d.cases_id = e.cases_id
         AND d.cases_entry_id = e.id
+        AND g.cases_entry_id = e.id
         AND a.beh_dept_id = f.dept_id
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="filterPageByDeptVO.casesId != null and filterPageByDeptVO.casesId != 0">
@@ -1466,6 +1508,12 @@
         <if test="filterPageByDeptVO.doctorName != null and filterPageByDeptVO.doctorName != ''">
         AND a.doctor_name like CONCAT('%', #{filterPageByDeptVO.doctorName},'%')
         </if>
+        <if test="filterPageByDeptVO.ruleType != null ">
+            AND e.rule_type = #{filterPageByDeptVO.ruleType}
+        </if>
+        <if test="filterPageByDeptVO.isReject != null">
+            AND g.is_reject = #{filterPageByDeptVO.isReject}
+        </if>
         ) t2
         GROUP BY
         t1.id,