|  |  | 
 |  |  | <?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"> | 
 |  |  |         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | 
 |  |  |         "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 
 |  |  | <mapper namespace="com.smartor.mapper.Icd10Mapper"> | 
 |  |  |      | 
 |  |  |  | 
 |  |  |     <resultMap type="com.smartor.domain.Icd10" id="Icd10Result"> | 
 |  |  |         <result property="icdid"    column="icdid"    /> | 
 |  |  |         <result property="icdcode"    column="icdcode"    /> | 
 |  |  |         <result property="icdname"    column="icdname"    /> | 
 |  |  |         <result property="icdpym"    column="icdpym"    /> | 
 |  |  |         <result property="icdwbm"    column="icdwbm"    /> | 
 |  |  |         <result property="orgid"    column="orgid"    /> | 
 |  |  |         <result property="delFlag"    column="del_flag"    /> | 
 |  |  |         <result property="createBy"    column="create_by"    /> | 
 |  |  |         <result property="createTime"    column="create_time"    /> | 
 |  |  |         <result property="updateBy"    column="update_by"    /> | 
 |  |  |         <result property="updateTime"    column="update_time"    /> | 
 |  |  |         <result property="pid"    column="pid"    /> | 
 |  |  |         <result property="guid"    column="guid"    /> | 
 |  |  |         <result property="icdid" column="icdid"/> | 
 |  |  |         <result property="icdcode" column="icdcode"/> | 
 |  |  |         <result property="icdname" column="icdname"/> | 
 |  |  |         <result property="icdpym" column="icdpym"/> | 
 |  |  |         <result property="icdwbm" column="icdwbm"/> | 
 |  |  |         <result property="orgid" column="orgid"/> | 
 |  |  |         <result property="delFlag" column="del_flag"/> | 
 |  |  |         <result property="createBy" column="create_by"/> | 
 |  |  |         <result property="createTime" column="create_time"/> | 
 |  |  |         <result property="updateBy" column="update_by"/> | 
 |  |  |         <result property="updateTime" column="update_time"/> | 
 |  |  |         <result property="pid" column="pid"/> | 
 |  |  |         <result property="guid" column="guid"/> | 
 |  |  |         <result property="lastflag" column="lastflag"/> | 
 |  |  |         <result property="chimedflag" column="chimedflag"/> | 
 |  |  |         <result property="hisIcdid" column="his_icdid"/> | 
 |  |  |     </resultMap> | 
 |  |  |  | 
 |  |  |     <sql id="selectIcd10Vo"> | 
 |  |  |         select icdid, icdcode, icdname, icdpym, icdwbm, orgid, del_flag, create_by, create_time, update_by, update_time, pid, guid from icd10 | 
 |  |  |         select icdid, | 
 |  |  |                icdcode, | 
 |  |  |                his_icdid, | 
 |  |  |                lastflag, | 
 |  |  |                chimedflag, | 
 |  |  |                icdname, | 
 |  |  |                icdpym, | 
 |  |  |                icdwbm, | 
 |  |  |                orgid, | 
 |  |  |                del_flag, | 
 |  |  |                create_by, | 
 |  |  |                create_time, | 
 |  |  |                update_by, | 
 |  |  |                update_time, | 
 |  |  |                pid, | 
 |  |  |                guid | 
 |  |  |         from icd10 | 
 |  |  |     </sql> | 
 |  |  |  | 
 |  |  |     <select id="selectIcd10List" parameterType="com.smartor.domain.Icd10" resultMap="Icd10Result"> | 
 |  |  |         <include refid="selectIcd10Vo"/> | 
 |  |  |         <where>   | 
 |  |  |             <if test="icdcode != null  and icdcode != ''"> and icdcode = #{icdcode}</if> | 
 |  |  |             <if test="icdname != null  and icdname != ''"> and icdname like concat('%', #{icdname}, '%')</if> | 
 |  |  |             <if test="icdpym != null  and icdpym != ''"> and icdpym = #{icdpym}</if> | 
 |  |  |             <if test="icdwbm != null  and icdwbm != ''"> and icdwbm = #{icdwbm}</if> | 
 |  |  |             <if test="orgid != null  and orgid != ''"> and orgid = #{orgid}</if> | 
 |  |  |             <if test="pid != null "> and pid = #{pid}</if> | 
 |  |  |             <if test="guid != null  and guid != ''"> and guid = #{guid}</if> | 
 |  |  |         <where> | 
 |  |  |             del_flag=0 | 
 |  |  |             <if test="icdcode != null  and icdcode != ''">and icdcode = #{icdcode}</if> | 
 |  |  |             <if test="lastflag != null  and lastflag != ''">and lastflag = #{lastflag}</if> | 
 |  |  |             <if test="chimedflag != null  and chimedflag != ''">and chimedflag = #{chimedflag}</if> | 
 |  |  |             <if test="icdname != null  and icdname != ''">and icdname like concat('%', #{icdname}, '%')</if> | 
 |  |  |             <if test="icdpym != null  and icdpym != ''">and icdpym = #{icdpym}</if> | 
 |  |  |             <if test="icdwbm != null  and icdwbm != ''">and icdwbm = #{icdwbm}</if> | 
 |  |  |             <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if> | 
 |  |  |             <if test="pid != null ">and pid = #{pid}</if> | 
 |  |  |             <if test="guid != null  and guid != ''">and guid = #{guid}</if> | 
 |  |  |             <if test="hisIcdid != null  and hisIcdid != ''">and his_icdid = #{hisIcdid}</if> | 
 |  |  |         </where> | 
 |  |  |     </select> | 
 |  |  |      | 
 |  |  |  | 
 |  |  |     <select id="selectIcd10ByIcdid" parameterType="Long" resultMap="Icd10Result"> | 
 |  |  |         <include refid="selectIcd10Vo"/> | 
 |  |  |         where icdid = #{icdid} | 
 |  |  |     </select> | 
 |  |  |          | 
 |  |  |  | 
 |  |  |     <insert id="insertIcd10" parameterType="com.smartor.domain.Icd10" useGeneratedKeys="true" keyProperty="icdid"> | 
 |  |  |         insert into icd10 | 
 |  |  |         <trim prefix="(" suffix=")" suffixOverrides=","> | 
 |  |  | 
 |  |  |             <if test="updateTime != null">update_time,</if> | 
 |  |  |             <if test="pid != null">pid,</if> | 
 |  |  |             <if test="guid != null">guid,</if> | 
 |  |  |          </trim> | 
 |  |  |             <if test="lastflag != null  and lastflag != ''">lastflag,</if> | 
 |  |  |             <if test="chimedflag != null  and chimedflag != ''">chimedflag,</if> | 
 |  |  |             <if test="hisIcdid != null  and hisIcdid != ''">his_icdid,</if> | 
 |  |  |         </trim> | 
 |  |  |         <trim prefix="values (" suffix=")" suffixOverrides=","> | 
 |  |  |             <if test="icdcode != null">#{icdcode},</if> | 
 |  |  |             <if test="icdname != null">#{icdname},</if> | 
 |  |  | 
 |  |  |             <if test="updateTime != null">#{updateTime},</if> | 
 |  |  |             <if test="pid != null">#{pid},</if> | 
 |  |  |             <if test="guid != null">#{guid},</if> | 
 |  |  |          </trim> | 
 |  |  |             <if test="lastflag != null  and lastflag != ''">#{lastflag},</if> | 
 |  |  |             <if test="chimedflag != null  and chimedflag != ''">#{chimedflag},</if> | 
 |  |  |             <if test="hisIcdid != null  and hisIcdid != ''">#{hisIcdid},</if> | 
 |  |  |         </trim> | 
 |  |  |     </insert> | 
 |  |  |  | 
 |  |  |     <insert id="batchIcd10"> | 
 |  |  |         insert into icd10 | 
 |  |  |         ( | 
 |  |  |         icdcode, | 
 |  |  |         icdname, | 
 |  |  |         icdpym, | 
 |  |  |         icdwbm, | 
 |  |  |         orgid, | 
 |  |  |         del_flag, | 
 |  |  |         create_by, | 
 |  |  |         create_time, | 
 |  |  |         update_by, | 
 |  |  |         update_time, | 
 |  |  |         pid, | 
 |  |  |         guid, | 
 |  |  |         lastflag, | 
 |  |  |         chimedflag, | 
 |  |  |         his_icdid) | 
 |  |  |         VALUES | 
 |  |  |         <foreach collection="list" item="item" separator=","> | 
 |  |  |             ( | 
 |  |  |             #{item.icdcode}, | 
 |  |  |             #{item.icdname}, | 
 |  |  |             #{item.icdpym}, | 
 |  |  |             #{item.icdwbm}, | 
 |  |  |             #{item.orgid}, | 
 |  |  |             #{item.delFlag}, | 
 |  |  |             #{item.createBy}, | 
 |  |  |             #{item.createTime}, | 
 |  |  |             #{item.updateBy}, | 
 |  |  |             #{item.updateTime}, | 
 |  |  |             #{item.pid}, | 
 |  |  |             #{item.guid}, | 
 |  |  |             #{item.lastflag}, | 
 |  |  |             #{item.chimedflag}, | 
 |  |  |             #{item.hisIcdid} | 
 |  |  |             ) | 
 |  |  |         </foreach> | 
 |  |  |     </insert> | 
 |  |  |  | 
 |  |  |     <update id="updateIcd10" parameterType="com.smartor.domain.Icd10"> | 
 |  |  | 
 |  |  |             <if test="updateTime != null">update_time = #{updateTime},</if> | 
 |  |  |             <if test="pid != null">pid = #{pid},</if> | 
 |  |  |             <if test="guid != null">guid = #{guid},</if> | 
 |  |  |             <if test="lastflag != null  and lastflag != ''">lastflag = #{lastflag},</if> | 
 |  |  |             <if test="chimedflag != null  and chimedflag != ''">chimedflag = #{chimedflag},</if> | 
 |  |  |             <if test="hisIcdid != null  and hisIcdid != ''">his_icdid = #{hisIcdid},</if> | 
 |  |  |         </trim> | 
 |  |  |         where icdid = #{icdid} | 
 |  |  |     </update> | 
 |  |  |  | 
 |  |  |     <delete id="deleteIcd10ByIcdid" parameterType="Long"> | 
 |  |  |         delete from icd10 where icdid = #{icdid} | 
 |  |  |         delete | 
 |  |  |         from icd10 | 
 |  |  |         where icdid = #{icdid} | 
 |  |  |     </delete> | 
 |  |  |  | 
 |  |  |     <delete id="deleteIcd10ByIcdids" parameterType="String"> | 
 |  |  |         delete from icd10 where icdid in  | 
 |  |  |         delete from icd10 where icdid in | 
 |  |  |         <foreach item="icdid" collection="array" open="(" separator="," close=")"> | 
 |  |  |             #{icdid} | 
 |  |  |         </foreach> | 
 |  |  |     </delete> | 
 |  |  | </mapper> | 
 |  |  | </mapper> |