|
|
@ -152,7 +152,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<if test="sex !=null and sex !=''">and tp.sex = #{sex} </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="identifier !=null and identifier != ''">and tp.identifier like concat('%', #{identifier}, '%')</if>
|
|
|
|
<if test="delFlag == null">
|
|
|
|
<if test="delFlag == null">
|
|
|
|
and td.del_flag = '0' and tp.del_flag = '0' and tr.del_flag = '0'
|
|
|
|
and td.del_flag = '0' and tp.del_flag = '0' and tr.del_flag = '0' and th.del_flag = '0'
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="createTime != null and createTime !='' and createTime != 'all'">
|
|
|
|
<if test="createTime != null and createTime !='' and createTime != 'all'">
|
|
|
|
and DATE_FORMAT(tp.create_time,'%Y-%m') = #{createTime}
|
|
|
|
and DATE_FORMAT(tp.create_time,'%Y-%m') = #{createTime}
|
|
|
@ -192,7 +192,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
b.name
|
|
|
|
b.name
|
|
|
|
from t_record a LEFT JOIN t_patient b on a.patient_id = b.id
|
|
|
|
from t_record a LEFT JOIN t_patient b on a.patient_id = b.id
|
|
|
|
where TO_DAYS(a.create_time) = TO_DAYS(NOW())
|
|
|
|
where TO_DAYS(a.create_time) = TO_DAYS(NOW())
|
|
|
|
and b.del_flag = 0
|
|
|
|
and b.del_flag = 0 and a.del_flag = 0
|
|
|
|
<if test="doctorId != null "> and a.doctor_id = #{doctorId}</if>
|
|
|
|
<if test="doctorId != null "> and a.doctor_id = #{doctorId}</if>
|
|
|
|
<if test="hospitalId != null "> and a.hospital_id = #{hospitalId}</if>
|
|
|
|
<if test="hospitalId != null "> and a.hospital_id = #{hospitalId}</if>
|
|
|
|
ORDER BY a.create_time desc
|
|
|
|
ORDER BY a.create_time desc
|
|
|
@ -220,7 +220,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
from t_patient a
|
|
|
|
from t_patient a
|
|
|
|
inner JOIN t_record b on a.id = b.patient_id
|
|
|
|
inner JOIN t_record b on a.id = b.patient_id
|
|
|
|
where 1 = 1
|
|
|
|
where 1 = 1
|
|
|
|
and a.del_flag = 0
|
|
|
|
and a.del_flag = 0 and b.del_flag = 0
|
|
|
|
<if test="doctorId != null "> and b.doctor_id = #{doctorId}</if>
|
|
|
|
<if test="doctorId != null "> and b.doctor_id = #{doctorId}</if>
|
|
|
|
<if test="hospitalId != null "> and b.hospital_id = #{hospitalId}</if>
|
|
|
|
<if test="hospitalId != null "> and b.hospital_id = #{hospitalId}</if>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
@ -271,6 +271,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<if test="doctorId != null "> and t.doctor_id = #{doctorId}</if>
|
|
|
|
<if test="doctorId != null "> and t.doctor_id = #{doctorId}</if>
|
|
|
|
<if test="hospitalId != null "> and t.hospital_id = #{hospitalId}</if>
|
|
|
|
<if test="hospitalId != null "> and t.hospital_id = #{hospitalId}</if>
|
|
|
|
<if test="status != null and status != ''"> and t.status = #{status}</if>
|
|
|
|
<if test="status != null and status != ''"> and t.status = #{status}</if>
|
|
|
|
|
|
|
|
and t.del_flag = '0'
|
|
|
|
</where>
|
|
|
|
</where>
|
|
|
|
order by t.create_time desc
|
|
|
|
order by t.create_time desc
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
@ -310,8 +311,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="sex !=null and sex !=''">and tp.sex = #{sex} </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="identifier !=null and identifier != ''">and tp.identifier like concat('%', #{identifier}, '%')</if>
|
|
|
|
<if test="delFlag == null">
|
|
|
|
<if test="delFlag != null and delFlag != ''">
|
|
|
|
and td.del_flag = '0' and tp.del_flag = '0' and tr.del_flag = '0'
|
|
|
|
and tr.del_flag = #{delFlag}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="createTime != null and createTime !='' and createTime != 'all'">
|
|
|
|
<if test="createTime != null and createTime !='' and createTime != 'all'">
|
|
|
|
and DATE_FORMAT(tp.create_time,'%Y-%m') = #{createTime}
|
|
|
|
and DATE_FORMAT(tp.create_time,'%Y-%m') = #{createTime}
|
|
|
@ -345,7 +346,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<if test="sex !=null and sex !=''">and tp.sex = #{sex} </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="identifier !=null and identifier != ''">and tp.identifier like concat('%', #{identifier}, '%')</if>
|
|
|
|
<if test="delFlag == null">
|
|
|
|
<if test="delFlag == null">
|
|
|
|
and td.del_flag = '0' and tp.del_flag = '0' and tr.del_flag = '0'
|
|
|
|
and td.del_flag = '0' and tp.del_flag = '0' and tr.del_flag = '0' and th.del_flag = '0'
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="createTime != null and createTime !='' and createTime != 'all'">
|
|
|
|
<if test="createTime != null and createTime !='' and createTime != 'all'">
|
|
|
|
and DATE_FORMAT(tp.create_time,'%Y-%m') = #{createTime}
|
|
|
|
and DATE_FORMAT(tp.create_time,'%Y-%m') = #{createTime}
|
|
|
@ -435,7 +436,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
</delete>
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
|
|
<delete id="deleteTRecordByIds" parameterType="String">
|
|
|
|
<delete id="deleteTRecordByIds" parameterType="String">
|
|
|
|
delete from t_record where id in
|
|
|
|
update t_record set del_flag = '2',update_time = sysdate() where id in
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</foreach>
|
|
|
|