Browse Source

Merge branch 'dev/20200603_1.2.2' into test

wangfeng 5 years ago
parent
commit
ab2b291441

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

@@ -60,6 +60,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
 import javax.servlet.http.HttpServletResponse;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Date;
@@ -944,6 +945,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
      * @param exportQcresultVO
      */
     public void exportQcresult(HttpServletResponse response, ExportQcresultVO exportQcresultVO) {
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
         String hospitalId = SysUserUtils.getCurrentHospitalID();
         exportQcresultVO.setHospitalId(hospitalId);
         Date startDate = exportQcresultVO.getLeaveHosDateStart();
@@ -958,8 +960,9 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         }
 
         List<ExportExcelDTO> res = this.exportQcresult(exportQcresultVO);
+        String fileName = dateFormat.format(startDate) + "-" + dateFormat.format(endDate) + "抽查住院病历质量情况.xls";
         response.setContentType("text/html;charset=UTF-8");
-        ExcelUtils.exportExcel(res, null, "导出sheet1", ExportExcelDTO.class, "测试user.xls", response);
+        ExcelUtils.exportExcelUser(res, null, "导出sheet1", ExportExcelDTO.class, fileName, response);
     }
 
     /**
@@ -969,6 +972,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
      * @param exportQcresultVO
      */
     public void exportQcresultByDept(HttpServletResponse response, ExportQcresultVO exportQcresultVO) {
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
         String hospitalId = SysUserUtils.getCurrentHospitalID();
         String userId = SysUserUtils.getCurrentPrincipleID();
         exportQcresultVO.setHospitalId(hospitalId);
@@ -985,7 +989,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         }
 
         List<ExportExcelDTO> res = this.exportQcresultByDept(exportQcresultVO);
+        String fileName = dateFormat.format(startDate) + "-" + dateFormat.format(endDate) + "抽查住院病历质量情况.xls";
         response.setContentType("text/html;charset=UTF-8");
-        ExcelUtils.exportExcel(res, null, "导出sheet1", ExportExcelDTO.class, "测试user.xls", response);
+        ExcelUtils.exportExcelUser(res, null, "导出sheet1", ExportExcelDTO.class, fileName, response);
     }
 }

+ 7 - 0
src/main/java/com/diagbot/vo/ExportQcresultVO.java

@@ -20,4 +20,11 @@ public class ExportQcresultVO {
     private String hospitalId;
     @ApiModelProperty(hidden = true)
     private Long userId;
+
+    private String behospitalCode;
+    private String level;
+    private String doctorName;
+    private String doctorCode;
+    private String deptId;
+    private String name;
 }

