Explorar el Código

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

# Conflicts:
#	src/main/java/com/diagbot/config/ResourceServerConfigurer.java
#	src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
zhaops hace 5 años
padre
commit
6d89388527

+ 1 - 3
doc/006.20200602数据导入/qc_init.sql

@@ -2,6 +2,4 @@ use `qc`;
 
 INSERT INTO `qc_mode` (`id`, `name`, `order_no`, `parent_id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `remark`) VALUES ('56', '日常病程录', '210', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', NULL);
 
-delete from sys_dictionary_info where group_type = 0 and is_deleted = 'Y';
-INSERT INTO `sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('286', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '12', '日常病程录', '56', '1', '286', '所属模块');
-alter table med_medical_record add COLUMN `status` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '模板处理状态(0:未处理,1:已处理)' AFTER `rec_title`;
+delete from sys_dictionary_info where group_type = 0 and is_deleted = 'Y';

+ 13 - 1
doc/006.20200604v1.3.1/qc_initv1.3.1.sql

@@ -16,8 +16,20 @@ use `qc`;
 -- 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;
 
+ALTER TABLE `med_behospital_info` ADD INDEX `idx_leave_hospital_date` (`leave_hospital_date`) USING BTREE;
+ALTER TABLE `qc_cases_entry_hospital` ADD INDEX `idx_hospital_id` (`hospital_id`) USING BTREE;
+
+
 ALTER TABLE `med_record_type` ADD `is_deleted` char(1) NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除' AFTER `remark`;
 ALTER TABLE `med_record_type` ADD `gmt_create` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间' AFTER `is_deleted`;
 ALTER TABLE `med_record_type` ADD `gmt_modified` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改' AFTER `gmt_create`;
 ALTER TABLE `med_record_type` ADD `creator` varchar(20) NOT NULL DEFAULT '0' COMMENT '创建人,0表示无创建人值' AFTER `gmt_modified`;
-ALTER TABLE `med_record_type` ADD `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改' AFTER `creator`;
+ALTER TABLE `med_record_type` ADD `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改' AFTER `creator`;
+
+INSERT INTO `sys_menu` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ('33', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '单项否决占比', '17', 'YH-ZKK-DXFZZB_XQ', '1', '1', '10', '用户-质控科-单项否决占比_详情');
+
+INSERT INTO `sys_role_menu` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '33', '用户-质控科-单项否决占比_详情');
+
+INSERT INTO `qc_mode` (`id`, `name`, `order_no`, `parent_id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `remark`) VALUES ('56', '日常病程录', '210', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', NULL);
+
+delete from sys_dictionary_info where group_type = 0 and is_deleted = 'Y';

+ 3 - 0
doc/007.20200608v1.2.3/qc_initv1.2.3.sql

@@ -0,0 +1,3 @@
+use `qc`;
+
+UPDATE `sys_task_cron` SET `id`='-1', `is_deleted`='N', `gmt_create`='1970-01-01 12:00:00', `gmt_modified`='1970-01-01 12:00:00', `creator`='0', `modifier`='0', `cron_code`='TASK_CX', `cron`='0 0 4 * * ?', `param`='1', `is_used`='1', `remark`='每天早上自动评分当天外的未评分的数据、同时强制质控出院日期推前四天的数据' WHERE (`id`='-1');

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

@@ -69,6 +69,9 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/console/entryRejectPercent").permitAll()
                 .antMatchers("/qc/abnormal/getQcAnnormalMode").permitAll()
                 .antMatchers("/console/qcResultLevelPercent").permitAll()
+                .antMatchers("/qc/dataimport/import").permitAll()
+                .antMatchers("/qc/dataimport/dataimportPrepare").permitAll()
+                .antMatchers("/qc/dataimport/test").permitAll()
                 .antMatchers("/**").authenticated();
 //                .antMatchers("/**").permitAll();
     }

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

@@ -107,11 +107,15 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/behospitalInfo/exportExcel", request)
                 || matchers("/qc/dataimport/import", request)
                 || matchers("/qc/dataimport/test", request)
+                || matchers("/qc/behospitalInfo/exportExcel", request)
                 || matchers("/qc/behospitalInfo/exportQcresult", request)
                 || matchers("/qc/behospitalInfo/exportQcresultByDept", request)
                 || matchers("/console/entryRejectPercent", request)
                 || matchers("/qc/abnormal/getQcAnnormalMode", request)
                 || matchers("/console/qcResultLevelPercent", request)
+                || matchers("/qc/dataimport/import", request)
+                || matchers("/qc/dataimport/dataimportPrepare", request)
+                || matchers("/qc/dataimport/test", request)
                 || matchers("/", request)) {
             return true;
         }

+ 14 - 6
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -402,12 +402,20 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("behospital_code", analyzeVO.getBehospitalCode())
                 .eq("hospital_id", hospitalId)
-                .in("mode_id", Arrays.asList(53, 54))
+                .in("mode_id", Arrays.asList(53, 54, 16))
                 .orderByAsc("rec_date")
         );
         List<MedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(recordList, MedicalRecordDTO.class);
         Map<Long, List<MedicalRecordDTO>> recordMap = EntityUtil.makeEntityListMap(medicalRecordDTOList, "modeId");
-        pageMap.put("知情同意书", recordMap.get(53L));
+        List<MedicalRecordDTO> recordDTOList = new ArrayList<>();
+        if (recordMap.get(53L) != null) {
+            recordDTOList.addAll(recordMap.get(53L)); // 知情同意书
+        }
+        if (recordMap.get(16L) != null) {
+            recordDTOList.addAll(recordMap.get(16L)); // 手术知情同意书
+        }
+        // 知情同意书 = 【知情同意书】 + 【手术知情同意书】
+        pageMap.put("知情同意书", recordDTOList);
         pageMap.put("谈话告知书", recordMap.get(54L));
 
         String pageData = JSON.toJSONString(pageMap);
@@ -697,15 +705,15 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
     public void execute(TaskVO taskVO, String param) {
         // 处理医院信息
         dealTaskVO(param, taskVO);
-        // 类型过滤(1:出院时间比当前时间早3天前的病历(例如:长兴病历))
+        // 类型过滤(1:出院时间比当前时间早4天前的病历(例如:长兴病历))
         if (taskVO.getType() != null && taskVO.getType() == 1) {
-            Date date = DateUtil.addDay(DateUtil.now(), -3);
+            Date date = DateUtil.addDay(DateUtil.now(), -4);
             taskVO.setLeaveDate(date);
         }
         // 近3天不含当天的病历强制评分更新
         if (taskVO != null && ListUtil.isNotEmpty(taskVO.getIndividuation()) && taskVO.getIndividuation().contains(1)) {
-            // 3天前最早时间
-            taskVO.setStartLeaveDate(DateUtil.getFirstTimeOfDay(DateUtil.addDay(DateUtil.now(), -3)));
+            // 4天前最早时间
+            taskVO.setStartLeaveDate(DateUtil.getFirstTimeOfDay(DateUtil.addDay(DateUtil.now(), -4)));
             // 昨天最迟时间
             taskVO.setEndLeaveDate(DateUtil.getLastTimeOfDay(DateUtil.addDay(DateUtil.now(), -1)));
         }

+ 1 - 1
src/main/java/com/diagbot/facade/ConsoleByDeptFacade.java

@@ -718,7 +718,7 @@ public class ConsoleByDeptFacade {
         String errorPercentStr
                 = df.format(BigDecimal.valueOf(errorPercent).multiply(BigDecimal.valueOf(100))) + "%";
 
-        item.setDeptName(deptName);
+        item.setDoctorName(deptName);
         item.setEntryNum(entryNum);
         item.setMrNum(mrNum);
         item.setTotleValue(totleValue);

+ 194 - 0
src/main/java/com/diagbot/facade/DataImportFacade.java

@@ -10,6 +10,7 @@ import com.diagbot.entity.HomePage;
 import com.diagbot.entity.MedCrisisInfo;
 import com.diagbot.entity.MedicalRecord;
 import com.diagbot.entity.MedicalRecordContent;
+import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.BehospitalInfoService;
@@ -266,6 +267,199 @@ public class DataImportFacade {
     }
 
 
+    /**
+     * 数据导入【效率低,备用】
+     *
+     * @param dataImportVO
+     * @return
+     */
+    public Boolean dataImportPrepareFacade(DataImportVO dataImportVO) {
+        Long hospitalId = dataImportVO.getHospitalId();
+        // 病历信息导入
+        List<BehospitalInfo> behospitalInfoList = dataImportVO.getBehospitalInfoList();
+        if (ListUtil.isNotEmpty(behospitalInfoList)) {
+            behospitalInfoList.forEach(s -> {
+                QueryWrapper<BehospitalInfo> queryWrapper = new QueryWrapper<>();
+                queryWrapper.eq("behospital_code", s.getBehospitalCode());
+                queryWrapper.eq("hospital_id", s.getHospitalId());
+                queryWrapper.eq("is_deleted", IsDeleteEnum.N);
+                // 姓名加密
+                if (StringUtil.isNotBlank(s.getName())) {
+                    s.setName(s.getName().substring(0, 1) + "**");
+                }
+                int count = behospitalInfoService.count(queryWrapper);
+                if (count > 0) {
+                    behospitalInfoService.update(s, queryWrapper);
+                } else {
+                    behospitalInfoService.save(s);
+                }
+            });
+        }
+
+        // 危急值信息
+        List<MedCrisisInfo> medCrisisInfoList = dataImportVO.getMedCrisisInfoList();
+        if (ListUtil.isNotEmpty(medCrisisInfoList)) {
+            medCrisisInfoList.forEach(s -> {
+                QueryWrapper<MedCrisisInfo> queryWrapper = new QueryWrapper<>();
+                queryWrapper.eq("rec_id", s.getRecId());
+                queryWrapper.eq("hospital_id", s.getHospitalId());
+                queryWrapper.eq("behospital_code", s.getBehospitalCode());
+                queryWrapper.eq("rec_type", s.getRecType());
+                int count = medCrisisInfoService.count(queryWrapper);
+                if (count > 0) {
+                    medCrisisInfoService.update(s, queryWrapper);
+                } else {
+                    medCrisisInfoService.save(s);
+                }
+            });
+        }
+
+        // 病人医嘱
+        List<DoctorAdvice> doctorAdviceList = dataImportVO.getDoctorAdviceList();
+        if (ListUtil.isNotEmpty(doctorAdviceList)) {
+            doctorAdviceList.forEach(s -> {
+                QueryWrapper<DoctorAdvice> queryWrapper = new QueryWrapper<>();
+                queryWrapper.eq("doctor_advice_id", s.getDoctorAdviceId());
+                queryWrapper.eq("hospital_id", s.getHospitalId());
+                queryWrapper.eq("is_deleted",IsDeleteEnum.N);
+                int count = doctorAdviceService.count(queryWrapper);
+                if (count > 0) {
+                    doctorAdviceService.update(s, queryWrapper);
+                } else {
+                    doctorAdviceService.save(s);
+                }
+            });
+        }
+
+        // 病案首页诊断
+        List<HomeDiagnoseInfo> homeDiagnoseInfoList = dataImportVO.getHomeDiagnoseInfoList();
+        if (ListUtil.isNotEmpty(homeDiagnoseInfoList)) {
+            homeDiagnoseInfoList.forEach(s -> {
+                QueryWrapper<HomeDiagnoseInfo> queryWrapper = new QueryWrapper<>();
+                queryWrapper.eq("home_page_id", s.getHomePageId());
+                queryWrapper.eq("hospital_id", s.getHospitalId());
+                queryWrapper.eq("diagnose_order_no", s.getDiagnoseOrderNo());
+                int count = homeDiagnoseInfoService.count(queryWrapper);
+                if (count > 0) {
+                    homeDiagnoseInfoService.update(s, queryWrapper);
+                } else {
+                    homeDiagnoseInfoService.save(s);
+                }
+            });
+        }
+
+        // 病案首页
+        List<HomePage> homePageList = dataImportVO.getHomePageList();
+        if (ListUtil.isNotEmpty(homePageList)) {
+            homePageList.stream().forEach(s -> {
+                // 姓名
+                if (StringUtil.isNotBlank(s.getName())) {
+                    s.setName(s.getName().substring(0, 1) + "**");
+                }
+                // 身份证
+                if (StringUtil.isNotBlank(s.getIdentityCardNo())) {
+                    s.setIdentityCardNo(s.getIdentityCardNo().substring(0, 1) + "*****************");
+                }
+                // 现住址电话
+                if (StringUtil.isNotBlank(s.getCurPhone())) {
+                    s.setCurPhone(s.getCurPhone().substring(0, 1) + "**");
+                }
+                // 工作单位电话
+                if (StringUtil.isNotBlank(s.getWorkPhone())) {
+                    s.setWorkPhone(s.getWorkPhone().substring(0, 1) + "**");
+                }
+                // 联系人姓名
+                if (StringUtil.isNotBlank(s.getContactName())) {
+                    s.setContactName(s.getContactName().substring(0, 1) + "**");
+                }
+                // 联系人电话
+                if (StringUtil.isNotBlank(s.getContactPhone())) {
+                    s.setContactPhone(s.getContactPhone().substring(0, 1) + "**");
+                }
+
+                QueryWrapper<HomePage> queryWrapper = new QueryWrapper<>();
+                queryWrapper.eq("home_page_id", s.getHomePageId());
+                queryWrapper.eq("hospital_id", s.getHospitalId());
+                queryWrapper.eq("behospital_code", s.getBehospitalCode());
+                queryWrapper.eq("is_deleted",IsDeleteEnum.N);
+                int count = homePageService.count(queryWrapper);
+                if (count > 0) {
+                    homePageService.update(s, queryWrapper);
+                } else {
+                    homePageService.save(s);
+                }
+            });
+        }
+
+        // 病案首页手术信息
+        List<HomeOperationInfo> homeOperationInfoList = dataImportVO.getHomeOperationInfoList();
+        if (ListUtil.isNotEmpty(homeOperationInfoList)) {
+            homeOperationInfoList.forEach(s -> {
+                if(s.getHomePageId()!=null && !"".equals(s.getOperationOrderNo())) {
+                    QueryWrapper<HomeOperationInfo> queryWrapper = new QueryWrapper<>();
+                    queryWrapper.eq("home_page_id", s.getHomePageId());
+                    queryWrapper.eq("hospital_id", s.getHospitalId());
+                    queryWrapper.eq("operation_order_no", s.getOperationOrderNo());
+                    int count = homeOperationInfoService.count(queryWrapper);
+                    if (count > 0) {
+                        homeOperationInfoService.update(s, queryWrapper);
+                    } else {
+                        homeOperationInfoService.save(s);
+                    }
+                }
+            });
+        }
+
+        // 文书信息
+        List<MedicalRecord> medicalRecordList = dataImportVO.getMedicalRecordList();
+        if (ListUtil.isNotEmpty(medicalRecordList)) {
+            medicalRecordList.forEach(s -> {
+                QueryWrapper<MedicalRecord> queryWrapper = new QueryWrapper<>();
+                queryWrapper.eq("rec_id", s.getRecId());
+                queryWrapper.eq("hospital_id", s.getHospitalId());
+                queryWrapper.eq("is_deleted",IsDeleteEnum.N);
+                int count = medicalRecordService.count(queryWrapper);
+                if (count > 0) {
+                    medicalRecordService.update(s, queryWrapper);
+                } else {
+                    medicalRecordService.save(s);
+                }
+            });
+        }
+
+        // 文书明细信息
+        List<MedicalRecordContent> medicalRecordContentList = dataImportVO.getMedicalRecordContentList();
+        if (ListUtil.isNotEmpty(medicalRecordContentList)) {
+            // 加密数据
+            if (encryptFlag) {
+                String recId = "";
+                try {
+                    EncrypDES encrypDES = new EncrypDES();
+                    for (MedicalRecordContent s : medicalRecordContentList) {
+                        recId = s.getRecId();
+                        if (StringUtil.isNotBlank(s.getXmlText())) {
+                            s.setXmlText(encrypDES.encrytor(s.getXmlText()));
+                        }
+                        QueryWrapper<MedicalRecordContent> queryWrapper = new QueryWrapper<>();
+                        queryWrapper.eq("rec_id", s.getRecId());
+                        queryWrapper.eq("hospital_id", s.getHospitalId());
+                        queryWrapper.eq("is_deleted",IsDeleteEnum.N);
+                        int count = medicalRecordContentService.count(queryWrapper);
+                        if (count > 0) {
+                            medicalRecordContentService.update(s, queryWrapper);
+                        } else {
+                            medicalRecordContentService.save(s);
+                        }
+                    }
+                } catch (Exception e) {
+                    throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "加密xml错误!recId=【" + recId + "】");
+                }
+            }
+        }
+        return true;
+    }
+
+
     /**
      * 模拟测试数据
      *

+ 28 - 1
src/main/java/com/diagbot/web/DataImportController.java

@@ -32,7 +32,7 @@ public class DataImportController {
     @Autowired
     DataImportFacade dataImportFacade;
 
-    @ApiOperation(value = "导入数据[by:zhoutg]",
+    @ApiOperation(value = "导入数据【全部删除,全部新增,效率高】[by:zhoutg]",
             notes = "// 医院ID\n" +
                     " Long hospitalId;\n" +
                     "// 病历信息\n" +
@@ -59,6 +59,33 @@ public class DataImportController {
         return RespDTO.onSuc(data);
     }
 
+    @ApiOperation(value = "导入数据【更新数据,单条执行,效率低,备用】[by:zhoutg]",
+            notes = "// 医院ID\n" +
+                    " Long hospitalId;\n" +
+                    "// 病历信息\n" +
+                    "List<BehospitalInfo> behospitalInfoList;\n" +
+                    "// 危急值信息\n" +
+                    "List<MedCrisisInfo> medCrisisInfoList;\n" +
+                    "// 病人医嘱\n" +
+                    "List<DoctorAdvice> doctorAdviceList;\n" +
+                    "// 病案首页诊断\n" +
+                    "List<HomeDiagnoseInfo> homeDiagnoseInfoList;\n" +
+                    "// 病案首页\n" +
+                    "List<HomePage> homePageList;\n" +
+                    "// 病案首页手术信息\n" +
+                    "List<HomeOperationInfo> homeOperationInfoList;\n" +
+                    "// 文书信息\n" +
+                    "List<MedicalRecord> medicalRecordList;\n" +
+                    "// 文书明细信息\n" +
+                    "List<MedicalRecordContent> medicalRecordContentList;")
+    @PostMapping("/dataimportPrepare")
+    @SysLogger("dataimportPrepare")
+    @Transactional
+    public RespDTO<Boolean> dataimportPrepare(@RequestBody @Valid DataImportVO dataImportVO) {
+        Boolean data = dataImportFacade.dataImportPrepareFacade(dataImportVO);
+        return RespDTO.onSuc(data);
+    }
+
     @ApiOperation(value = "模拟测试数据[by:zhoutg]",
             notes = "")
     @PostMapping("/test")

+ 29 - 9
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -92,6 +92,7 @@
             and t.is_placefile = #{isPlacefile}
         </if>
         and t.qc_type_id != 0
+        and t.is_placefile = 1
     </select>
 
     <select id="getMsg" resultType="com.diagbot.dto.MsgDTO">
@@ -200,6 +201,7 @@
         select * from med_behospital_info a
         where a.is_deleted = 'N'
         and a.qc_type_id != 0
+        and a.is_placefile = 1
         <if test="filterFlag != null and filterFlag == 0">
             and
             not EXISTS (
@@ -227,6 +229,7 @@
             select * from med_behospital_info b
             where b.is_deleted = 'N'
             and b.qc_type_id != 0
+            and b.is_placefile = 1
             <if test="startLeaveDate != null">
                 <![CDATA[ and b.leave_hospital_date >= #{startLeaveDate}]]>
             </if>
@@ -313,6 +316,7 @@
             and t.is_placefile = #{isPlacefile}
         </if>
         and t.qc_type_id != 0
+        and t.is_placefile = 1
     </select>
 
     <!--质控评分(个人)分页-->
@@ -383,6 +387,7 @@
             and t.is_placefile = #{isPlacefile}
         </if>
         and t.qc_type_id != 0
+        and t.is_placefile = 1
     </select>
 
     <!-- 出院总人数统计-全院-首页 -->
@@ -1657,8 +1662,8 @@
         FROM
         (
         SELECT
-        a.doctor_id AS doctorId,
-        a.doctor_name AS doctorName,
+        CASE WHEN a.doctor_id is NULL OR a.doctor_id ='' THEN '未知' ELSE a.doctor_id END AS doctorId,
+        CASE WHEN a.doctor_name is NULL OR a.doctor_name ='' THEN '未知' ELSE a.doctor_name END AS doctorName,
         count( DISTINCT a.behospital_code ) AS mrNum,
         ROUND( sum( CAST( c.score_res AS DECIMAL ( 18, 2 )) ), 2 ) AS totleValue,
         ROUND( sum( CAST( c.score_res AS DECIMAL ( 18, 2 )) )/ count(*), 2 ) AS averageValue,
@@ -1701,7 +1706,12 @@
             and c.level = #{level}
         </if>
         <if test="name != null and name != ''">
-            and a.doctor_name like CONCAT('%',#{name},'%')
+            <if test="name == '未知'">
+                and (a.doctor_name is null or a.doctor_name='')
+            </if>
+            <if test="name != '未知'">
+                and a.doctor_name like CONCAT('%',#{name},'%')
+            </if>
         </if>
         <if test="userId!=null and userId !=''">
             AND f.user_id = #{userId}
@@ -1715,8 +1725,8 @@
         ) t1,
         (
         SELECT
-        a.doctor_id AS doctorId,
-        a.doctor_name AS doctorName,
+        CASE WHEN a.doctor_id is NULL OR a.doctor_id ='' THEN '未知' ELSE a.doctor_id END AS doctorId,
+        CASE WHEN a.doctor_name is NULL OR a.doctor_name ='' THEN '未知' ELSE a.doctor_name END AS doctorName,
         count( * ) AS entryNum
         FROM
         med_behospital_info a,
@@ -1754,7 +1764,12 @@
             and c.level = #{level}
         </if>
         <if test="name != null and name != ''">
-            and a.doctor_name like CONCAT('%',#{name},'%')
+            <if test="name == '未知'">
+                and (a.doctor_name is null or a.doctor_name='')
+            </if>
+            <if test="name != '未知'">
+                and a.doctor_name like CONCAT('%',#{name},'%')
+            </if>
         </if>
         <if test="userId!=null and userId !=''">
             AND f.user_id = #{userId}
@@ -1781,8 +1796,8 @@
         FROM
         (
         SELECT
-        a.doctor_id AS doctorId,
-        a.doctor_name AS doctorName,
+        CASE WHEN a.doctor_id is NULL OR a.doctor_id ='' THEN '未知' ELSE a.doctor_id END AS doctorId,
+        CASE WHEN a.doctor_name is NULL OR a.doctor_name ='' THEN '未知' ELSE a.doctor_name END AS doctorName,
         sum( d.rule_type = 1 ) AS emptyNum,
         round( sum( d.rule_type = 2 )/ 2, 0 ) AS errorNum,
         count( DISTINCT a.behospital_code ) AS mrNum
@@ -1821,7 +1836,12 @@
             and b.level = #{level}
         </if>
         <if test="name != null and name != ''">
-            and a.doctor_name like CONCAT('%',#{name},'%')
+            <if test="name == '未知'">
+                and (a.doctor_name is null or a.doctor_name='')
+            </if>
+            <if test="name != '未知'">
+                and a.doctor_name like CONCAT('%',#{name},'%')
+            </if>
         </if>
         <if test="userId!=null and userId !=''">
             AND e.user_id = #{userId}

+ 12 - 12
src/main/resources/mapper/QcresultInfoMapper.xml

@@ -289,7 +289,7 @@
         e.cases_name AS casesName,
         count(*) AS num,
         f.score,
-        f.is_reject AS isReject
+        d.is_reject AS isReject
         FROM
         med_behospital_info a,
         med_qcresult_info c,
@@ -328,7 +328,7 @@
             AND e.cases_name = #{filterPageVO.casesName}
         </if>
         <if test="filterPageVO.isReject != null">
-            AND f.is_reject = #{filterPageVO.isReject}
+            AND d.is_reject = #{filterPageVO.isReject}
         </if>
         GROUP BY
         e.id,
@@ -384,7 +384,7 @@
         e.cases_name AS casesName,
         count(*) AS num,
         f.score,
-        f.is_reject AS isReject
+        d.is_reject AS isReject
         FROM
         med_behospital_info a,
         med_qcresult_info c,
@@ -406,7 +406,7 @@
         AND d.cases_entry_id = e.id
         AND e.id = f.cases_entry_id
         AND a.is_placefile = '1'
-        AND f.is_reject = 1
+        AND d.is_reject = 1
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -752,7 +752,7 @@
         e.cases_name AS casesName,
         count(*) AS num,
         g.score,
-        g.is_reject AS isReject
+        d.is_reject AS isReject
         FROM
         med_behospital_info a,
         med_qcresult_info c,
@@ -801,7 +801,7 @@
             AND e.cases_name = #{filterPageByDeptVO.casesName}
         </if>
         <if test="filterPageByDeptVO.isReject != null">
-            AND g.is_reject = #{filterPageByDeptVO.isReject}
+            AND d.is_reject = #{filterPageByDeptVO.isReject}
         </if>
         GROUP BY
         e.id,
@@ -997,7 +997,7 @@
         e.cases_id as casesId,
         e.cases_name as casesName,
         e.rule_type as ruleType,
-        f.is_reject as isReject
+        d.is_reject as isReject
         FROM
         med_behospital_info a,
         <if test="filterPageVO.casesId != null and filterPageVO.casesId ==243">
@@ -1053,7 +1053,7 @@
             AND e.rule_type = #{filterPageVO.ruleType}
         </if>
         <if test="filterPageVO.isReject != null">
-            AND f.is_reject = #{filterPageVO.isReject}
+            AND d.is_reject = #{filterPageVO.isReject}
         </if>
         ) t1,(
         SELECT
@@ -1113,7 +1113,7 @@
             AND e.rule_type = #{filterPageVO.ruleType}
         </if>
         <if test="filterPageVO.isReject != null">
-            AND f.is_reject = #{filterPageVO.isReject}
+            AND d.is_reject = #{filterPageVO.isReject}
         </if>
         ) t2
         GROUP BY
@@ -1374,7 +1374,7 @@
         e.cases_id as casesId,
         e.cases_name as casesName,
         e.rule_type as ruleType,
-        g.is_reject as isReject,
+        d.is_reject as isReject,
         a.beh_dept_id AS deptId,
         a.beh_dept_name AS deptName
         FROM
@@ -1442,7 +1442,7 @@
             AND e.rule_type = #{filterPageByDeptVO.ruleType}
         </if>
         <if test="filterPageByDeptVO.isReject != null ">
-            AND g.is_reject = #{filterPageByDeptVO.isReject}
+            AND d.is_reject = #{filterPageByDeptVO.isReject}
         </if>
         ) t1,(
         SELECT
@@ -1512,7 +1512,7 @@
             AND e.rule_type = #{filterPageByDeptVO.ruleType}
         </if>
         <if test="filterPageByDeptVO.isReject != null">
-            AND g.is_reject = #{filterPageByDeptVO.isReject}
+            AND d.is_reject = #{filterPageByDeptVO.isReject}
         </if>
         ) t2
         GROUP BY