<?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.sooka.system.mapper.TGuijiHealthcommissionTjxxMapper">
    
    <resultMap type="TGuijiHealthcommissionTjxx" id="TGuijiHealthcommissionTjxxResult">
        <result property="id"    column="id"    />
        <result property="createTime"    column="create_time"    />
        <result property="cdTime"    column="cd_time"    />
        <result property="cdBatch"    column="cd_batch"    />
        <result property="cdOperation"    column="cd_operation"    />
        <result property="cdSource"    column="cd_source"    />
        <result property="cardid"    column="cardid"    />
        <result property="persontype"    column="persontype"    />
        <result property="unitname"    column="unitname"    />
        <result property="username"    column="username"    />
        <result property="sex"    column="sex"    />
        <result property="age"    column="age"    />
        <result property="nature"    column="nature"    />
        <result property="education"    column="education"    />
        <result property="cellphone"    column="cellphone"    />
        <result property="worktype"    column="worktype"    />
        <result property="workage"    column="workage"    />
        <result property="unitnatrue"    column="unitnatrue"    />
        <result property="photourl"    column="photourl"    />
        <result property="licenseurl"    column="licenseurl"    />
        <result property="adddate"    column="adddate"    />
        <result property="apptime"    column="apptime"    />
        <result property="iChecked"    column="i_checked"    />
        <result property="iCheckuser"    column="i_checkuser"    />
        <result property="yChecked"    column="y_checked"    />
        <result property="yCheckuser"    column="y_checkuser"    />
        <result property="hLevlgm"    column="h_levlgm"    />
        <result property="hJiagan"    column="h_jiagan"    />
        <result property="hXqzym"    column="h_xqzym"    />
        <result property="hLijiganjun"    column="h_lijiganjun"    />
        <result property="hShanghan"    column="h_shanghan"    />
        <result property="hMeidu"    column="h_meidu"    />
        <result property="hHiv"    column="h_hiv"    />
        <result property="hConclusion"    column="h_conclusion"    />
        <result property="hChecked"    column="h_checked"    />
        <result property="hCheckuser"    column="h_checkuser"    />
        <result property="tHasganyan"    column="t_hasganyan"    />
        <result property="tGanyan"    column="t_ganyan"    />
        <result property="tHasshanghan"    column="t_hasshanghan"    />
        <result property="tShanghan"    column="t_shanghan"    />
        <result property="tHasliji"    column="t_hasliji"    />
        <result property="tLiji"    column="t_liji"    />
        <result property="tHasfeijiehe"    column="t_hasfeijiehe"    />
        <result property="tFeijiehe"    column="t_feijiehe"    />
        <result property="tHaspifubing"    column="t_haspifubing"    />
        <result property="tPifubing"    column="t_pifubing"    />
        <result property="tHasotherdisease"    column="t_hasotherdisease"    />
        <result property="tOtherdisease"    column="t_otherdisease"    />
        <result property="tXin"    column="t_xin"    />
        <result property="tGan"    column="t_gan"    />
        <result property="tPi"    column="t_pi"    />
        <result property="tFei"    column="t_fei"    />
        <result property="tPifu"    column="t_pifu"    />
        <result property="tOther"    column="t_other"    />
        <result property="tX"    column="t_x"    />
        <result property="tPhenomenon"    column="t_phenomenon"    />
        <result property="xChecked"    column="x_checked"    />
        <result property="xCheckuser"    column="x_checkuser"    />
        <result property="tConclusion"    column="t_conclusion"    />
        <result property="tChecked"    column="t_checked"    />
        <result property="tCheckuser"    column="t_checkuser"    />
        <result property="bChecked"    column="b_checked"    />
        <result property="bCheckuser"    column="b_checkuser"    />
        <result property="cChecked"    column="c_checked"    />
        <result property="cCheckuser"    column="c_checkuser"    />
    </resultMap>

    <sql id="selectTGuijiHealthcommissionTjxxVo">
        select id, create_time, cd_time, cd_batch, cd_operation, cd_source, cardid, persontype, unitname, username, sex, age, nature, education, cellphone, worktype, workage, unitnatrue, photourl, licenseurl, adddate, apptime, i_checked, i_checkuser, y_checked, y_checkuser, h_levlgm, h_jiagan, h_xqzym, h_lijiganjun, h_shanghan, h_meidu, h_hiv, h_conclusion, h_checked, h_checkuser, t_hasganyan, t_ganyan, t_hasshanghan, t_shanghan, t_hasliji, t_liji, t_hasfeijiehe, t_feijiehe, t_haspifubing, t_pifubing, t_hasotherdisease, t_otherdisease, t_xin, t_gan, t_pi, t_fei, t_pifu, t_other, t_x, t_phenomenon, x_checked, x_checkuser, t_conclusion, t_checked, t_checkuser, b_checked, b_checkuser, c_checked, c_checkuser from t_guiji_healthcommission_tjxx
    </sql>

    <select id="selectTGuijiHealthcommissionTjxxList" parameterType="TGuijiHealthcommissionTjxx" resultMap="TGuijiHealthcommissionTjxxResult">
        <include refid="selectTGuijiHealthcommissionTjxxVo"/>
        <where>  
            <if test="cardid != null  and cardid != ''"> and cardid = #{cardid}</if>
            <if test="username != null  and username != ''"> and username like concat('%', #{username}, '%')</if>
        </where>
        order by create_time desc
    </select>
    
    <select id="selectTGuijiHealthcommissionTjxxById" parameterType="String" resultMap="TGuijiHealthcommissionTjxxResult">
        <include refid="selectTGuijiHealthcommissionTjxxVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertTGuijiHealthcommissionTjxx" parameterType="TGuijiHealthcommissionTjxx">
        insert into t_guiji_healthcommission_tjxx
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="createTime != null">create_time,</if>
            <if test="cdTime != null">cd_time,</if>
            <if test="cdBatch != null">cd_batch,</if>
            <if test="cdOperation != null">cd_operation,</if>
            <if test="cdSource != null">cd_source,</if>
            <if test="cardid != null">cardid,</if>
            <if test="persontype != null">persontype,</if>
            <if test="unitname != null">unitname,</if>
            <if test="username != null">username,</if>
            <if test="sex != null">sex,</if>
            <if test="age != null">age,</if>
            <if test="nature != null">nature,</if>
            <if test="education != null">education,</if>
            <if test="cellphone != null">cellphone,</if>
            <if test="worktype != null">worktype,</if>
            <if test="workage != null">workage,</if>
            <if test="unitnatrue != null">unitnatrue,</if>
            <if test="photourl != null">photourl,</if>
            <if test="licenseurl != null">licenseurl,</if>
            <if test="adddate != null">adddate,</if>
            <if test="apptime != null">apptime,</if>
            <if test="iChecked != null">i_checked,</if>
            <if test="iCheckuser != null">i_checkuser,</if>
            <if test="yChecked != null">y_checked,</if>
            <if test="yCheckuser != null">y_checkuser,</if>
            <if test="hLevlgm != null">h_levlgm,</if>
            <if test="hJiagan != null">h_jiagan,</if>
            <if test="hXqzym != null">h_xqzym,</if>
            <if test="hLijiganjun != null">h_lijiganjun,</if>
            <if test="hShanghan != null">h_shanghan,</if>
            <if test="hMeidu != null">h_meidu,</if>
            <if test="hHiv != null">h_hiv,</if>
            <if test="hConclusion != null">h_conclusion,</if>
            <if test="hChecked != null">h_checked,</if>
            <if test="hCheckuser != null">h_checkuser,</if>
            <if test="tHasganyan != null">t_hasganyan,</if>
            <if test="tGanyan != null">t_ganyan,</if>
            <if test="tHasshanghan != null">t_hasshanghan,</if>
            <if test="tShanghan != null">t_shanghan,</if>
            <if test="tHasliji != null">t_hasliji,</if>
            <if test="tLiji != null">t_liji,</if>
            <if test="tHasfeijiehe != null">t_hasfeijiehe,</if>
            <if test="tFeijiehe != null">t_feijiehe,</if>
            <if test="tHaspifubing != null">t_haspifubing,</if>
            <if test="tPifubing != null">t_pifubing,</if>
            <if test="tHasotherdisease != null">t_hasotherdisease,</if>
            <if test="tOtherdisease != null">t_otherdisease,</if>
            <if test="tXin != null">t_xin,</if>
            <if test="tGan != null">t_gan,</if>
            <if test="tPi != null">t_pi,</if>
            <if test="tFei != null">t_fei,</if>
            <if test="tPifu != null">t_pifu,</if>
            <if test="tOther != null">t_other,</if>
            <if test="tX != null">t_x,</if>
            <if test="tPhenomenon != null">t_phenomenon,</if>
            <if test="xChecked != null">x_checked,</if>
            <if test="xCheckuser != null">x_checkuser,</if>
            <if test="tConclusion != null">t_conclusion,</if>
            <if test="tChecked != null">t_checked,</if>
            <if test="tCheckuser != null">t_checkuser,</if>
            <if test="bChecked != null">b_checked,</if>
            <if test="bCheckuser != null">b_checkuser,</if>
            <if test="cChecked != null">c_checked,</if>
            <if test="cCheckuser != null">c_checkuser,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="cdTime != null">#{cdTime},</if>
            <if test="cdBatch != null">#{cdBatch},</if>
            <if test="cdOperation != null">#{cdOperation},</if>
            <if test="cdSource != null">#{cdSource},</if>
            <if test="cardid != null">#{cardid},</if>
            <if test="persontype != null">#{persontype},</if>
            <if test="unitname != null">#{unitname},</if>
            <if test="username != null">#{username},</if>
            <if test="sex != null">#{sex},</if>
            <if test="age != null">#{age},</if>
            <if test="nature != null">#{nature},</if>
            <if test="education != null">#{education},</if>
            <if test="cellphone != null">#{cellphone},</if>
            <if test="worktype != null">#{worktype},</if>
            <if test="workage != null">#{workage},</if>
            <if test="unitnatrue != null">#{unitnatrue},</if>
            <if test="photourl != null">#{photourl},</if>
            <if test="licenseurl != null">#{licenseurl},</if>
            <if test="adddate != null">#{adddate},</if>
            <if test="apptime != null">#{apptime},</if>
            <if test="iChecked != null">#{iChecked},</if>
            <if test="iCheckuser != null">#{iCheckuser},</if>
            <if test="yChecked != null">#{yChecked},</if>
            <if test="yCheckuser != null">#{yCheckuser},</if>
            <if test="hLevlgm != null">#{hLevlgm},</if>
            <if test="hJiagan != null">#{hJiagan},</if>
            <if test="hXqzym != null">#{hXqzym},</if>
            <if test="hLijiganjun != null">#{hLijiganjun},</if>
            <if test="hShanghan != null">#{hShanghan},</if>
            <if test="hMeidu != null">#{hMeidu},</if>
            <if test="hHiv != null">#{hHiv},</if>
            <if test="hConclusion != null">#{hConclusion},</if>
            <if test="hChecked != null">#{hChecked},</if>
            <if test="hCheckuser != null">#{hCheckuser},</if>
            <if test="tHasganyan != null">#{tHasganyan},</if>
            <if test="tGanyan != null">#{tGanyan},</if>
            <if test="tHasshanghan != null">#{tHasshanghan},</if>
            <if test="tShanghan != null">#{tShanghan},</if>
            <if test="tHasliji != null">#{tHasliji},</if>
            <if test="tLiji != null">#{tLiji},</if>
            <if test="tHasfeijiehe != null">#{tHasfeijiehe},</if>
            <if test="tFeijiehe != null">#{tFeijiehe},</if>
            <if test="tHaspifubing != null">#{tHaspifubing},</if>
            <if test="tPifubing != null">#{tPifubing},</if>
            <if test="tHasotherdisease != null">#{tHasotherdisease},</if>
            <if test="tOtherdisease != null">#{tOtherdisease},</if>
            <if test="tXin != null">#{tXin},</if>
            <if test="tGan != null">#{tGan},</if>
            <if test="tPi != null">#{tPi},</if>
            <if test="tFei != null">#{tFei},</if>
            <if test="tPifu != null">#{tPifu},</if>
            <if test="tOther != null">#{tOther},</if>
            <if test="tX != null">#{tX},</if>
            <if test="tPhenomenon != null">#{tPhenomenon},</if>
            <if test="xChecked != null">#{xChecked},</if>
            <if test="xCheckuser != null">#{xCheckuser},</if>
            <if test="tConclusion != null">#{tConclusion},</if>
            <if test="tChecked != null">#{tChecked},</if>
            <if test="tCheckuser != null">#{tCheckuser},</if>
            <if test="bChecked != null">#{bChecked},</if>
            <if test="bCheckuser != null">#{bCheckuser},</if>
            <if test="cChecked != null">#{cChecked},</if>
            <if test="cCheckuser != null">#{cCheckuser},</if>
         </trim>
    </insert>

    <update id="updateTGuijiHealthcommissionTjxx" parameterType="TGuijiHealthcommissionTjxx">
        update t_guiji_healthcommission_tjxx
        <trim prefix="SET" suffixOverrides=",">
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="cdTime != null">cd_time = #{cdTime},</if>
            <if test="cdBatch != null">cd_batch = #{cdBatch},</if>
            <if test="cdOperation != null">cd_operation = #{cdOperation},</if>
            <if test="cdSource != null">cd_source = #{cdSource},</if>
            <if test="cardid != null">cardid = #{cardid},</if>
            <if test="persontype != null">persontype = #{persontype},</if>
            <if test="unitname != null">unitname = #{unitname},</if>
            <if test="username != null">username = #{username},</if>
            <if test="sex != null">sex = #{sex},</if>
            <if test="age != null">age = #{age},</if>
            <if test="nature != null">nature = #{nature},</if>
            <if test="education != null">education = #{education},</if>
            <if test="cellphone != null">cellphone = #{cellphone},</if>
            <if test="worktype != null">worktype = #{worktype},</if>
            <if test="workage != null">workage = #{workage},</if>
            <if test="unitnatrue != null">unitnatrue = #{unitnatrue},</if>
            <if test="photourl != null">photourl = #{photourl},</if>
            <if test="licenseurl != null">licenseurl = #{licenseurl},</if>
            <if test="adddate != null">adddate = #{adddate},</if>
            <if test="apptime != null">apptime = #{apptime},</if>
            <if test="iChecked != null">i_checked = #{iChecked},</if>
            <if test="iCheckuser != null">i_checkuser = #{iCheckuser},</if>
            <if test="yChecked != null">y_checked = #{yChecked},</if>
            <if test="yCheckuser != null">y_checkuser = #{yCheckuser},</if>
            <if test="hLevlgm != null">h_levlgm = #{hLevlgm},</if>
            <if test="hJiagan != null">h_jiagan = #{hJiagan},</if>
            <if test="hXqzym != null">h_xqzym = #{hXqzym},</if>
            <if test="hLijiganjun != null">h_lijiganjun = #{hLijiganjun},</if>
            <if test="hShanghan != null">h_shanghan = #{hShanghan},</if>
            <if test="hMeidu != null">h_meidu = #{hMeidu},</if>
            <if test="hHiv != null">h_hiv = #{hHiv},</if>
            <if test="hConclusion != null">h_conclusion = #{hConclusion},</if>
            <if test="hChecked != null">h_checked = #{hChecked},</if>
            <if test="hCheckuser != null">h_checkuser = #{hCheckuser},</if>
            <if test="tHasganyan != null">t_hasganyan = #{tHasganyan},</if>
            <if test="tGanyan != null">t_ganyan = #{tGanyan},</if>
            <if test="tHasshanghan != null">t_hasshanghan = #{tHasshanghan},</if>
            <if test="tShanghan != null">t_shanghan = #{tShanghan},</if>
            <if test="tHasliji != null">t_hasliji = #{tHasliji},</if>
            <if test="tLiji != null">t_liji = #{tLiji},</if>
            <if test="tHasfeijiehe != null">t_hasfeijiehe = #{tHasfeijiehe},</if>
            <if test="tFeijiehe != null">t_feijiehe = #{tFeijiehe},</if>
            <if test="tHaspifubing != null">t_haspifubing = #{tHaspifubing},</if>
            <if test="tPifubing != null">t_pifubing = #{tPifubing},</if>
            <if test="tHasotherdisease != null">t_hasotherdisease = #{tHasotherdisease},</if>
            <if test="tOtherdisease != null">t_otherdisease = #{tOtherdisease},</if>
            <if test="tXin != null">t_xin = #{tXin},</if>
            <if test="tGan != null">t_gan = #{tGan},</if>
            <if test="tPi != null">t_pi = #{tPi},</if>
            <if test="tFei != null">t_fei = #{tFei},</if>
            <if test="tPifu != null">t_pifu = #{tPifu},</if>
            <if test="tOther != null">t_other = #{tOther},</if>
            <if test="tX != null">t_x = #{tX},</if>
            <if test="tPhenomenon != null">t_phenomenon = #{tPhenomenon},</if>
            <if test="xChecked != null">x_checked = #{xChecked},</if>
            <if test="xCheckuser != null">x_checkuser = #{xCheckuser},</if>
            <if test="tConclusion != null">t_conclusion = #{tConclusion},</if>
            <if test="tChecked != null">t_checked = #{tChecked},</if>
            <if test="tCheckuser != null">t_checkuser = #{tCheckuser},</if>
            <if test="bChecked != null">b_checked = #{bChecked},</if>
            <if test="bCheckuser != null">b_checkuser = #{bCheckuser},</if>
            <if test="cChecked != null">c_checked = #{cChecked},</if>
            <if test="cCheckuser != null">c_checkuser = #{cCheckuser},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteTGuijiHealthcommissionTjxxById" parameterType="String">
        delete from t_guiji_healthcommission_tjxx where id = #{id}
    </delete>

    <delete id="deleteTGuijiHealthcommissionTjxxByIds" parameterType="String">
        delete from t_guiji_healthcommission_tjxx where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>

</mapper>