Просмотр исходного кода

Merge remote-tracking branch 'origin/dev/20200624_1.3.6.2' into debug

zhaops 5 лет назад
Родитель
Сommit
baeb6ed699

+ 3 - 3
doc/011.20200619v1.3.6.1/qc_initv1.3.6.1.sql

@@ -2,7 +2,7 @@ use `qc`;
 
 -- 新增权限
 INSERT INTO `sys_permission`(`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES (100, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '关键条目缺陷占比', 'FUNC000100', '/console/entryStatistics', 'ALL', '数据报表明细-关键条目缺陷占比', NULL);
-INSERT INTO `sys_role_permission`(`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES (1655, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', -1, 100, '数据报表明细-关键条目缺陷占比');
-INSERT INTO `sys_menu_permission`(`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `menu_id`, `permission_id`, `remark`) VALUES (72, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 34, 100, '数据报表明细-关键条目缺陷占比');
+INSERT INTO `sys_role_permission`(`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', -1, 100, '数据报表明细-关键条目缺陷占比');
+INSERT INTO `sys_menu_permission`(`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `menu_id`, `permission_id`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 34, 100, '数据报表明细-关键条目缺陷占比');
 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 (34, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '关键条目缺陷占比', 17, 'YH-ZKK-GJTMQXZB', 1, 1, 10, '用户-质控科-关键条目缺陷占比');
-INSERT INTO `sys_role_menu`(`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES (826, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', -1, 34, '用户-质控科-关键条目缺陷占比');
+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, 34, '用户-质控科-关键条目缺陷占比');

+ 2 - 2
src/main/java/com/diagbot/dto/EntryStatisticsDTO.java

@@ -66,11 +66,11 @@ public class EntryStatisticsDTO {
     /**
      * 术后首程未在15分钟内完成条目id
      */
-    private Long operation15MinuteEntryId = 2166L;
+    private Long operation15MinuteEntryId = 2930L;
     /**
      * 术后首程未在15分钟内完成条目名称
      */
-    private String operation15MinuteEntryName = "术后首程未在手术结束1小时内完成";
+    private String operation15MinuteEntryName = "术后首次病程未即刻完成";
     /**
      * 术后首程未在15分钟内完成数
      */

+ 1 - 1
src/main/java/com/diagbot/vo/BehospitalPageVO.java

@@ -69,7 +69,7 @@ public class BehospitalPageVO extends Page implements Serializable {
     /**
      * 住院科室名称
      */
-    private Long deptId;
+    private String deptId;
 
     /**
      * 医生姓名

+ 3 - 3
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -3002,8 +3002,8 @@
         operationTimeNum,
         ROUND( IFNULL( operationTimeNum / operationMRNum, 0 ), 4 ) AS operationTimePercent,
         CONCAT( ROUND( IFNULL( operationTimeNum / operationMRNum, 0 ) * 100, 2 ), '%' ) AS operationTimePercentStr,
-        2166 AS operation15MinuteEntryId,
-        '术后首程未在手术结束1小时内完成' AS operation15MinuteEntryName,
+        2930 AS operation15MinuteEntryId,
+        '术后首次病程未即刻完成' AS operation15MinuteEntryName,
         operation15MinuteNum,
         ROUND( IFNULL( operation15MinuteNum / operationMRNum, 0 ), 4 ) AS operation15MinutePercent,
         CONCAT( ROUND( IFNULL( operation15MinuteNum / operationMRNum, 0 ) * 100, 2 ), '%' ) AS operation15MinutePercentStr,
@@ -3096,7 +3096,7 @@
         0 AS consultationMRNum,
         sum( e.cases_entry_id = 2594 ) AS operationNameNum,
         sum( e.cases_entry_id = 2973 ) AS operationTimeNum,
-        sum( e.cases_entry_id = 2166 ) AS operation15MinuteNum,
+        sum( e.cases_entry_id = 2930 ) AS operation15MinuteNum,
         count( DISTINCT d.behospital_code ) AS operationMRNum,
         0 AS crisisNum,
         0 AS crisisMRNum,

+ 116 - 96
src/main/resources/mapper/QcresultInfoMapper.xml

@@ -1088,69 +1088,84 @@
 
     <!-- 缺陷详情(分页) -->
     <select id="entryCountGroupByEntryPage"  resultType="com.diagbot.dto.EntryNumDTO">
-        SELECT t.*
+        SELECT
+        t.*
         FROM
-        (SELECT
+        (
+        SELECT
         t1.id,
         t1.NAME,
         t1.casesId,
         t1.casesName,
         t1.ruleType,
         t1.isReject,
-        count(*) AS num,
+        t1.num,
         t2.totleNum,
-        ROUND( count(*) /t2.totleNum , 4 ) AS percent,
-        CONCAT(ROUND( count(*) /t2.totleNum * 100, 2 ), '%' ) AS percentStr
+        ROUND( t1.num / t2.totleNum, 4 ) AS percent,
+        CONCAT( ROUND( t1.num / t2.totleNum * 100, 2 ), '%' ) AS percentStr
+        FROM
+        (
+        SELECT
+        tt2.id AS id,
+        tt2.NAME AS NAME,
+        tt2.cases_id AS casesId,
+        tt2.cases_name AS casesName,
+        tt1.num,
+        tt2.rule_type AS ruleType,
+        tt1.is_reject AS isReject
         FROM
         (
         SELECT
-        e.id AS id,
-        e.NAME AS NAME,
-        e.cases_id as casesId,
-        e.cases_name as casesName,
-        e.rule_type as ruleType,
-        d.is_reject as isReject
+        d.cases_id,
+        d.cases_entry_id,
+        d.is_reject,
+        count(*) AS num
         FROM
         med_behospital_info a,
-        med_qcresult_detail d,
-        qc_cases_entry e
+        med_qcresult_detail d
         WHERE
         a.is_deleted = 'N'
         AND d.is_deleted = 'N'
-        and e.is_deleted='N'
-        and a.hospital_id = d.hospital_id
+        AND a.hospital_id = d.hospital_id
         AND a.behospital_code = d.behospital_code
         AND a.is_placefile = '1'
-        AND d.cases_id = e.cases_id
-        AND d.cases_entry_id = e.id
-        <![CDATA[AND a.qc_type_id <>0 ]]>
-        <if test="filterPageVO.casesId != null and filterPageVO.casesId != 0">
-            AND d.cases_id = #{filterPageVO.casesId}
-        </if>
-        <if test="filterPageVO.casesName != null and filterPageVO.casesName != ''">
-            AND e.cases_name = #{filterPageVO.casesName}
-        </if>
+        AND a.qc_type_id != 0
         <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
             AND a.hospital_id = #{filterPageVO.hospitalId}
         </if>
         <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{filterPageVO.startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= DATE(#{filterPageVO.startDate})]]>
         </if>
         <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
             <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageVO.endDate})]]>
         </if>
-        <if test="filterPageVO.name != null and filterPageVO.name != ''">
-            AND e.name like CONCAT('%', #{filterPageVO.name},'%')
-        </if>
         <if test="filterPageVO.deptName != null and filterPageVO.deptName != ''">
             AND a.beh_dept_name = #{filterPageVO.deptName}
         </if>
-        <if test="filterPageVO.ruleType != null">
-            AND e.rule_type = #{filterPageVO.ruleType}
+        <if test="filterPageVO.casesId != null and filterPageVO.casesId != 0">
+            AND d.cases_id = #{filterPageVO.casesId}
         </if>
         <if test="filterPageVO.isReject != null">
             AND d.is_reject = #{filterPageVO.isReject}
         </if>
+        GROUP BY
+        d.cases_entry_id,
+        d.cases_id
+        ) tt1,
+        qc_cases_entry tt2
+        WHERE
+        tt2.is_deleted = 'N'
+        AND tt1.cases_id = tt2.cases_id
+        AND tt1.cases_entry_id = tt2.id
+        <if test="filterPageVO.casesName != null and filterPageVO.casesName != ''">
+            AND tt2.cases_name = #{filterPageVO.casesName}
+        </if>
+        <if test="filterPageVO.name != null and filterPageVO.name != ''">
+            AND tt2.name like CONCAT('%', #{filterPageVO.name},'%')
+        </if>
+        <if test="filterPageVO.ruleType != null">
+            AND tt2.rule_type = #{filterPageVO.ruleType}
+        </if>
         ) t1,(
         SELECT
         count(*) AS totleNum
@@ -1161,19 +1176,13 @@
         WHERE
         a.is_deleted = 'N'
         AND d.is_deleted = 'N'
-        and e.is_deleted='N'
-        and a.hospital_id = d.hospital_id
+        AND e.is_deleted = 'N'
+        AND a.hospital_id = d.hospital_id
         AND a.behospital_code = d.behospital_code
         AND a.is_placefile = '1'
-        AND d.cases_id = e.cases_id
-        AND d.cases_entry_id = e.id
-        <![CDATA[AND a.qc_type_id <>0 ]]>
-        <if test="filterPageVO.casesId != null and filterPageVO.casesId != 0">
-            AND d.cases_id = #{filterPageVO.casesId}
-        </if>
-        <if test="filterPageVO.casesName != null and filterPageVO.casesName != ''">
-            AND e.cases_name = #{filterPageVO.casesName}
-        </if>
+        AND e.cases_id = d.cases_id
+        AND e.id = d.cases_entry_id
+        AND a.qc_type_id != 0
         <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
             AND a.hospital_id = #{filterPageVO.hospitalId}
         </if>
@@ -1186,18 +1195,19 @@
         <if test="filterPageVO.deptName != null and filterPageVO.deptName != ''">
             AND a.beh_dept_name  =  #{filterPageVO.deptName}
         </if>
-        <if test="filterPageVO.ruleType != null">
-            AND e.rule_type = #{filterPageVO.ruleType}
-        </if>
         <if test="filterPageVO.isReject != null">
             AND d.is_reject = #{filterPageVO.isReject}
         </if>
+        <if test="filterPageVO.casesId != null and filterPageVO.casesId != 0">
+            AND d.cases_id = #{filterPageVO.casesId}
+        </if>
+        <if test="filterPageVO.casesName != null and filterPageVO.casesName != ''">
+            AND e.cases_name = #{filterPageVO.casesName}
+        </if>
+        <if test="filterPageVO.ruleType != null">
+            AND e.rule_type = #{filterPageVO.ruleType}
+        </if>
         ) t2
-        GROUP BY
-        t1.id,
-        t1.NAME,
-        t1.casesId,
-        t1.casesName
         )t
     </select>
 
@@ -1445,45 +1455,45 @@
         t1.isReject,
         t1.deptId,
         t1.deptName,
-        count(*) AS num,
+        t1.num,
         t2.totleNum,
-        ROUND( count(*) /t2.totleNum , 4 ) AS percent,
-        CONCAT(ROUND( count(*) /t2.totleNum * 100, 2 ), '%' ) AS percentStr
+        ROUND( t1.num / t2.totleNum, 4 ) AS percent,
+        CONCAT( ROUND( t1.num / t2.totleNum * 100, 2 ), '%' ) AS percentStr
         FROM
         (
         SELECT
-        e.id,
-        e.NAME,
-        e.cases_id as casesId,
-        e.cases_name as casesName,
-        e.rule_type as ruleType,
-        d.is_reject as isReject,
-        a.beh_dept_id AS deptId,
-        a.beh_dept_name AS deptName
+        tt2.id,
+        tt2.NAME,
+        tt2.cases_id AS casesId,
+        tt2.cases_name AS casesName,
+        tt2.rule_type AS ruleType,
+        tt1.num,
+        tt1.is_reject AS isReject,
+        tt1.beh_dept_id AS deptId,
+        tt1.beh_dept_name AS deptName
+        FROM
+        (
+        SELECT
+        a.beh_dept_id,
+        a.beh_dept_name,
+        d.cases_id,
+        d.cases_entry_id,
+        count(*) AS num,
+        d.is_reject
         FROM
         med_behospital_info a,
         med_qcresult_detail d,
-        qc_cases_entry e,
         sys_user_dept f
         WHERE
         a.is_deleted = 'N'
         AND d.is_deleted = 'N'
-        AND e.is_deleted = 'N'
         AND f.is_deleted = 'N'
         AND a.hospital_id = d.hospital_id
         AND a.hospital_id = f.hospital_id
         AND a.behospital_code = d.behospital_code
         AND a.is_placefile = '1'
-        AND d.cases_id = e.cases_id
-        AND d.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">
-            AND d.cases_id = #{filterPageByDeptVO.casesId}
-        </if>
-        <if test="filterPageByDeptVO.casesName != null and filterPageByDeptVO.casesName != ''">
-            AND e.cases_name = #{filterPageByDeptVO.casesName}
-        </if>
+        AND a.qc_type_id != 0
         <if test="filterPageByDeptVO.userId!=null">
             AND f.user_id = #{filterPageByDeptVO.userId}
         </if>
@@ -1491,13 +1501,10 @@
             AND a.hospital_id = #{filterPageByDeptVO.hospitalId}
         </if>
         <if test="filterPageByDeptVO.startDate != null and filterPageByDeptVO.startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{filterPageByDeptVO.startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= DATE(#{filterPageByDeptVO.startDate})]]>
         </if>
         <if test="filterPageByDeptVO.endDate != null and filterPageByDeptVO.endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageByDeptVO.endDate})]]>
-        </if>
-        <if test="filterPageByDeptVO.name != null and filterPageByDeptVO.name != ''">
-            AND e.name like CONCAT('%', #{filterPageByDeptVO.name},'%')
+            <![CDATA[ AND a.leave_hospital_date < DATE(#{filterPageByDeptVO.endDate})]]>
         </if>
         <if test="filterPageByDeptVO.deptName != null and filterPageByDeptVO.deptName != ''">
             AND a.beh_dept_name =  #{filterPageByDeptVO.deptName}
@@ -1510,12 +1517,32 @@
                 AND a.doctor_name = #{filterPageByDeptVO.doctorName}
             </if>
         </if>
-        <if test="filterPageByDeptVO.ruleType != null ">
-            AND e.rule_type = #{filterPageByDeptVO.ruleType}
+        <if test="filterPageByDeptVO.casesId != null and filterPageByDeptVO.casesId != 0">
+            AND d.cases_id = #{filterPageByDeptVO.casesId}
         </if>
         <if test="filterPageByDeptVO.isReject != null ">
             AND d.is_reject = #{filterPageByDeptVO.isReject}
         </if>
+        GROUP BY
+        d.cases_id,
+        d.cases_entry_id,
+        a.beh_dept_id,
+        a.beh_dept_name
+        ) tt1,
+        qc_cases_entry tt2
+        WHERE
+        tt2.is_deleted = 'N'
+        AND tt1.cases_id = tt2.cases_id
+        AND tt1.cases_entry_id = tt2.id
+        <if test="filterPageByDeptVO.casesName != null and filterPageByDeptVO.casesName != ''">
+            AND tt2.cases_name = #{filterPageByDeptVO.casesName}
+        </if>
+        <if test="filterPageByDeptVO.name != null and filterPageByDeptVO.name != ''">
+            AND tt2.name like CONCAT('%', #{filterPageByDeptVO.name},'%')
+        </if>
+        <if test="filterPageByDeptVO.ruleType != null ">
+            AND tt2.rule_type = #{filterPageByDeptVO.ruleType}
+        </if>
         ) t1,(
         SELECT
         count(*) AS totleNum
@@ -1536,13 +1563,7 @@
         AND d.cases_id = e.cases_id
         AND d.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">
-            AND d.cases_id = #{filterPageByDeptVO.casesId}
-        </if>
-        <if test="filterPageByDeptVO.casesName != null and filterPageByDeptVO.casesName != ''">
-            AND e.cases_name = #{filterPageByDeptVO.casesName}
-        </if>
+        AND a.qc_type_id != 0
         <if test="filterPageByDeptVO.userId!=null">
             AND f.user_id = #{filterPageByDeptVO.userId}
         </if>
@@ -1550,10 +1571,10 @@
             AND a.hospital_id = #{filterPageByDeptVO.hospitalId}
         </if>
         <if test="filterPageByDeptVO.startDate != null and filterPageByDeptVO.startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{filterPageByDeptVO.startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= DATE(#{filterPageByDeptVO.startDate})]]>
         </if>
         <if test="filterPageByDeptVO.endDate != null and filterPageByDeptVO.endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageByDeptVO.endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date < DATE(#{filterPageByDeptVO.endDate})]]>
         </if>
         <if test="filterPageByDeptVO.deptName != null and filterPageByDeptVO.deptName != ''">
             AND a.beh_dept_name =  #{filterPageByDeptVO.deptName}
@@ -1566,20 +1587,19 @@
                 AND a.doctor_name = #{filterPageByDeptVO.doctorName}
             </if>
         </if>
-        <if test="filterPageByDeptVO.ruleType != null ">
-            AND e.rule_type = #{filterPageByDeptVO.ruleType}
+        <if test="filterPageByDeptVO.casesId != null and filterPageByDeptVO.casesId != 0">
+            AND d.cases_id = #{filterPageByDeptVO.casesId}
         </if>
         <if test="filterPageByDeptVO.isReject != null">
             AND d.is_reject = #{filterPageByDeptVO.isReject}
         </if>
+        <if test="filterPageByDeptVO.casesName != null and filterPageByDeptVO.casesName != ''">
+            AND e.cases_name = #{filterPageByDeptVO.casesName}
+        </if>
+        <if test="filterPageByDeptVO.ruleType != null ">
+            AND e.rule_type = #{filterPageByDeptVO.ruleType}
+        </if>
         ) t2
-        GROUP BY
-        t1.id,
-        t1.NAME,
-        t1.casesId,
-        t1.casesName,
-        t1.deptId,
-        t1.deptName
         )t
     </select>
 </mapper>