Преглед на файлове

医生、科室 id和名称为空时特殊处理

songxinlu преди 3 години
родител
ревизия
d1134809b5

+ 40 - 0
src/main/java/com/diagbot/facade/ConsoleByDoctorFacade.java

@@ -38,9 +38,33 @@ public class ConsoleByDoctorFacade {
      */
     public IPage<DoctorAverageStatisticsDTO> doctorAverageStatistics(DoctorAverageStatisticsVO doctorAverageStatisticsVO) {
         doctorAverageStatisticsVO.setHospitalId(SysUserUtils.getCurrentHospitalID());
+        //替换
+        transformParam(doctorAverageStatisticsVO);
         return behospitalInfoFacade.getBaseMapper().doctorAverageStatistics(doctorAverageStatisticsVO);
     }
 
+    /**
+     * 参数替换
+     *
+     * @param doctorAverageStatisticsVO
+     * @Return void
+     */
+    private void transformParam(DoctorAverageStatisticsVO doctorAverageStatisticsVO) {
+
+        if("-".equals(doctorAverageStatisticsVO.getDeptId())){
+            doctorAverageStatisticsVO.setDeptId("-0");
+        }
+        if("-".equals(doctorAverageStatisticsVO.getDeptName())){
+            doctorAverageStatisticsVO.setDeptName("-0");
+        }
+        if("-".equals(doctorAverageStatisticsVO.getDoctorId())){
+            doctorAverageStatisticsVO.setDoctorId("-0");
+        }
+        if("-".equals(doctorAverageStatisticsVO.getDoctorName())){
+            doctorAverageStatisticsVO.setDoctorName("-0");
+        }
+    }
+
     /**
      * 医生质控平均分-患者列表(等级)
      *
@@ -52,6 +76,8 @@ public class ConsoleByDoctorFacade {
         return behospitalInfoFacade.getBaseMapper().doctorAverageLevelPage(doctorAverageLevelVO);
     }
 
+
+
     private void doctorAverageLevelPageSet(DoctorAverageLevelVO doctorAverageLevelVO) {
         //入参验证
         //入院时间
@@ -79,6 +105,20 @@ public class ConsoleByDoctorFacade {
             }
         }
         doctorAverageLevelVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
+
+        //医生、科室为空时参数替换
+        if("-".equals(doctorAverageLevelVO.getDeptId())){
+            doctorAverageLevelVO.setDeptId("-0");
+        }
+        if("-".equals(doctorAverageLevelVO.getDeptName())){
+            doctorAverageLevelVO.setDeptName("-0");
+        }
+        if("-".equals(doctorAverageLevelVO.getDoctorCode())){
+            doctorAverageLevelVO.setDoctorCode("-0");
+        }
+        if("-".equals(doctorAverageLevelVO.getDoctorName())){
+            doctorAverageLevelVO.setDoctorName("-0");
+        }
     }
 
     /**

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

@@ -68,7 +68,7 @@ public class DoctorAverageLevelVO extends Page implements Serializable {
     @ApiModelProperty(hidden = true)
     private Long userId;
 
-    private Long deptId;
+    private String deptId;
     @ApiModelProperty(value = "统计维度 1-本月,2-本年")
     private Integer statisticsType;
 

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

@@ -20039,22 +20039,38 @@
         <if test="diagnose != null and diagnose != ''">
             AND t.diagnose LIKE CONCAT( '%', #{diagnose}, '%' )
         </if>
-        <if test="deptName != null and deptName != ''">
+        <if test="deptId != null and deptId != '' and deptId != '-0'">
+            and t.beh_dept_id= #{deptId}
+        </if>
+        <if test="deptName == '-0'">
+            AND (t.beh_dept_id IS NULL OR t.beh_dept_id = '' OR t.beh_dept_id = '-')
+        </if>
+        <if test="deptName != null and deptName != '' and deptName != '-0'">
             and t.beh_dept_name= #{deptName}
         </if>
-        <if test="doctorName != null and doctorName != ''">
+        <if test="deptName == '-0'">
+            AND (t.beh_dept_name IS NULL OR t.beh_dept_name = '' OR t.beh_dept_name = '-')
+        </if>
+        <if test="doctorName != null and doctorName != '' and doctorName != '-0'">
             and CONCAT(
             IFNULL(t.doctor_name,''),IFNULL(t.beh_doctor_name,''),IFNULL(t.director_doctor_name,''))
             like CONCAT('%',#{doctorName},'%')
         </if>
+        <if test="doctorName == '-0'">
+            AND (t.doctor_name IS NULL OR t.doctor_name = '' OR t.doctor_name = '-')
+        </if>
+
         <if test="name != null and name != ''">
             and t.name like CONCAT('%',#{name},'%')
         </if>
-        <if test="doctorCode != null and doctorCode != ''">
+        <if test="doctorCode != null and doctorCode != '' and doctorCode != '-0'">
             and (t.doctor_id = #{doctorCode}
             or t.beh_doctor_id = #{doctorCode}
             or t.director_doctor_id = #{doctorCode})
         </if>
+        <if test="doctorCode == '-0'">
+            AND (t.doctor_id IS NULL OR t.doctor_id = '' OR t.doctor_id = '-')
+        </if>
         <if test="fileCode != null and fileCode != ''">
             and t.file_code like CONCAT('%',#{fileCode},'%')
         </if>