|
|
@@ -129,15 +129,15 @@
|
|
|
</if>
|
|
|
</where>
|
|
|
) as c
|
|
|
- left join (select * from bus_patient
|
|
|
+ left join (select * from bus_patient)
|
|
|
+ as p on c.patient_id = p.id
|
|
|
+ left join (select clinic_id,count(1) as infusion_count from bus_infusion_history GROUP BY clinic_id) as i on i.clinic_id=c.id
|
|
|
+ left join (select clinic_id,count(1) as eval_count from bus_evaluation GROUP BY clinic_id) as eval on eval.clinic_id=c.id
|
|
|
<where>
|
|
|
<if test="query.patientCode!=null">
|
|
|
- and code like concat('%',#{query.patientCode},'%')
|
|
|
+ and patient_code like concat('%',#{query.patientCode},'%')
|
|
|
</if>
|
|
|
</where>
|
|
|
- ) as p on c.patient_id = p.id
|
|
|
- left join (select clinic_id,count(1) as infusion_count from bus_infusion_history GROUP BY clinic_id) as i on i.clinic_id=c.id
|
|
|
- left join (select clinic_id,count(1) as eval_count from bus_evaluation GROUP BY clinic_id) as eval on eval.clinic_id=c.id
|
|
|
<if test="(query.orderByDesc!=null and query.orderByDesc.size > 0 ) or (query.orderByAsc!=null and query.orderByAsc.size > 0)">
|
|
|
order by
|
|
|
</if>
|