|
@@ -401,7 +401,7 @@
|
|
|
AND a.hospital_id = b.hospital_id
|
|
|
AND a.behospital_code = b.behospital_code
|
|
|
AND a.is_placefile = '1'
|
|
|
- AND ( b.age IS NULL OR b.age = '-' OR b.age = '' )
|
|
|
+ -- AND ( b.age IS NULL OR b.age = '-' OR b.age = '' )
|
|
|
<![CDATA[AND ( b.newborn_month IS NOT NULL OR b.newborn_month <> '' OR b.newborn_day IS NOT NULL OR b.newborn_day <> '' )]]>
|
|
|
<![CDATA[AND a.qc_type_id <>0 ]]>
|
|
|
<if test="hospitalId != null and hospitalId != ''">
|
|
@@ -1822,6 +1822,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
|
|
@@ -1847,6 +1869,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
|
|
@@ -1925,6 +1969,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
|
|
@@ -1957,6 +2023,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
|