Explorar el Código

Merge remote-tracking branch 'origin/dev/20200603_1.3.1' into debug

zhaops hace 5 años
padre
commit
14c1077399

+ 8 - 0
doc/006.20200604v1.3.1/qc_initv1.3.1.sql

@@ -7,3 +7,11 @@ INSERT INTO `sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modifi
 INSERT INTO `sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('287', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '14', '无', '0', '1', '1', '质控错误类型');
 INSERT INTO `sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('288', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '14', '空项', '1', '1', '2', '质控错误类型');
 INSERT INTO `sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('289', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '14', '错误', '2', '1', '3', '质控错误类型');
+
+
+ALTER TABLE `med_qcresult_detail` ADD INDEX `idx_cases_entry_id` (`cases_entry_id`) USING BTREE;
+ALTER TABLE `med_qcresult_detail` ADD INDEX `idx_cases_id` (`cases_id`) USING BTREE;
+
+ALTER TABLE `qc_cases_entry_hospital` ADD INDEX `idx_cases_entry_id` (`cases_entry_id`) USING BTREE;
+ALTER TABLE `qc_cases_entry_hospital` ADD INDEX `idx_is_reject` (`is_reject`) USING BTREE;
+

+ 1 - 0
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -68,6 +68,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qc/behospitalInfo/exportQcresultByDept").permitAll()
                 .antMatchers("/console/entryRejectPercent").permitAll()
                 .antMatchers("/qc/abnormal/getQcAnnormalMode").permitAll()
+                .antMatchers("/console/qcResultLevelPercent").permitAll()
                 .antMatchers("/**").authenticated();
 //                .antMatchers("/**").permitAll();
     }

+ 1 - 0
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -111,6 +111,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/behospitalInfo/exportQcresultByDept", request)
                 || matchers("/console/entryRejectPercent", request)
                 || matchers("/qc/abnormal/getQcAnnormalMode", request)
+                || matchers("/console/qcResultLevelPercent", request)
                 || matchers("/", request)) {
             return true;
         }

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

@@ -0,0 +1,35 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/6/5 14:26
+ */
+@Getter
+@Setter
+public class DeptEntryNumDTO {
+    private Long id;
+    /**
+     * 条目名称
+     */
+    private String name;
+    private Long casesId;
+    /**
+     * 模块名称
+     */
+    private String casesName;
+    private String deptId;
+    /**
+     * 科室名称
+     */
+    private String deptName;
+    private Integer totleNum;
+    private Integer num;
+    private Double percent;
+    private String percentStr;
+    private Double score;
+    private Integer isReject;
+}

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

@@ -3,6 +3,7 @@ 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;
 import com.diagbot.dto.LevelStatisticsDTO;
 import com.diagbot.dto.NumDTO;
