Procházet zdrojové kódy

Merge remote-tracking branch 'origin/master' into his/qq

lantone před 5 roky
rodič
revize
24f7f2b457

+ 20 - 1
doc/001.20200417第一版本/qc_init.sql

@@ -576,7 +576,7 @@ CREATE TABLE `qc_cases_entry_hospital` (
   `gmt_modified` datetime DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
   `creator` varchar(60) DEFAULT '0' COMMENT '创建人,0表示无创建人值',
   `modifier` varchar(60) DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
-  `cases_entry_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '病历id',
+  `cases_entry_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '条目ID',
   `hospital_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '医院ID',
   `score` decimal(5,1) NOT NULL DEFAULT '0.0' COMMENT '扣分值',
   `msg` varchar(1024) DEFAULT NULL COMMENT '条目提示信息',
@@ -904,3 +904,22 @@ CREATE TABLE `sys_user_role` (
   `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8 COMMENT='系统用户角色关联表';
+
+
+-- ----------------------------
+-- Table structure for qc_cases_entry_pagedata
+-- ----------------------------
+DROP TABLE IF EXISTS `qc_cases_entry_pagedata`;
+CREATE TABLE `qc_cases_entry_pagedata` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+  `cases_entry_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '条目ID',
+  `hospital_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '医院ID',
+  `page_key` varchar(255) NOT NULL DEFAULT '' COMMENT '页面数据对应的key',
+  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
+  `is_deleted` char(3) DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除',
+  `gmt_create` datetime DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
+  `gmt_modified` datetime DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
+  `creator` varchar(60) DEFAULT '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(60) DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='质控条目对应页面数据映射表';

+ 1 - 1
src/main/java/com/diagbot/dto/AnalyzeDTO.java

@@ -16,7 +16,7 @@ import java.util.Date;
 public class AnalyzeDTO {
     // 病历id
     private String behospitalCode;
-    //得分
+    //是否成功
     private Boolean isSuccess;
     //得分
     private BigDecimal scoreRes;

+ 2 - 2
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -100,7 +100,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         }
         if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateStart() && null != behospitalPageVO.getBehosDateEnd()) {
             if (DateUtil.after(behospitalPageVO.getBehosDateStart(), behospitalPageVO.getBehosDateEnd())) {
-                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "入院时间的开始时间必须于结束时间!");
+                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "入院时间的开始时间必须于结束时间!");
             }
         }
         //出院时间
@@ -112,7 +112,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         }
         if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateStart() && null != behospitalPageVO.getLeaveHosDateEnd()) {
             if (DateUtil.after(behospitalPageVO.getLeaveHosDateStart(), behospitalPageVO.getLeaveHosDateEnd())) {
-                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "出院时间的开始时间必须于结束时间!");
+                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "出院时间的开始时间必须于结束时间!");
             }
         }
         behospitalPageVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));

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

@@ -53,7 +53,7 @@ public class ConsoleFacade {
         QueryWrapper<BehospitalInfo> behospitalInfoQueryWrapper = new QueryWrapper<>();
         behospitalInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("hospital_id", hospitalId)
-                .ge("leave_hospital_date", startDate);
+                .ge("behospital_date", startDate);
         int behospitalInfoCount = behospitalInfoFacade.count(behospitalInfoQueryWrapper);
         //病历数
         if (filterVO.getType().equals(1)) {

+ 2 - 2
src/main/java/com/diagbot/facade/QcresultInfoFacade.java

@@ -56,7 +56,7 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
         }
 
         Long hospitalId = Long.valueOf(SysUserUtils.getCurrentHospitalID());
-        //验证病历的存在性
+        //验证病历的存在性
         Integer mrcnt
                 = behospitalInfoFacade.count(
                 new QueryWrapper<BehospitalInfo>()
@@ -64,7 +64,7 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
                         .eq("hospital_id", hospitalId)
                         .eq("behospital_code", qcresultVO.getBehospitalCode()));
         if (mrcnt < 1){
-            throw new CommonException(CommonErrorCode.NOT_EXISTS, "该医院下病历号不存在!");
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "该医院下病历号不存在!");
         }
         //验证是否评估过
         Integer cnt

+ 24 - 18
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -32,36 +32,42 @@
     </resultMap>
 
     <select id="getPage" resultType="com.diagbot.dto.BehospitalInfoDTO">
