|
|
@@ -117,7 +117,9 @@
|
|
|
join biz_clinic_room_wx_user as bcrwu on bcrwu.clinic_room_id = bcr.id
|
|
|
left join biz_clinic_room_doctor_user as bcrmu on bcrmu.clinic_room_id = bcr.id
|
|
|
left join sys_user as su on bcrmu.user_id = su.id
|
|
|
- left join biz_question_answer as bqa on bqa.clinic_id = bcr.id
|
|
|
+ #答案表可能有多个 但是之关联最新一条数据
|
|
|
+ left join ( SELECT *, ROW_NUMBER() OVER (PARTITION BY clinic_id ORDER BY answer_time DESC) as rn FROM biz_question_answer ) as bqa
|
|
|
+ on bqa.clinic_id = bcr.id and rn =1
|
|
|
left join biz_dept as bd on bd.id=bcr.dept_id
|
|
|
left join (select * from im_group_user where user_id= #{query.userId,jdbcType=VARCHAR}) as igu on igu.group_id=bcr.id
|
|
|
<where>
|