Browse Source

Merge branch 'dev/h5&log_20220506' into debug

songxinlu 3 years ago
parent
commit
0743c7a29f

+ 3 - 3
src/main/java/com/diagbot/aop/LogAspect.java

@@ -180,9 +180,9 @@ public class LogAspect {
      * @param outMap
      * @Return void
      */private void initOutMap(Map<String, Object> outMap) {
-        //添加from:该字段是前端用来判断不同来源导出的excel文件文件名是什么
-        if(StringUtil.isNotBlank(SysUserUtils.getFrom())){
-            outMap.put("#from",SysUserUtils.getFrom());
+        //添加excelName:获取前端要导出的文件名
+        if(StringUtil.isNotBlank(SysUserUtils.getExcelName())){
+            outMap.put("#excelName",SysUserUtils.getExcelName());
         }
         if(StringUtil.isNotBlank(SysUserUtils.getIsPlacefile())){
             outMap.put("#isPlacefile",SysUserUtils.getIsPlacefile());

+ 3 - 3
src/main/java/com/diagbot/util/SysUserUtils.java

@@ -125,11 +125,11 @@ public class SysUserUtils {
     }
 
     /**
-     * 获取当前请求的用户的当前系统id字符串
+     * 获取前端要导出的文件名
      *
      * @return
      */
-    public static String getFrom() {
-        return HttpUtils.getHeader("from");
+    public static String getExcelName() {
+        return HttpUtils.getHeader("excelName");
     }
 }

+ 78 - 10
src/main/resources/mapper/QcresultInfoMapper.xml

@@ -2212,9 +2212,10 @@
         GROUP BY
         a.beh_dept_id,
         a.beh_dept_name
-        order by firstPercent DESC,
-        sencondPercent DESC,
-        thirdPercent DESC) t
+        order by totleNum DESC,
+                 firstPercent DESC,
+                 sencondPercent DESC,
+                 thirdPercent DESC) t
     </select>
 
     <!-- 按模块统计质控缺陷数-科室(分页) -->
@@ -2578,13 +2579,19 @@
 
     <!--病历扣分大于等于5分占比(H5)-->
     <select id="deductGT5ByDept" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.DeptNumDTO">
+        SELECT
+        k1.deptId,
+        k1.deptName,
+        k1.num,
+        k2.totleNum,
+        Round( k1.num / k2.totleNum, 4 ) AS percent,
+        CONCAT( Round( k1.num / k2.totleNum * 100, 2 ), '%' ) AS percentStr
+        FROM
+        (
         SELECT
         t1.beh_dept_id AS deptId,
         t1.beh_dept_name AS deptName,
-        sum( t2.totleScore - t1.score_res >= 5 ) AS num,
-        count(*) AS totleNum,
-        Round( sum( t2.totleScore - t1.score_res >= 5 ) / count(*), 4 ) AS percent,
-        CONCAT( Round( sum( t2.totleScore - t1.score_res >= 5 ) / count(*) * 100, 2 ), '%' ) AS percentStr
+        count(*) AS num
         FROM
         (
         SELECT
@@ -2643,13 +2650,74 @@
         `sys_hospital_set`
         WHERE
         CODE = 'score_type'
-        <if test="hospitalId != null and hospitalId != ''">
-            AND hospital_id = #{hospitalId}
-        </if>
+        AND hospital_id = '5'
         ) t2
+        WHERE
+        t2.totleScore - t1.score_res >= 5
         GROUP BY
         t1.beh_dept_id,
         t1.beh_dept_name
+        ) k1,
+        (
+        SELECT
+        count(*) AS totleNum
+        FROM
+        (
+        SELECT
+        a.*,
+        b.score_res
+        FROM
+        med_behospital_info a,
+        med_qcresult_info b
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND a.hospital_id = b.hospital_id
+        AND a.behospital_code = b.behospital_code
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
+        AND a.qc_type_id != 0
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 0">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 1">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        ) t1,
+        (
+        SELECT
+        `value`,
+        hospital_id,
+        CASE
+        `value`
+        WHEN 0 THEN
+        120
+        WHEN 1 THEN
+        100
+        END AS totleScore
+        FROM
+        `sys_hospital_set`
+        WHERE
+        CODE = 'score_type'
+        AND hospital_id = '5'
+        ) t2
+        WHERE
+        t2.totleScore - t1.score_res >= 5
+        ) k2
         ORDER BY
         percent DESC
     </select>