-        select a.*, b.level, b.grade_type, b.score_res, b.gmt_create as grade_time, c.age from med_behospital_info a
-        LEFT JOIN med_qcresult_info b
-        on a.behospital_code = b.behospital_code and b.is_deleted = 'N'
-        left join med_home_page c
-        on a.behospital_code = c.behospital_code and c.is_deleted = 'N'
-        where a.is_deleted = 'N'
+        select * from (
+            select a.*, ifnull(b.level,'未评分') as `level`, b.grade_type, b.score_res, b.gmt_create as grade_time, c.age from med_behospital_info a
+            LEFT JOIN med_qcresult_info b
+            on a.behospital_code = b.behospital_code and b.is_deleted = 'N'
+            left join med_home_page c
+            on a.behospital_code = c.behospital_code and c.is_deleted = 'N'
+        ) t
+        where t.is_deleted = 'N'
         <if test="name != null and name != ''">
-            and a.name like CONCAT('%',#{name},'%')
+            and t.name like CONCAT('%',#{name},'%')
         </if>
         <if test="fileCode != null and fileCode != ''">
-            and a.file_code like CONCAT('%',#{fileCode},'%')
+            and t.file_code like CONCAT('%',#{fileCode},'%')
         </if>
         <if test="hospitalId != null">
-            and a.hospital_id = #{hospitalId}
+            and t.hospital_id = #{hospitalId}
         </if>
         <if test="behospitalCode != null and behospitalCode != ''">
-            and a.behospitalCode like CONCAT('%',#{behospitalCode},'%')
+            and t.behospital_code like CONCAT('%',#{behospitalCode},'%')
         </if>
         <if test="behosDateStart != null">
-            <![CDATA[ and a.behospital_date >= #{behosDateStart}]]>
+            <![CDATA[ and t.behospital_date >= #{behosDateStart}]]>
         </if>
         <if test="behosDateEnd != null">
-            <![CDATA[ and a.behospital_date <= #{behosDateEnd}]]>
+            <![CDATA[ and t.behospital_date <= #{behosDateEnd}]]>
         </if>
         <if test="leaveHosDateStart != null">
-            <![CDATA[ and a.leave_hospital_date >= #{leaveHosDateStart}]]>
+            <![CDATA[ and t.leave_hospital_date >= #{leaveHosDateStart}]]>
         </if>
         <if test="leaveHosDateEnd != null">
-            <![CDATA[ and a.leave_hospital_date <= #{leaveHosDateEnd}]]>
+            <![CDATA[ and t.leave_hospital_date <= #{leaveHosDateEnd}]]>
         </if>
+        <if test="level != null and level != ''">
+            and t.level = #{level}
+        </if>
+        order by t.behospital_date desc
     </select>
 
     <select id="getMsg" resultType="com.diagbot.dto.MsgDTO">
@@ -107,7 +113,7 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= #{startDate}]]>
+            <![CDATA[ and a.behospital_date >= #{startDate}]]>
         </if>
         GROUP BY
         c.msg
@@ -133,7 +139,7 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= #{startDate}]]>
+            <![CDATA[ and a.behospital_date >= #{startDate}]]>
         </if>
         ) t2
         )
@@ -171,7 +177,7 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= #{startDate}]]>
+            <![CDATA[ and a.behospital_date >= #{startDate}]]>
         </if>
         GROUP BY
         a.beh_dept_id,
@@ -198,7 +204,7 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= #{startDate}]]>
+            <![CDATA[ and a.behospital_date >= #{startDate}]]>
         </if>
         ) t2
         )

+ 2 - 2
src/main/resources/mapper/HomePageMapper.xml

@@ -158,7 +158,7 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= #{startDate}]]>
+            <![CDATA[ and a.behospital_date >= #{startDate}]]>
         </if>
         GROUP BY
         a.beh_dept_id,
@@ -187,7 +187,7 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= #{startDate}]]>
+            <![CDATA[ and a.behospital_date >= #{startDate}]]>
         </if>
         GROUP BY
         a.beh_dept_id,

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

@@ -21,7 +21,7 @@
     <!-- 缺陷排行列表 -->
     <select id="getQcresultSelectively"  parameterType="com.diagbot.vo.QcresultFilterVO" resultType="int">
         SELECT
-        count(*)
+        count(1)
         FROM
         med_behospital_info a,
         med_qcresult_info b