<?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.PatMedInspectionMapper"> 
 | 
  
 | 
    <resultMap type="com.smartor.domain.PatMedInspection" id="PatMedInspectionResult"> 
 | 
        <result property="id" column="id"/> 
 | 
        <result property="projecttype" column="projecttype"/> 
 | 
        <result property="inhospno" column="inhospno"/> 
 | 
        <result property="patidHis" column="patid_his"/> 
 | 
        <result property="idcardno" column="idcardno"/> 
 | 
        <result property="patname" column="patname"/> 
 | 
        <result property="telcode" column="telcode"/> 
 | 
        <result property="adviceId" column="adviceId"/> 
 | 
        <result property="appliyid" column="appliyid"/> 
 | 
        <result property="priority" column="priority"/> 
 | 
        <result property="orgid" column="orgid"/> 
 | 
        <result property="delFlag" column="del_flag"/> 
 | 
        <result property="drcode" column="drcode"/> 
 | 
        <result property="drname" column="drname"/> 
 | 
        <result property="deptcode" column="deptcode"/> 
 | 
        <result property="deptname" column="deptname"/> 
 | 
        <result property="opendate" column="opendate"/> 
 | 
        <result property="operatorId" column="operator_id"/> 
 | 
        <result property="operatorName" column="operator_name"/> 
 | 
        <result property="operatorDate" column="operator_date"/> 
 | 
        <result property="money" column="money"/> 
 | 
        <result property="updateBy" column="update_by"/> 
 | 
        <result property="updateDate" column="update_date"/> 
 | 
        <result property="createBy" column="create_by"/> 
 | 
        <result property="createTime" column="create_time"/> 
 | 
        <result property="startTime" column="start_time"/> 
 | 
        <result property="projectId" column="project_id"/> 
 | 
        <result property="projectName" column="project_name"/> 
 | 
        <result property="diagid" column="diagid"/> 
 | 
        <result property="diagname" column="diagname"/> 
 | 
        <result property="partId" column="part_id"/> 
 | 
        <result property="partName" column="part_name"/> 
 | 
        <result property="typeId" column="type_id"/> 
 | 
        <result property="typeName" column="type_name"/> 
 | 
        <result property="filmFlag" column="film_flag"/> 
 | 
        <result property="bedFlag" column="bed_flag"/> 
 | 
        <result property="pushFlag" column="push_flag"/> 
 | 
        <result property="urgentFlag" column="urgent_flag"/> 
 | 
        <result property="nostartFlag" column="nostart_flag"/> 
 | 
        <result property="pguid" column="pguid"/> 
 | 
        <result property="guid" column="guid"/> 
 | 
        <result property="pid" column="pid"/> 
 | 
    </resultMap> 
 | 
  
 | 
    <sql id="selectPatMedInspectionVo"> 
 | 
        select id, 
 | 
               projecttype, 
 | 
               inhospno, 
 | 
               patid_his, 
 | 
               idcardno, 
 | 
               patname, 
 | 
               telcode, 
 | 
               adviceId, 
 | 
               appliyid, 
 | 
               priority, 
 | 
               orgid, 
 | 
               del_flag, 
 | 
               drcode, 
 | 
               drname, 
 | 
               deptcode, 
 | 
               deptname, 
 | 
               opendate, 
 | 
               operator_id, 
 | 
               operator_name, 
 | 
               operator_date, 
 | 
               money, 
 | 
               update_by, 
 | 
               update_date, 
 | 
               create_by, 
 | 
               create_time, 
 | 
               start_time, 
 | 
               project_id, 
 | 
               project_name, 
 | 
               diagid, 
 | 
               diagname, 
 | 
               part_id, 
 | 
               part_name, 
 | 
               type_id, 
 | 
               type_name, 
 | 
               film_flag, 
 | 
               bed_flag, 
 | 
               push_flag, 
 | 
               urgent_flag, 
 | 
               nostart_flag, 
 | 
               pguid, 
 | 
               guid, 
 | 
               pid 
 | 
        from pat_med_inspection 
 | 
    </sql> 
 | 
  
 | 
    <select id="selectPatMedInspectionList" parameterType="com.smartor.domain.PatMedInspection" 
 | 
            resultMap="PatMedInspectionResult"> 
 | 
        <include refid="selectPatMedInspectionVo"/> 
 | 
        <where> 
 | 
            <if test="projecttype != null">and projecttype = #{projecttype}</if> 
 | 
            <if test="inhospno != null">and inhospno = #{inhospno}</if> 
 | 
            <if test="patidHis != null">and patid_his = #{patidHis}</if> 
 | 
            <if test="idcardno != null">and idcardno = #{idcardno}</if> 
 | 
            <if test="patname != null">and patname = #{patname}</if> 
 | 
            <if test="telcode != null ">and telcode = #{telcode}</if> 
 | 
            <if test="adviceId != null">and adviceId = #{adviceId}</if> 
 | 
            <if test="appliyid != null">and appliyid = #{appliyid}</if> 
 | 
            <if test="priority != null">and priority = #{priority}</if> 
 | 
            <if test="orgid != null">and orgid = #{orgid}</if> 
 | 
            <if test="delFlag != null">and del_flag = #{delFlag}</if> 
 | 
            <if test="drcode != null">and drcode = #{drcode}</if> 
 | 
            <if test="drname != null">and drname = #{drname}</if> 
 | 
            <if test="deptcode != null">and deptcode = #{deptcode}</if> 
 | 
            <if test="deptname != null">and deptname = #{deptname}</if> 
 | 
            <if test="opendate != null">and opendate = #{opendate}</if> 
 | 
            <if test="operatorId != null">and operator_id = #{operatorId}</if> 
 | 
            <if test="operatorName != null">and operator_name = #{operatorName}</if> 
 | 
            <if test="operatorDate != null">and operator_date = #{operatorDate}</if> 
 | 
            <if test="money != null">and money = #{money}</if> 
 | 
            <if test="updateBy != null">and update_by = #{updateBy}</if> 
 | 
            <if test="updateDate != null">and update_date = #{updateDate}</if> 
 | 
            <if test="createBy != null">and create_by = #{createBy}</if> 
 | 
            <if test="createTime != null">and create_time = #{createTime}</if> 
 | 
            <if test="startTime != null">and start_time = #{startTime}</if> 
 | 
            <if test="projectId != null">and project_id = #{projectId}</if> 
 | 
            <if test="projectName != null">and project_name = #{projectName}</if> 
 | 
            <if test="diagid != null">and diagid = #{diagid}</if> 
 | 
            <if test="diagname != null">and diagname = #{diagname}</if> 
 | 
            <if test="partId != null">and part_id = #{partId}</if> 
 | 
            <if test="partName != null">and part_name = #{partName}</if> 
 | 
            <if test="typeId != null">and type_id = #{typeId}</if> 
 | 
            <if test="typeName != null">and type_name = #{type}</if> 
 | 
            <if test="filmFlag != null">and film_flag = #{filmFlag}</if> 
 | 
            <if test="bedFlag != null">and bed_flag = #{bedFlag}</if> 
 | 
            <if test="pushFlag != null">and push_flag = #{pushFlag}</if> 
 | 
            <if test="urgentFlag != null">and urgent_flag = #{urgentFlag}</if> 
 | 
            <if test="nostartFlag != null">and nostart_flag = #{nostartFlag}</if> 
 | 
            <if test="pguid != null">and pguid = #{pguid}</if> 
 | 
            <if test="guid != null">and guid = #{guid}</if> 
 | 
            <if test="pid != null">and pid = #{pid}</if> 
 | 
        </where> 
 | 
