| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.smartor.mapper.PatArchiveMapper"> |
| | | |
| | | <resultMap type="PatArchive" id="PatArchiveResult"> |
| | | <resultMap type="com.smartor.domain.PatArchive" id="PatArchiveResult"> |
| | | <result property="patid" column="patid" /> |
| | | <result property="name" column="name" /> |
| | | <result property="sex" column="sex" /> |
| | |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="isupload" column="isupload" /> |
| | | <result property="uploadTime" column="upload_time" /> |
| | | <result property="tag" column="tag"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectPatArchiveVo"> |
| | | select patid, name, sex, iccardno, birthdate, age, source, archivetime, archiveby, telcode, relativetelcode, iccardtype, orgid, openid, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time from pat_archive |
| | | select patid, |
| | | name, |
| | | sex, |
| | | iccardno, |
| | | birthdate, |
| | | age, |
| | | source, |
| | | archivetime, |
| | | archiveby, |
| | | telcode, |
| | | relativetelcode, |
| | | iccardtype, |
| | | orgid, |
| | | openid, |
| | | del_flag, |
| | | update_by, |
| | | update_time, |
| | | create_by, |
| | | create_time, |
| | | isupload, |
| | | upload_time |
| | | from pat_archive |
| | | </sql> |
| | | |
| | | <select id="selectPatArchiveList" parameterType="PatArchive" resultMap="PatArchiveResult"> |
| | | <select id="selectPatArchiveList" parameterType="com.smartor.domain.PatArchive" resultMap="PatArchiveResult"> |
| | | <include refid="selectPatArchiveVo"/> |
| | | <where> |
| | | <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> |
| | |
| | | <if test="source != null "> and source = #{source}</if> |
| | | <if test="telcode != null and telcode != ''"> and telcode = #{telcode}</if> |
| | | <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if> |
| | | <if test="patid != null and patid != ''">and patid = #{patid}</if> |
| | | <if test="isupload != null "> and isupload = #{isupload}</if> |
| | | <if test="uploadTime != null "> and upload_time = #{uploadTime}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <select id="patInfoByContion" parameterType="com.smartor.domain.PatArchiveReq" resultMap="PatArchiveResult"> |
| | | select |
| | | a.patid, |
| | | a.name, |
| | | a.sex, |
| | | c.tagname as tag, |
| | | a.iccardtype, |
| | | a.iccardno, |
| | | a.age, |
| | | a.telcode, |
| | | a.create_time, |
| | | a.update_time, |
| | | a.birthdate |
| | | from pat_archive a,pat_archivetag b ,base_tag c |
| | | <where> |
| | | a.patid = b.patid and b.tagid = c.tagid |
| | | <if test="name != null and name != ''">and a.name like concat('%', #{name}, '%')</if> |
| | | <if test="iccardno != null and iccardno != ''">and iccardno = #{iccardno}</if> |
| | | <if test="telcode != null and telcode != ''">and telcode = #{telcode}</if> |
| | | <if test="tagId != null and tagId != ''">and c.tagid = #{tagId}</if> |
| | | </where> |
| | | </select> |
| | | |
| | |
| | | where patid = #{patid} |
| | | </select> |
| | | |
| | | <insert id="insertPatArchive" parameterType="PatArchive" useGeneratedKeys="true" keyProperty="patid"> |
| | | <insert id="insertPatArchive" parameterType="com.smartor.domain.PatArchive" useGeneratedKeys="true" keyProperty="patid"> |
| | | insert into pat_archive |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="name != null">name,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updatePatArchive" parameterType="PatArchive"> |
| | | <update id="updatePatArchive" parameterType="com.smartor.domain.PatArchive"> |
| | | update pat_archive |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="name != null">name = #{name},</if> |
| | |
| | | </update> |
| | | |
| | | <delete id="deletePatArchiveByPatid" parameterType="Long"> |
| | | delete from pat_archive where patid = #{patid} |
| | | delete |
| | | from pat_archive |
| | | where patid = #{patid} |
| | | </delete> |
| | | |
| | | <delete id="deletePatArchiveByPatids" parameterType="String"> |
| | |
| | | #{patid} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | </mapper> |