<?xml version="1.0" encoding="UTF-8" ?>
|
<!DOCTYPE mapper
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.smartor.mapper.PatMedRegistrationMapper">
|
|
<resultMap type="com.smartor.domain.PatMedRegistration" id="PatMedRegistrationResult">
|
<result property="registid" column="registid"/>
|
<result property="serialnum" column="serialnum"/>
|
<result property="patid" column="patid"/>
|
<result property="hospitalname" column="hospitalname"/>
|
<result property="hospitalcode" column="hospitalcode"/>
|
<result property="deptcode" column="deptcode"/>
|
<result property="deptname" column="deptname"/>
|
<result property="deptid" column="deptid"/>
|
<result property="state" column="state"/>
|
<result property="appointmenttime" column="appointmenttime"/>
|
<result property="appointmenttimetype" column="appointmenttimetype"/>
|
<result property="appointmentcode" column="appointmentcode"/>
|
<result property="appointmentbegintime" column="appointmentbegintime"/>
|
<result property="appointmentendtime" column="appointmentendtime"/>
|
<result property="orgid" column="orgid"/>
|
<result property="delFlag" column="del_flag"/>
|
<result property="updateBy" column="update_by"/>
|
<result property="updateTime" column="update_time"/>
|
<result property="createBy" column="create_by"/>
|
<result property="createTime" column="create_time"/>
|
<result property="isupload" column="isupload"/>
|
<result property="uploadTime" column="upload_time"/>
|
<result property="pid" column="pid"/>
|
<result property="guid" column="guid"/>
|
</resultMap>
|
|
<sql id="selectPatMedRegistrationVo">
|
select registid,
|
serialnum,
|
patid,
|
hospitalname,
|
hospitalcode,
|
deptcode,
|
deptname,
|
deptid,
|
state,
|
appointmenttime,
|
appointmenttimetype,
|
appointmentcode,
|
appointmentbegintime,
|
appointmentendtime,
|
orgid,
|
del_flag,
|
update_by,
|
update_time,
|
create_by,
|
create_time,
|
isupload,
|
upload_time,
|
pid,
|
guid
|
from pat_med_registration
|
</sql>
|
|
<select id="selectPatMedRegistrationList" parameterType="com.smartor.domain.PatMedRegistration"
|
resultMap="PatMedRegistrationResult">
|
<include refid="selectPatMedRegistrationVo"/>
|
<where>
|
<if test="serialnum != null and serialnum != ''">and serialnum = #{serialnum}</if>
|
<if test="patid != null ">and patid = #{patid}</if>
|
<if test="hospitalname != null and hospitalname != ''">and hospitalname like concat('%', #{hospitalname},
|
'%')
|
</if>
|
<if test="hospitalcode != null and hospitalcode != ''">and hospitalcode = #{hospitalcode}</if>
|
<if test="deptcode != null and deptcode != ''">and deptcode = #{deptcode}</if>
|
<if test="deptname != null and deptname != ''">and deptname like concat('%', #{deptname}, '%')</if>
|
<if test="deptid != null ">and deptid = #{deptid}</if>
|
<if test="state != null ">and state = #{state}</if>
|
<if test="appointmenttime != null ">and appointmenttime = #{appointmenttime}</if>
|
<if test="appointmenttimetype != null ">and appointmenttimetype = #{appointmenttimetype}</if>
|
<if test="appointmentcode != null and appointmentcode != ''">and appointmentcode = #{appointmentcode}</if>
|
<if test="appointmentbegintime != null ">and appointmentbegintime = #{appointmentbegintime}</if>
|
<if test="appointmentendtime != null ">and appointmentendtime = #{appointmentendtime}</if>
|
<if test="orgid != null and orgid != ''">and orgid = #{orgid}</if>
|
<if test="isupload != null ">and isupload = #{isupload}</if>
|
<if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
|
<if test="pid != null ">and pid = #{pid}</if>
|
<if test="guid != null and guid != ''">and guid = #{guid}</if>
|
</where>
|
order by create_time desc
|
</select>
|
|
<select id="selectPatMedRegistrationByRegistid" parameterType="Long" resultMap="PatMedRegistrationResult">
|
<include refid="selectPatMedRegistrationVo"/>
|
where registid = #{registid}
|
</select>
|
|
<insert id="insertPatMedRegistration" parameterType="com.smartor.domain.PatMedRegistration">
|
insert into pat_med_registration
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="registid != null">registid,</if>
|
<if test="serialnum != null">serialnum,</if>
|
<if test="patid != null">patid,</if>
|
<if test="hospitalname != null">hospitalname,</if>
|
<if test="hospitalcode != null">hospitalcode,</if>
|
<if test="deptcode != null">deptcode,</if>
|
<if test="deptname != null">deptname,</if>
|
<if test="deptid != null">deptid,</if>
|
<if test="state != null">state,</if>
|
<if test="appointmenttime != null">appointmenttime,</if>
|
<if test="appointmenttimetype != null">appointmenttimetype,</if>
|
<if test="appointmentcode != null">appointmentcode,</if>
|
<if test="appointmentbegintime != null">appointmentbegintime,</if>
|
<if test="appointmentendtime != null">appointmentendtime,</if>
|
<if test="orgid != null">orgid,</if>
|
<if test="delFlag != null">del_flag,</if>
|
<if test="updateBy != null">update_by,</if>
|
<if test="updateTime != null">update_time,</if>
|
<if test="createBy != null">create_by,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="isupload != null">isupload,</if>
|
<if test="uploadTime != null">upload_time,</if>
|
<if test="pid != null">pid,</if>
|
<if test="guid != null">guid,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="registid != null">#{registid},</if>
|
<if test="serialnum != null">#{serialnum},</if>
|
<if test="patid != null">#{patid},</if>
|
<if test="hospitalname != null">#{hospitalname},</if>
|
<if test="hospitalcode != null">#{hospitalcode},</if>
|
<if test="deptcode != null">#{deptcode},</if>
|
<if test="deptname != null">#{deptname},</if>
|
<if test="deptid != null">#{deptid},</if>
|
<if test="state != null">#{state},</if>
|
<if test="appointmenttime != null">#{appointmenttime},</if>
|
<if test="appointmenttimetype != null">#{appointmenttimetype},</if>
|
<if test="appointmentcode != null">#{appointmentcode},</if>
|
<if test="appointmentbegintime != null">#{appointmentbegintime},</if>
|
<if test="appointmentendtime != null">#{appointmentendtime},</if>
|
<if test="orgid != null">#{orgid},</if>
|
<if test="delFlag != null">#{delFlag},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
<if test="createBy != null">#{createBy},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="isupload != null">#{isupload},</if>
|
<if test="uploadTime != null">#{uploadTime},</if>
|
<if test="pid != null">#{pid},</if>
|
<if test="guid != null">#{guid},</if>
|
</trim>
|
</insert>
|
|
<update id="updatePatMedRegistration" parameterType="com.smartor.domain.PatMedRegistration">
|
update pat_med_registration
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="serialnum != null">serialnum = #{serialnum},</if>
|
<if test="patid != null">patid = #{patid},</if>
|
<if test="hospitalname != null">hospitalname = #{hospitalname},</if>
|
<if test="hospitalcode != null">hospitalcode = #{hospitalcode},</if>
|
<if test="deptcode != null">deptcode = #{deptcode},</if>
|
<if test="deptname != null">deptname = #{deptname},</if>
|
<if test="deptid != null">deptid = #{deptid},</if>
|
<if test="state != null">state = #{state},</if>
|
<if test="appointmenttime != null">appointmenttime = #{appointmenttime},</if>
|
<if test="appointmenttimetype != null">appointmenttimetype = #{appointmenttimetype},</if>
|
<if test="appointmentcode != null">appointmentcode = #{appointmentcode},</if>
|
<if test="appointmentbegintime != null">appointmentbegintime = #{appointmentbegintime},</if>
|
<if test="appointmentendtime != null">appointmentendtime = #{appointmentendtime},</if>
|
<if test="orgid != null">orgid = #{orgid},</if>
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="isupload != null">isupload = #{isupload},</if>
|
<if test="uploadTime != null">upload_time = #{uploadTime},</if>
|
<if test="pid != null">pid = #{pid},</if>
|
<if test="guid != null">guid = #{guid},</if>
|
</trim>
|
where registid = #{registid}
|
</update>
|
|
<delete id="deletePatMedRegistrationByRegistid" parameterType="Long">
|
delete
|
from pat_med_registration
|
where registid = #{registid}
|
</delete>
|
|
<update id="deletePatMedRegistrationByRegistids" parameterType="Long">
|
update pat_med_registration
|
<trim prefix="SET" suffixOverrides=",">
|
del_flag =1
|
</trim>
|
where registid in
|
<foreach item="registid" collection="array" open="(" separator="," close=")">
|
#{registid}
|
</foreach>
|
</update>
|
</mapper>
|