|
@@ -1687,7 +1687,15 @@
|
|
|
AND a.beh_dept_id = #{filterPageVO.deptId}
|
|
|
</if>
|
|
|
<if test="filterPageVO.doctorName != null and filterPageVO.doctorName != ''">
|
|
|
- AND a.doctor_name = #{filterPageVO.doctorName}
|
|
|
+ AND (case
|
|
|
+ when a.doctor_id != '' and a.doctor_id is not null then a.doctor_id
|
|
|
+ when (a.doctor_id = '' or a.doctor_id is null) and
|
|
|
+ a.director_doctor_id != '' and a.director_doctor_id is not null
|
|
|
+ then a.director_doctor_id
|
|
|
+ when (a.doctor_id = '' or a.doctor_id is null) and
|
|
|
+ (a.director_doctor_id = '' or a.director_doctor_id is null) and
|
|
|
+ a.beh_doctor_id != '' and a.beh_doctor_id is not null
|
|
|
+ then a.beh_doctor_id end)= #{filterPageVO.doctorName}
|
|
|
</if>
|
|
|
<if test="filterPageVO.casesId != null and filterPageVO.casesId != 0">
|
|
|
AND d.cases_id = #{filterPageVO.casesId}
|
|
@@ -1752,7 +1760,15 @@
|
|
|
</if>
|
|
|
</if>
|
|
|
<if test="filterPageVO.doctorName != null and filterPageVO.doctorName != ''">
|
|
|
- AND a.doctor_name = #{filterPageVO.doctorName}
|
|
|
+ AND (case
|
|
|
+ when a.doctor_id != '' and a.doctor_id is not null then a.doctor_id
|
|
|
+ when (a.doctor_id = '' or a.doctor_id is null) and
|
|
|
+ a.director_doctor_id != '' and a.director_doctor_id is not null
|
|
|
+ then a.director_doctor_id
|
|
|
+ when (a.doctor_id = '' or a.doctor_id is null) and
|
|
|
+ (a.director_doctor_id = '' or a.director_doctor_id is null) and
|
|
|
+ a.beh_doctor_id != '' and a.beh_doctor_id is not null
|
|
|
+ then a.beh_doctor_id end)= #{filterPageVO.doctorName}
|
|
|
</if>
|
|
|
<if test="filterPageVO.deptName != null and filterPageVO.deptName != ''">
|
|
|
AND a.beh_dept_name = #{filterPageVO.deptName}
|