--         order by update_time desc 
 | 
    </select> 
 | 
  
 | 
    <select id="selectPatMedInspectionById" parameterType="Long" resultMap="PatMedInspectionResult"> 
 | 
        <include refid="selectPatMedInspectionVo"/> 
 | 
        where id = #{id} 
 | 
    </select> 
 | 
  
 | 
    <insert id="insertPatMedInspection" parameterType="com.smartor.domain.PatMedInspection" useGeneratedKeys="true" 
 | 
            keyProperty="id"> 
 | 
        insert into pat_med_inspection 
 | 
        <trim prefix="(" suffix=")" suffixOverrides=","> 
 | 
            <if test="projecttype != null">projecttype,</if> 
 | 
            <if test="inhospno != null">inhospno,</if> 
 | 
            <if test="patidHis != null">patid_his,</if> 
 | 
            <if test="idcardno != null">idcardno,</if> 
 | 
            <if test="patname != null">patname,</if> 
 | 
            <if test="telcode != null">telcode,</if> 
 | 
            <if test="adviceId != null">adviceId,</if> 
 | 
            <if test="appliyid != null">appliyid,</if> 
 | 
            <if test="priority != null">priority,</if> 
 | 
            <if test="orgid != null">orgid,</if> 
 | 
            <if test="delFlag != null">del_flag,</if> 
 | 
            <if test="drcode != null">drcode,</if> 
 | 
            <if test="drname != null">drname,</if> 
 | 
            <if test="deptcode != null">deptcode,</if> 
 | 
            <if test="deptname != null">deptname,</if> 
 | 
            <if test="opendate != null">opendate,</if> 
 | 
            <if test="operatorId != null">operator_id,</if> 
 | 
            <if test="operatorName != null">operator_name,</if> 
 | 
            <if test="operatorDate != null">operator_date,</if> 
 | 
            <if test="money != null">money,</if> 
 | 
            <if test="updateBy != null">update_by,</if> 
 | 
            <if test="updateDate != null">update_date,</if> 
 | 
            <if test="createBy != null">create_by,</if> 
 | 
            <if test="createTime != null">create_time,</if> 
 | 
            <if test="startTime != null">start_time,</if> 
 | 
            <if test="projectId != null">project_id,</if> 
 | 
            <if test="projectName != null">project_name,</if> 
 | 
            <if test="diagid != null">diagid,</if> 
 | 
            <if test="diagname != null">diagname,</if> 
 | 
            <if test="partId != null">part_id,</if> 
 | 
            <if test="partName != null">part_name,</if> 
 | 
            <if test="typeId != null">type_id,</if> 
 | 
            <if test="typeName != null">type_name,</if> 
 | 
            <if test="filmFlag != null">film_flag,</if> 
 | 
            <if test="bedFlag != null">bed_flag,</if> 
 | 
            <if test="pushFlag != null">push_flag,</if> 
 | 
            <if test="urgentFlag != null">urgent_flag,</if> 
 | 
            <if test="nostartFlag != null">nostart_flag,</if> 
 | 
            <if test="pguid != null">pguid,</if> 
 | 
            <if test="guid != null">guid,</if> 
 | 
            <if test="pid != null">pid,</if> 
 | 
        </trim> 
 | 
        <trim prefix="values (" suffix=")" suffixOverrides=","> 
 | 
            <if test="projecttype != null">#{projecttype},</if> 
 | 
            <if test="inhospno != null">#{inhospno},</if> 
 | 
            <if test="patidHis != null">#{patidHis},</if> 
 | 
            <if test="idcardno != null">#{idcardno},</if> 
 | 
            <if test="patname != null">#{patname},</if> 
 | 
            <if test="telcode != null">#{telcode},</if> 
 | 
            <if test="adviceId != null">#{adviceId},</if> 
 | 
            <if test="appliyid != null">#{appliyid},</if> 
 | 
            <if test="priority != null">#{priority},</if> 
 | 
            <if test="orgid != null">#{orgid},</if> 
 | 
            <if test="delFlag != null">#{delFlag},</if> 
 | 
            <if test="drcode != null">#{drcode},</if> 
 | 
            <if test="drname != null">#{drname},</if> 
 | 
            <if test="deptcode != null">#{deptcode},</if> 
 | 
            <if test="deptname != null">#{deptname},</if> 
 | 
            <if test="opendate != null">#{opendate},</if> 
 | 
            <if test="operatorId != null">#{operatorId},</if> 
 | 
            <if test="operatorName != null">#{operatorName},</if> 
 | 
            <if test="operatorDate != null">#{operatorDate},</if> 
 | 
            <if test="money != null">#{money},</if> 
 | 
            <if test="updateBy != null">#{updateBy},</if> 
 | 
            <if test="updateDate != null">#{updateDate},</if> 
 | 
            <if test="createBy != null">#{createBy},</if> 
 | 
            <if test="createTime != null">#{createTime},</if> 
 | 
            <if test="startTime != null">#{startTime},</if> 
 | 
            <if test="projectId != null">#{projectId},</if> 
 | 
            <if test="projectName != null">#{projectName},</if> 
 | 
            <if test="diagid != null">#{diagid},</if> 
 | 
            <if test="diagname != null">#{diagname},</if> 
 | 
            <if test="partId != null">#{partId},</if> 
 | 
            <if test="partName != null">#{partName},</if> 
 | 
            <if test="typeId != null">#{typeId},</if> 
 | 
            <if test="typeName != null">#{typeName},</if> 
 | 
            <if test="filmFlag != null">#{filmFlag},</if> 
 | 
            <if test="bedFlag != null">#{bedFlag},</if> 
 | 
            <if test="pushFlag != null">#{pushFlag},</if> 
 | 
            <if test="urgentFlag != null">#{urgentFlag},</if> 
 | 
            <if test="nostartFlag != null">#{nostartFlag},</if> 
 | 
            <if test="pguid != null">#{pguid},</if> 
 | 
            <if test="guid != null">#{guid},</if> 
 | 
            <if test="pid != null">#{pid},</if> 
 | 
        </trim> 
 | 
    </insert> 
 | 
  
 | 
    <update id="updatePatMedInspection" parameterType="com.smartor.domain.PatMedInspection"> 
 | 
        update pat_med_inspection 
 | 
        <trim prefix="SET" suffixOverrides=","> 
 | 
            <if test="projecttype != null">projecttype = #{projecttype},</if> 
 | 
            <if test="inhospno != null">inhospno = #{inhospno},</if> 
 | 
            <if test="patidHis != null">patid_his = #{patidHis},</if> 
 | 
            <if test="idcardno != null">idcardno = #{idcardno},</if> 
 | 
            <if test="patname != null">patname = #{patname},</if> 
 | 
            <if test="telcode != null">telcode = #{telcode},</if> 
 | 
            <if test="adviceId != null">adviceId = #{adviceId},</if> 
 | 
            <if test="appliyid != null">appliyid = #{appliyid},</if> 
 | 
            <if test="priority != null">priority = #{priority},</if> 
 | 
            <if test="orgid != null">orgid = #{orgid},</if> 
 | 
            <if test="delFlag != null">del_flag = #{delFlag},</if> 
 | 
            <if test="drcode != null">drcode = #{drcode},</if> 
 | 
            <if test="drname != null">drname = #{drname},</if> 
 | 
            <if test="deptcode != null">deptcode = #{deptcode},</if> 
 | 
            <if test="deptname != null">deptname = #{deptname},</if> 
 | 
            <if test="opendate != null">opendate = #{opendate},</if> 
 | 
            <if test="operatorId != null">operator_id = #{operatorId},</if> 
 | 
            <if test="operatorName != null">operator_name = #{operatorName},</if> 
 | 
            <if test="operatorDate != null">operator_date = #{operatorDate},</if> 
 | 
            <if test="money != null">money = #{money},</if> 
 | 
            <if test="updateBy != null">update_by = #{updateBy},</if> 
 | 
            <if test="updateDate != null">update_date = #{updateDate},</if> 
 | 
            <if test="createBy != null">create_by = #{createBy},</if> 
 | 
            <if test="createTime != null">create_time = #{createTime},</if> 
 | 
            <if test="startTime != null">start_time = #{startTime},</if> 
 | 
            <if test="projectId != null">project_id = #{projectId},</if> 
 | 
            <if test="projectName != null">project_name = #{projectName},</if> 
 | 
            <if test="diagid != null">diagid = #{diagid},</if> 
 | 
            <if test="diagname != null">diagname = #{diagname},</if> 
 | 
            <if test="partId != null">part_id = #{partId},</if> 
 | 
            <if test="partName != null">part_name = #{partName},</if> 
 | 
            <if test="typeId != null">type_id = #{typeId},</if> 
 | 
            <if test="typeName != null">type_name = #{typeName},</if> 
 | 
            <if test="filmFlag != null">film_flag = #{filmFlag},</if> 
 | 
            <if test="bedFlag != null">bed_flag = #{bedFlag},</if> 
 | 
            <if test="pushFlag != null">push_flag = #{pushFlag},</if> 
 | 
            <if test="urgentFlag != null">urgent_flag = #{urgentFlag},</if> 
 | 
            <if test="nostartFlag != null">nostart_flag = #{nostartFlag},</if> 
 | 
        </trim> 
 | 
        where projecttype = #{projecttype} 
 | 
        and inhospno = #{inhospno} 
 | 
        and patid_his = #{patidHis} 
 | 
        and idcardno = #{idcardno} 
 | 
    </update> 
 | 
  
 | 
    <delete id="deletePatMedInspectionById" parameterType="Long"> 
 | 
        delete 
 | 
        from pat_med_inspection 
 | 
        where id = #{id} 
 | 
    </delete> 
 | 
  
 | 
    <delete id="deletePatMedInspectionByIds" parameterType="String"> 
 | 
        delete from pat_med_inspection where id in 
 | 
        <foreach item="id" collection="array" open="(" separator="," close=")"> 
 | 
            #{id} 
 | 
        </foreach> 
 | 
    </delete> 
 | 
</mapper> 
 |