Explorar el Código

生成核查任务去除病区、科室对病历列表筛选影响

songxinlu hace 3 años
padre
commit
4266f927bb

+ 3 - 0
src/main/java/com/diagbot/facade/MedCheckWorkFacade.java

@@ -339,6 +339,9 @@ public class MedCheckWorkFacade {
                         .eq("is_deleted", IsDeleteEnum.N.getKey()));
                 checkWorkPageVO.setDoctorIds(basDoctorInfos.stream().map(BasDoctorInfo::getDoctorId).collect(Collectors.toList()));
             }
+            //通过主治医生去查,病区、科室、医疗组不作为筛选条件
+            checkWorkPageVO.setDepts(null);
+            checkWorkPageVO.setWards(null);
         }
     }
 

+ 87 - 68
src/main/resources/mapper/MedCheckInfoMapper.xml

@@ -159,74 +159,93 @@
         a.medoupCode,
         a.medoupName
         from
-        (select
-            a.behospital_code,
-            a.`name`,
-            a.beh_dept_name,
-            a.doctor_name,
-            a.leave_hospital_date,
-            a.hospital_id,
-            a.beh_dept_id,
-            b.job_create_time,
-            b.id,
-            a.ward_code wardCode,
-            a.ward_name wardName,
-            m.`code` medoupCode,
-            m.`name` medoupName
-            from
-            med_behospital_info a ,med_check_info b
-            LEFT JOIN sys_user u ON u.id = b.job_creator AND
-            u.is_deleted = 'N'
-            LEFT JOIN bas_doctor_info mu ON mu.doctor_id = u.username
-            AND mu.is_deleted = 'N'
-            LEFT JOIN sys_medoup m ON m.`code` = mu.group_id
-            AND m.is_deleted = 'N'
-              where a.behospital_code = b.behospital_code and a.hospital_id = b.hospital_id and a.is_deleted = 'N'
-                and b.is_deleted = 'N' and b.job_distribution_name is NULL  and b.`status` = 0
-                <if test="jobType !=null and jobType != ''">
-                    and b.job_type = #{jobType}
-                </if>
-                <if test="startTime != null and startTime != ''">
-                    <![CDATA[ AND b.job_create_time >= #{startTime}]]>
-                </if>
-                <if test="endTime != null and endTime != ''">
-                    <![CDATA[ AND b.job_create_time <= #{endTime}]]>
-                </if>
-
-                <if test="behosDateStart != null and behosDateStart != ''">
-                    <![CDATA[ AND a.leave_hospital_date >= #{behosDateStart}]]>
-                </if>
-                <if test="behosDateEnd != null and behosDateEnd != ''">
-                    <![CDATA[ AND a.leave_hospital_date <= #{behosDateEnd}]]>
-                 </if>
-                <if test="doctorName !=null and doctorName != ''">
-                    and a.doctor_name LIKE CONCAT('%',#{doctorName},'%')
-                </if>
-                <if test="behospitalCode !=null and behospitalCode != ''">
-                    and a.behospital_code LIKE CONCAT('%',#{behospitalCode},'%')
-                </if>
-                <if test="name !=null and name != ''">
-                    and a.`name` LIKE CONCAT('%',#{name},'%')
-                </if>
-                <if test="depts !=null and depts.size()!=0 ">
-                    and a.beh_dept_id in
-                    <foreach collection="depts" item="item" open="(" close=")" separator=",">
-                        #{item}
-                    </foreach>
-                </if>
-                <if test="wards !=null and wards.size()!=0 ">
-                    AND a.ward_code in
-                    <foreach collection="wards" item="item" open="(" close=")" separator=",">
-                        #{item}
-                    </foreach>
-                </if>
-                <if test="medoups !=null and medoups.size()!=0 ">
-                    AND mu.group_id in
-                    <foreach collection="medoups" item="item" open="(" close=")" separator=",">
-                        #{item}
-                    </foreach>
-                </if>
-        ) a  JOIN med_behospital_type b on a.behospital_code = b.behospital_code
+        (
+        SELECT
+        a.behospital_code,
+        a.`name`,
+        a.beh_dept_name,
+        a.doctor_name,
+        a.leave_hospital_date,
+        a.hospital_id,
+        a.beh_dept_id,
+        b.job_create_time,
+        b.id,
+        a.wardCode,
+        a.wardName,
+        a.medoupCode,
+        a.medoupName
+        FROM
+        (SELECT
+        a.behospital_code,
+        a.`name`,
+        a.beh_dept_name,
+        a.doctor_name,
+        a.leave_hospital_date,
+        a.hospital_id,
+        a.beh_dept_id,
+        a.ward_code wardCode,
+        a.ward_name wardName,
+        m.`code` medoupCode,
+        m.`name` medoupName
+        FROM
+        med_behospital_info a
+        LEFT JOIN bas_doctor_info mu ON mu.doctor_id = a.doctor_id
+        AND mu.is_deleted = 'N'
+        LEFT JOIN sys_medoup m ON m.`code` = mu.group_id
+        AND m.is_deleted = 'N'
+        WHERE
+        a.is_deleted = 'N'
+        AND m.`code` IS NOT NULL
+        <if test="behosDateStart != null and behosDateStart != ''">
+            <![CDATA[ AND a.leave_hospital_date >= #{behosDateStart}]]>
+        </if>
+        <if test="behosDateEnd != null and behosDateEnd != ''">
+            <![CDATA[ AND a.leave_hospital_date <= #{behosDateEnd}]]>
+        </if>
+        <if test="doctorName !=null and doctorName != ''">and a.doctor_name LIKE CONCAT('%',#{doctorName},'%')
+        </if>
+        <if test="behospitalCode !=null and behospitalCode != ''">
+            and a.behospital_code LIKE CONCAT('%',#{behospitalCode},'%')
+        </if>
+        <if test="name !=null and name != ''">
+            and a.`name` LIKE CONCAT('%',#{name},'%')
+        </if>
+        <if test="depts !=null and depts.size()!=0 ">
+            and a.beh_dept_id in
+            <foreach collection="depts" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="wards !=null and wards.size()!=0 ">
+            AND a.ward_code in
+            <foreach collection="wards" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="medoups !=null and medoups.size()!=0 ">
+            AND mu.group_id in
+            <foreach collection="medoups" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        ) a
+        JOIN med_check_info b ON a.behospital_code = b.behospital_code
+        AND a.hospital_id = b.hospital_id
+        WHERE
+        b.is_deleted = 'N'
+        AND b.job_distribution_name IS NULL
+        AND b.`status` = 0
+        <if test="jobType !=null and jobType != ''">
+            and b.job_type = #{jobType}
+        </if>
+        <if test="startTime != null and startTime != ''">
+            <![CDATA[ AND b.job_create_time >= #{startTime}]]>
+        </if>
+        <if test="endTime != null and endTime != ''">
+            <![CDATA[ AND b.job_create_time <= #{endTime}]]>
+        </if>
+        ) a
+        JOIN med_behospital_type b on a.behospital_code = b.behospital_code
         and a.hospital_id = b.hospital_id and b.is_deleted = 'N' and  b.`value` is not null
         <if test="values !=null and values.size()!=0 ">
             and b.`value` in