|
|
|
@ -110,10 +110,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
t.age,
|
|
|
|
|
t.disease,
|
|
|
|
|
t.firstTime,
|
|
|
|
|
max(t.createTime)
|
|
|
|
|
max(t.trCreateTime),
|
|
|
|
|
t.trCreateTime,
|
|
|
|
|
t.tpCreateTime
|
|
|
|
|
FROM
|
|
|
|
|
(
|
|
|
|
|
SELECT
|
|
|
|
|
tr.create_time AS trCreateTime,
|
|
|
|
|
tp.create_time AS tpCreateTime,
|
|
|
|
|
tr.id,
|
|
|
|
|
tr.patient_id AS patientId,
|
|
|
|
|
tr.doctor_id AS doctorId,
|
|
|
|
@ -163,11 +167,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="startTime == null and endTime != '' and endTime != null "> and tr.create_time <= #{endTime}</if>
|
|
|
|
|
<if test="startTime != null and endTime != null "> and tr.create_time between #{startTime} and #{endTime}</if>
|
|
|
|
|
</where>
|
|
|
|
|
<if test="doctorOder !=null and doctorOder !=''" >order by tr.create_time ${doctorOder}</if>
|
|
|
|
|
<if test="firstVisitOder!=null and firstVisitOder !=''" >order by tp.create_time ${firstVisitOder}</if>
|
|
|
|
|
) t
|
|
|
|
|
GROUP BY
|
|
|
|
|
t.patientId
|
|
|
|
|
<if test="doctorOder !=null and doctorOder !=''" >order by t.trCreateTime ${doctorOder}</if>
|
|
|
|
|
<if test="firstVisitOder!=null and firstVisitOder !=''" >order by t.tpCreateTime ${firstVisitOder}</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!--====================工作台相关接口=====================-->
|
|
|
|
|