+ 88 - 0
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -1820,6 +1820,28 @@
         <if test="leaveHosDateEnd != null ">
             <![CDATA[AND a.leave_hospital_date < DATE(#{leaveHosDateEnd})]]>
         </if>
+        <if test="behospitalCode != null and behospitalCode != ''">
+            AND a.behospital_code like CONCAT('%',#{behospitalCode},'%')
+        </if>
+        <if test="level != null and level != ''">
+            AND b.level = #{level}
+        </if>
+        <if test="doctorName != null and doctorName != ''">
+            AND (a.doctor_name like CONCAT('%',#{doctorName},'%')
+                 OR a.beh_doctor_name like CONCAT('%',#{doctorName},'%')
+                 OR a.director_doctor_name like CONCAT('%',#{doctorName},'%'))
+        </if>
+        <if test="doctorCode != null and doctorCode != ''">
+            AND (a.doctor_id like CONCAT('%',#{doctorCode},'%')
+                 OR a.beh_doctor_id like CONCAT('%',#{doctorCode},'%')
+                 OR a.director_doctor_id like CONCAT('%',#{doctorCode},'%'))
+        </if>
+        <if test="deptId != null and deptId != ''">
+            AND a.beh_dept_id = #{deptId}
+        </if>
+        <if test="name != null and name != ''">
+            AND a.name like CONCAT('%',#{name},'%')
+        </if>
         ) t1,
         (
         SELECT
@@ -1845,6 +1867,28 @@
         <if test="leaveHosDateEnd != null ">
             <![CDATA[AND a.leave_hospital_date < DATE(#{leaveHosDateEnd})]]>
         </if>
+        <if test="behospitalCode != null and behospitalCode != ''">
+            AND a.behospital_code like CONCAT('%',#{behospitalCode},'%')
+        </if>
+        <if test="level != null and level != ''">
+            AND b.level = #{level}
+        </if>
+        <if test="doctorName != null and doctorName != ''">
+            AND (a.doctor_name like CONCAT('%',#{doctorName},'%')
+            OR a.beh_doctor_name like CONCAT('%',#{doctorName},'%')
+            OR a.director_doctor_name like CONCAT('%',#{doctorName},'%'))
+        </if>
+        <if test="doctorCode != null and doctorCode != ''">
+            AND (a.doctor_id like CONCAT('%',#{doctorCode},'%')
+            OR a.beh_doctor_id like CONCAT('%',#{doctorCode},'%')
+            OR a.director_doctor_id like CONCAT('%',#{doctorCode},'%'))
+        </if>
+        <if test="deptId != null and deptId != ''">
+            AND a.beh_dept_id = #{deptId}
+        </if>
+        <if test="name != null and name != ''">
+            AND a.name like CONCAT('%',#{name},'%')
+        </if>
         GROUP BY
         a.beh_dept_id,
         a.beh_dept_name
@@ -1923,6 +1967,28 @@
         <if test="leaveHosDateEnd != null ">
             <![CDATA[AND a.leave_hospital_date < DATE(#{leaveHosDateEnd})]]>
         </if>
+        <if test="behospitalCode != null and behospitalCode != ''">
+            AND a.behospital_code like CONCAT('%',#{behospitalCode},'%')
+        </if>
+        <if test="level != null and level != ''">
+            AND b.level = #{level}
+        </if>
+        <if test="doctorName != null and doctorName != ''">
+            AND (a.doctor_name like CONCAT('%',#{doctorName},'%')
+            OR a.beh_doctor_name like CONCAT('%',#{doctorName},'%')
+            OR a.director_doctor_name like CONCAT('%',#{doctorName},'%'))
+        </if>
+        <if test="doctorCode != null and doctorCode != ''">
+            AND (a.doctor_id like CONCAT('%',#{doctorCode},'%')
+            OR a.beh_doctor_id like CONCAT('%',#{doctorCode},'%')
+            OR a.director_doctor_id like CONCAT('%',#{doctorCode},'%'))
+        </if>
+        <if test="deptId != null and deptId != ''">
+            AND a.beh_dept_id = #{deptId}
+        </if>
+        <if test="name != null and name != ''">
+            AND a.name like CONCAT('%',#{name},'%')
+        </if>
         ) t1,
         (
         SELECT
@@ -1955,6 +2021,28 @@
         <if test="leaveHosDateEnd != null ">
             <![CDATA[AND a.leave_hospital_date < DATE(#{leaveHosDateEnd})]]>
         </if>
+        <if test="behospitalCode != null and behospitalCode != ''">
+            AND a.behospital_code like CONCAT('%',#{behospitalCode},'%')
+        </if>
+        <if test="level != null and level != ''">
+            AND b.level = #{level}
+        </if>
+        <if test="doctorName != null and doctorName != ''">
+            AND (a.doctor_name like CONCAT('%',#{doctorName},'%')
+            OR a.beh_doctor_name like CONCAT('%',#{doctorName},'%')
+            OR a.director_doctor_name like CONCAT('%',#{doctorName},'%'))
+        </if>
+        <if test="doctorCode != null and doctorCode != ''">
+            AND (a.doctor_id like CONCAT('%',#{doctorCode},'%')
+            OR a.beh_doctor_id like CONCAT('%',#{doctorCode},'%')
+            OR a.director_doctor_id like CONCAT('%',#{doctorCode},'%'))
+        </if>
+        <if test="deptId != null and deptId != ''">
+            AND a.beh_dept_id = #{deptId}
+        </if>
+        <if test="name != null and name != ''">
+            AND a.name like CONCAT('%',#{name},'%')
+        </if>
         GROUP BY
         a.beh_dept_id,
         a.beh_dept_name