|
|
@ -303,6 +303,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<if test="firstVisitOder!=null and firstVisitOder !=''" >order by tp.create_time ${firstVisitOder}</if>
|
|
|
|
<if test="firstVisitOder!=null and firstVisitOder !=''" >order by tp.create_time ${firstVisitOder}</if>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectTodayRecord" parameterType="TRecordResultReq" resultType="TRecordResp">
|
|
|
|
|
|
|
|
<include refid="selectTRecordWithOutResult"/>
|
|
|
|
|
|
|
|
where to_days(tr.create_time) = to_days(now())
|
|
|
|
|
|
|
|
<if test="name != null and name != ''"> and tp.name like concat('%', #{name}, '%')</if>
|
|
|
|
|
|
|
|
<if test="doctorId != null "> and tr.doctor_id = #{doctorId}</if>
|
|
|
|
|
|
|
|
<if test="hospitalId != null "> and tr.hospital_id = #{hospitalId}</if>
|
|
|
|
|
|
|
|
<if test="status != null and status != ''"> and tr.status = #{status}</if>
|
|
|
|
|
|
|
|
<if test="doctorName != null and doctorName != ''"> and td.name like concat('%', #{doctorName}, '%')</if>
|
|
|
|
|
|
|
|
<if test="age !=null and age != ''">
|
|
|
|
|
|
|
|
and tp.age between
|
|
|
|
|
|
|
|
<foreach item="item" collection="age.split('-')" separator="and">
|
|
|
|
|
|
|
|
#{item}
|
|
|
|
|
|
|
|
</foreach>
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="sex !=null and sex !=''">and tp.sex = #{sex} </if>
|
|
|
|
|
|
|
|
<if test="identifier !=null and identifier != ''">and tp.identifier like concat('%', #{identifier}, '%')</if>
|
|
|
|
|
|
|
|
<if test="delFlag == null">
|
|
|
|
|
|
|
|
and td.del_flag = '0' and tp.del_flag = '0' and tr.del_flag = '0'
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="createTime != null and createTime !='' and createTime != 'all'">
|
|
|
|
|
|
|
|
and DATE_FORMAT(tp.create_time,'%Y-%m') = #{createTime}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="startTime != null and startTime != '' and endTime == null "> and tr.create_time >= #{startTime}</if>
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<if test="patientAge != null"> and tp.age = #{patientAge} </if>
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectTRecordById" parameterType="Long" resultMap="TRecordResult">
|
|
|
|
<select id="selectTRecordById" parameterType="Long" resultMap="TRecordResult">
|
|
|
|
<include refid="selectTRecordVo"/>
|
|
|
|
<include refid="selectTRecordVo"/>
|
|
|
|
where id = #{id}
|
|
|
|
where id = #{id}
|
|
|
|