@@ -527,7 +528,7 @@ public class ConsoleByDeptFacade {
      * @param filterPageByDeptVO
      * @return
      */
-    public IPage<DeptNumDTO> entryGroupByEntryAndDeptInnerPage(FilterPageByDeptVO filterPageByDeptVO) {
+    public IPage<DeptEntryNumDTO> entryGroupByEntryAndDeptInnerPage(FilterPageByDeptVO filterPageByDeptVO) {
         if (StringUtil.isBlank(filterPageByDeptVO.getDeptName())) {
             List<DeptBaseDTO> deptList = this.getDept();
             //默认取第一个科室
@@ -536,7 +537,7 @@ public class ConsoleByDeptFacade {
             }
         }
         filterPageByDeptVOSet(filterPageByDeptVO);
-        IPage<DeptNumDTO> page = qcresultInfoFacade.entryGroupByEntryAndDeptInnerPage(filterPageByDeptVO);
+        IPage<DeptEntryNumDTO> page = qcresultInfoFacade.entryGroupByEntryAndDeptInnerPage(filterPageByDeptVO);
         return page;
     }
 

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

@@ -6,6 +6,7 @@ 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.LevelStatisticsDTO;
 import com.diagbot.dto.NumDTO;
@@ -14,6 +15,7 @@ import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.util.DateUtil;
 import com.diagbot.util.ListUtil;
+import com.diagbot.util.StringUtil;
 import com.diagbot.util.SysUserUtils;
 import com.diagbot.vo.FilterOrderVO;
 import com.diagbot.vo.FilterPageByAverageVO;
@@ -317,6 +319,30 @@ public class ConsoleFacade {
         return retList;
     }
 
+    /**
+     * 各科室甲/乙/丙级病历占比
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<DeptNumDTO> qcResultLevelPercent(FilterVO filterVO) {
+        if (StringUtil.isBlank(filterVO.getLevel())) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入病历等级");
+        }
+        List<DeptNumDTO> retList = Lists.newLinkedList();
+        filterVOSet(filterVO);
+        Integer limitCount = filterVO.getLimitCount();
+        List<DeptNumDTO> numDTOList = qcresultInfoFacade.qcResultLevelPercent(filterVO);
+        if (ListUtil.isNotEmpty(numDTOList)) {
+            if (numDTOList.size() <= limitCount) {
+                retList = numDTOList;
+            } else {
+                retList = numDTOList.subList(0, limitCount);
+            }
+        }
+        return retList;
+    }
+
     /**
      * 各科室缺陷占比
      *
@@ -512,9 +538,9 @@ public class ConsoleFacade {
      * @param filterPageVO
      * @return
      */
-    public IPage<NumDTO> entryGroupByEntryInnerPage(FilterPageVO filterPageVO) {
+    public IPage<EntryNumDTO> entryGroupByEntryInnerPage(FilterPageVO filterPageVO) {
         filterPageVOSet(filterPageVO);
-        IPage<NumDTO> page = qcresultInfoFacade.entryGroupByEntryInnerPage(filterPageVO);
+        IPage<EntryNumDTO> page = qcresultInfoFacade.entryGroupByEntryInnerPage(filterPageVO);
         return page;
     }
     //endregion-----------------------分页接口结束-------------------------------

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

@@ -5,6 +5,7 @@ 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;
 import com.diagbot.dto.NumDTO;
@@ -154,7 +155,7 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
      *
      * @return
      */
-    public IPage<NumDTO> entryGroupByEntryInnerPage(@Param("filterPageVO") FilterPageVO filterPageVO);
+    public IPage<EntryNumDTO> entryGroupByEntryInnerPage(@Param("filterPageVO") FilterPageVO filterPageVO);
 
     /**
      * 条目缺陷占比-科室(内页)
@@ -162,7 +163,7 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
      * @param filterPageByDeptVO
      * @return
      */
-    public IPage<DeptNumDTO> entryGroupByEntryAndDeptInnerPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
+    public IPage<DeptEntryNumDTO> entryGroupByEntryAndDeptInnerPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
 
     /**
      * 各科室质控平均分(首页)-根据内外科系统统计
@@ -179,4 +180,12 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
      * @return
      */
     public List<EntryNumDTO> entryRejectPercent(FilterVO filterVO);
+
+    /**
+     * 各科室甲/乙/丙级病历占比
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<DeptNumDTO> qcResultLevelPercent(FilterVO filterVO);
 }

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

@@ -5,6 +5,7 @@ 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;
 import com.diagbot.dto.NumDTO;
@@ -155,7 +156,7 @@ public interface QcresultInfoService extends IService<QcresultInfo> {
      *
      * @return
      */
-    public IPage<NumDTO> entryGroupByEntryInnerPage(@Param("filterPageVO") FilterPageVO filterPageVO);
+    public IPage<EntryNumDTO> entryGroupByEntryInnerPage(@Param("filterPageVO") FilterPageVO filterPageVO);
 
     /**
      * 条目缺陷占比-科室(内页)
@@ -163,7 +164,7 @@ public interface QcresultInfoService extends IService<QcresultInfo> {
      * @param filterPageByDeptVO
      * @return
      */
-    public IPage<DeptNumDTO> entryGroupByEntryAndDeptInnerPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
+    public IPage<DeptEntryNumDTO> entryGroupByEntryAndDeptInnerPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
 
     /**
      * 各科室质控平均分(首页)-根据内外科系统统计
@@ -180,4 +181,12 @@ public interface QcresultInfoService extends IService<QcresultInfo> {
      * @return
      */
     public List<EntryNumDTO> entryRejectPercent(FilterVO filterVO);
+
+    /**
+     * 各科室甲/乙/丙级病历占比
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<DeptNumDTO> qcResultLevelPercent(FilterVO filterVO);
 }

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

@@ -5,6 +5,7 @@ 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;
 import com.diagbot.dto.NumDTO;
@@ -205,7 +206,7 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
      * @return
      */
     @Override
-    public IPage<NumDTO> entryGroupByEntryInnerPage(@Param("filterPageVO") FilterPageVO filterPageVO) {
+    public IPage<EntryNumDTO> entryGroupByEntryInnerPage(@Param("filterPageVO") FilterPageVO filterPageVO) {
         return baseMapper.entryGroupByEntryInnerPage(filterPageVO);
     }
 
@@ -216,7 +217,7 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
      * @return
      */
     @Override
-    public IPage<DeptNumDTO> entryGroupByEntryAndDeptInnerPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO) {
+    public IPage<DeptEntryNumDTO> entryGroupByEntryAndDeptInnerPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO) {
         return baseMapper.entryGroupByEntryAndDeptInnerPage(filterPageByDeptVO);
     }
 
@@ -241,4 +242,15 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
     public List<EntryNumDTO> entryRejectPercent(FilterVO filterVO) {
         return baseMapper.entryRejectPercent(filterVO);
     }
+
+    /**
+     * 各科室甲/乙/丙级病历占比
+     *
+     * @param filterVO
+     * @return
+     */
+    @Override
+    public List<DeptNumDTO> qcResultLevelPercent(FilterVO filterVO) {
+        return baseMapper.qcResultLevelPercent(filterVO);
+    }
 }

+ 2 - 0
src/main/java/com/diagbot/vo/FilterVO.java

@@ -47,4 +47,6 @@ public class FilterVO {
      * 科室分类
      */
     private String deptClass;
+
+    private String level;
 }

+ 6 - 3
src/main/java/com/diagbot/web/ConsoleByDeptController.java

@@ -4,6 +4,7 @@ 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;
 import com.diagbot.dto.LevelStatisticsDTO;
 import com.diagbot.dto.RespDTO;
@@ -150,11 +151,13 @@ public class ConsoleByDeptController {
     @ApiOperation(value = "条目缺陷占比-内页(分页)-内页[by:zhaops]",
             notes = "type: 统计维度 1-本月,2-本年(必填)<br>" +
                     "name: 缺陷名称<br>" +
-                    "deptName: 科室名称(必填)<br>")
+                    "deptName: 科室名称(必填)<br>" +
+                    "isReject: 单项否决 1-否决,0-非<br>" +
+                    "casesName: 模块名称<br>")
     @PostMapping("/entryGroupByEntryAndDeptInnerPage")
     @SysLogger("entryGroupByEntryAndDeptInnerPage")
-    public RespDTO<IPage<DeptNumDTO>> entryGroupByEntryAndDeptInnerPage(@RequestBody @Valid FilterPageByDeptVO filterPageByDeptVO) {
-        IPage<DeptNumDTO> data = consoleByDeptFacade.entryGroupByEntryAndDeptInnerPage(filterPageByDeptVO);
+    public RespDTO<IPage<DeptEntryNumDTO>> entryGroupByEntryAndDeptInnerPage(@RequestBody @Valid FilterPageByDeptVO filterPageByDeptVO) {
+        IPage<DeptEntryNumDTO> data = consoleByDeptFacade.entryGroupByEntryAndDeptInnerPage(filterPageByDeptVO);
         return RespDTO.onSuc(data);
     }
 

+ 23 - 4
src/main/java/com/diagbot/web/ConsoleController.java

@@ -4,6 +4,7 @@ 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.LevelStatisticsDTO;
 import com.diagbot.dto.NumDTO;
@@ -124,7 +125,7 @@ public class ConsoleController {
      */
     @ApiOperation(value = "各科室质控平均分(首页)-根据内外科系统统计[by:zhaops]",
             notes = "type: 统计维度 1-本月,2-本年(必填)<br>" +
-                    "deptClass: 科室分类:内科/外科,全部不传 <br>" )
+                    "deptClass: 科室分类:内科/外科,全部不传 <br>")
     @PostMapping("/getAverageScoreByDeptClass")
     @SysLogger("getAverageScoreByDeptClass")
     public RespDTO<Map<String, Object>> getAverageScoreByDeptClass(@RequestBody @Valid FilterVO filterVO) {
@@ -194,7 +195,9 @@ public class ConsoleController {
      * @return
      */
     @ApiOperation(value = "条目缺陷占比(首页)[by:zhaops]",
-            notes = "type: 统计维度 1-本月,2-本年(必填)<br>")
+            notes = "type: 统计维度 1-本月,2-本年(必填)<br>" +
+                    "isReject: 单项否决 1-否决,0-非<br>" +
+                    "casesName: 模块名称<br>")
     @PostMapping("/entryCountGroupByEntry")
     @SysLogger("entryCountGroupByEntry")
     public RespDTO<Map<String, Object>> entryCountGroupByEntry(@RequestBody @Valid FilterVO filterVO) {
@@ -215,6 +218,21 @@ public class ConsoleController {
         return RespDTO.onSuc(consoleFacade.entryRejectPercent(filterVO));
     }
 
+    /**
+     * 单项否决缺陷占比
+     *
+     * @param filterVO
+     * @return
+     */
+    @ApiOperation(value = "各科室甲/乙/丙级病历占比(首页)[by:zhaops]",
+            notes = "type: 统计维度 1-本月,2-本年(必填)<br>" +
+                    "level: 病历等级 甲、乙、丙(必填)<br>")
+    @PostMapping("/qcResultLevelPercent")
+    @SysLogger("qcResultLevelPercent")
+    public RespDTO<List<DeptNumDTO>> qcResultLevelPercent(@RequestBody @Valid FilterVO filterVO) {
+        return RespDTO.onSuc(consoleFacade.qcResultLevelPercent(filterVO));
+    }
+
     /**
      * 各科室缺陷占比
      *
@@ -256,7 +274,8 @@ public class ConsoleController {
             notes = "type: 统计维度 1-本月,2-本年(必填)<br>" +
                     "deptName: 科室名称 <br>" +
                     "casesId: 模块id:243=病案首页 <br>" +
-                    "casesName: 模块名称 <br>")
+                    "casesName: 模块名称 <br>" +
+                    "isReject: 单项否决 1-否决,0-非<br>")
     @PostMapping("/entryCountGroupByEntryPage")
     @SysLogger("entryCountGroupByEntryPage")
     public RespDTO<IPage<CaseNumDTO>> entryCountGroupByEntryPage(@RequestBody @Valid FilterPageVO filterPageVO) {
@@ -345,7 +364,7 @@ public class ConsoleController {
             notes = "type: 统计维度 1-本月,2-本年(必填)<br>")
     @PostMapping("/entryGroupByEntryInnerPage")
     @SysLogger("entryGroupByEntryInnerPage")
-    public RespDTO<IPage<NumDTO>> entryGroupByEntryInnerPage(@RequestBody @Valid FilterPageVO filterPageVO) {
+    public RespDTO<IPage<EntryNumDTO>> entryGroupByEntryInnerPage(@RequestBody @Valid FilterPageVO filterPageVO) {
         return RespDTO.onSuc(consoleFacade.entryGroupByEntryInnerPage(filterPageVO));
     }
     //endregion-----------------------分页接口结束-------------------------------

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

@@ -115,6 +115,43 @@
         a.beh_dept_name
     </select>
 
+    <!-- 各科室甲/乙/丙级病历占比 -->
+    <select id="qcResultLevelPercent" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.DeptNumDTO">
+        SELECT
+        a.beh_dept_id AS deptId,
+        a.beh_dept_name AS deptName,
+        <if test="level != null and level != ''">
+            sum( c.`level` = #{level} ) AS num,
+            ROUND( sum( c.`level` = #{level} )/ count(*), 4 ) AS percent,
+            concat( ROUND( sum( c.`level` = #{level} )/ count(*)* 100, 2 ), '%' ) AS percentStr,
+        </if>
+        count(*) AS totleNum
+        FROM
+        med_behospital_info a,
+        med_qcresult_info c
+        WHERE
+        a.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND a.hospital_id = c.hospital_id
+        AND a.behospital_code = c.behospital_code
+        AND a.is_placefile = '1'
+        <![CDATA[AND a.qc_type_id <>0 ]]>
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="startDate != null and startDate != ''">
+            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+        </if>
+        <if test="endDate != null and endDate != ''">
+            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+        </if>
+        GROUP BY
+        a.beh_dept_id,
+        a.beh_dept_name
+        ORDER  BY
+        percent DESC
+    </select>
+
     <!-- 按模块统计质控缺陷数 -->
     <select id="entryCountGroupByCase" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.NumDTO">
         SELECT
@@ -686,15 +723,22 @@
     </select>
 
     <!-- 条目缺陷占比-科室(内页) -->
-    <select id="entryGroupByEntryAndDeptInnerPage" resultType="com.diagbot.dto.DeptNumDTO">
-        SELECT t.*
+    <select id="entryGroupByEntryAndDeptInnerPage" resultType="com.diagbot.dto.DeptEntryNumDTO">
+        SELECT
+        t.*
         FROM
-        (SELECT
+        (
+        SELECT
         t1.deptId AS deptId,
         t1.deptName AS deptName,
+        t1.id AS id,
         t1.NAME AS NAME,
+        t1.casesId AS casesId,
+        t1.casesName AS casesName,
         t1.num AS num,
         t2.mrNum AS totleNum,
+        t1.score AS score,
+        t1.isReject AS isReject,
         Round( t1.num / t2.mrNum, 4 ) AS percent,
         CONCAT( Round( t1.num / t2.mrNum * 100, 2 ), '%' ) AS percentStr
         FROM
@@ -704,26 +748,34 @@
         e.NAME,
         a.beh_dept_id AS deptId,
         a.beh_dept_name AS deptName,
-        count(*) AS num
+        e.cases_id AS casesId,
+        e.cases_name AS casesName,
+        count(*) AS num,
+        g.score,
+        g.is_reject AS isReject
         FROM
         med_behospital_info a,
         med_qcresult_info c,
         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 d.cases_id = e.cases_id
         AND d.cases_entry_id = e.id
+        AND e.id = g.cases_entry_id
         AND a.beh_dept_id = f.dept_id
         AND a.is_placefile = '1'
         <![CDATA[AND a.qc_type_id <>0 ]]>
@@ -745,11 +797,19 @@
         <if test="filterPageByDeptVO.name != null and filterPageByDeptVO.name != ''">
             AND e.name like CONCAT('%', #{filterPageByDeptVO.name},'%')
         </if>
+        <if test="filterPageByDeptVO.casesName != null and filterPageByDeptVO.casesName != ''">
+            AND e.cases_name = #{filterPageByDeptVO.casesName}
+        </if>
+        <if test="filterPageByDeptVO.isReject != null">
+            AND g.is_reject = #{filterPageByDeptVO.isReject}
+        </if>
         GROUP BY
         e.id,
         e.NAME,
         a.beh_dept_id,
-        a.beh_dept_name
+        a.beh_dept_name,
+        e.cases_id,
+        e.cases_name
         ) t1,
         (
         SELECT
@@ -770,7 +830,6 @@
         AND a.beh_dept_id = f.dept_id
         AND a.is_placefile = '1'
         <![CDATA[AND a.qc_type_id <>0 ]]>
-        <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="filterPageByDeptVO.userId!=null">
             AND f.user_id = #{filterPageByDeptVO.userId}
         </if>