|
|
@@ -65,6 +65,7 @@
|
|
|
<result property="warnFlow" column="warn_flow"/>
|
|
|
<result property="unreadCount" column="unread_count"/>
|
|
|
<result property="lastModifyUserType" column="last_modify_user_type"/>
|
|
|
+ <result property="infusionId" column="infusion_id"/>
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
@@ -155,7 +156,8 @@
|
|
|
bih.warn_flow as warn_flow,
|
|
|
bih.warn_analgesic_poor as warn_analgesic_poor,
|
|
|
bcr.last_modify_user_type as last_modify_user_type,
|
|
|
- GREATEST(COALESCE(igu.unread_count, 0), 0) as unread_count
|
|
|
+ GREATEST(COALESCE(igu.unread_count, 0), 0) as unread_count,
|
|
|
+ bih.id as infusion_id
|
|
|
FROM biz_clinic_room bcr
|
|
|
join biz_clinic_room_doctor_user bcrmu on bcr.id = bcrmu.clinic_room_id
|
|
|
left join biz_infusion_clinic as bic on bic.clinic_id = bcr.id
|
|
|
@@ -647,7 +649,10 @@
|
|
|
left join biz_clinic_room_wx_user as bcrwu on bcr.id = bcrwu.clinic_room_id
|
|
|
left join biz_clinic_room_doctor_user as bcrdu on bcr.id = bcrdu.clinic_room_id
|
|
|
<where>
|
|
|
- bcrdu.id is null and bp.deleted = 0 and bcr.deleted = 0 and bp.patient_code like concat('%',#{query.patientCode},'%')
|
|
|
+ bcrdu.id is null and bp.deleted = 0 and bcr.deleted = 0
|
|
|
+ <if test="query.patientCode !=null and query.patientCode != ''">
|
|
|
+ and bp.patient_code like concat('%',#{query.patientCode},'%')
|
|
|
+ </if>
|
|
|
<if test="query.wxUserId !=null and query.wxUserId != ''">
|
|
|
and bcrwu.wx_user_id = #{query.wxUserId}
|
|
|
</if>
|
|
|
@@ -655,4 +660,46 @@
|
|
|
order by bcr.clinic_start_time desc
|
|
|
LIMIT 1
|
|
|
</select>
|
|
|
+ <select id="stdQueryClinicList" resultMap="stdThumbnailResult">
|
|
|
+ select
|
|
|
+ bcr.id as clinic_room_id,
|
|
|
+ bcr.clinic_name as clinic_name,
|
|
|
+ bcr.clinic_start_time as clinic_start_time,
|
|
|
+ bcr.dept_id as dept_id,
|
|
|
+ bp.id as patient_id,
|
|
|
+ bcr.dept_name as dept_name,
|
|
|
+ bcr.patient_code as patient_code,
|
|
|
+ bcr.patient_name as patient_name,
|
|
|
+ bcr.patient_gender as patient_gender,
|
|
|
+ bcr.patient_age as patient_age,
|
|
|
+ bcr.image_url as patient_avatar,
|
|
|
+ bcr.last_modify_user_type as last_modify_user_type,
|
|
|
+ bp.card_no as card_no,
|
|
|
+ bp.new_human as new_human,
|
|
|
+ bcrdu.user_id as doctor_id,
|
|
|
+ bcrwu.wx_user_id as wx_user_id
|
|
|
+ from
|
|
|
+ biz_patient as bp
|
|
|
+ join biz_clinic_room as bcr on bp.current_clinic_id = bcr.id
|
|
|
+ left join biz_clinic_room_wx_user as bcrwu on bcr.id = bcrwu.clinic_room_id
|
|
|
+ left join biz_clinic_room_doctor_user as bcrdu on bcr.id = bcrdu.clinic_room_id
|
|
|
+ <where>
|
|
|
+ bcrdu.id is null
|
|
|
+ and bp.deleted = 0
|
|
|
+ and bcr.deleted = 0
|
|
|
+ <if test="query.patientCode !=null and query.patientCode != ''">
|
|
|
+ and bp.patient_code like concat('%',#{query.patientCode},'%')
|
|
|
+ </if>
|
|
|
+ <if test="query.condition !=null and query.condition != ''">
|
|
|
+ and (
|
|
|
+ bcr.patient_name LIKE concat('%',#{query.condition,jdbcType=VARCHAR},'%')
|
|
|
+ or bcr.clinic_name like concat('%',#{query.condition,jdbcType=VARCHAR},'%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="query.wxUserId !=null and query.wxUserId != ''">
|
|
|
+ and bcrwu.wx_user_id = #{query.wxUserId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by bcr.clinic_start_time desc
|
|
|
+ </select>
|
|
|
</mapper>
|