<?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.goldenwater.slaj.hidd.mapper.AttOrgExtMapper">
    <resultMap type="com.goldenwater.slaj.hidd.domain.AttOrgExt" id="AttOrgExtResult">
        <result property="guid" column="guid"/>
        <result property="socCreCode" column="soc_cre_code"/>
        <result property="orgGuid" column="org_guid"/>
        <result property="wiunName" column="wiun_name"/>
        <result property="orgClienType" column="org_clien_type"/>
        <result property="orgLevel" column="org_level"/>
        <result property="wiunCode" column="wiun_code"/>
        <result property="regName" column="reg_name"/>
        <result property="legRep" column="leg_rep"/>
        <result property="wiunWaoLong" column="wiun_wao_long"/>
        <result property="wiunWaoLat" column="wiun_wao_lat"/>
        <result property="wiunProp" column="wiun_prop"/>
        <result property="adminWiunGuid" column="admin_wiun_guid"/>
        <result property="ifWateEnte" column="if_wate_ente"/>
        <result property="proOrgGuid" column="pro_org_guid"/>
        <result property="isLegEnti" column="is_leg_enti"/>
        <result property="ifMiniDire" column="if_mini_dire"/>
        <result property="contrQualGrad" column="contr_qual_grad"/>
        <result property="contrCertNum" column="contr_cert_num"/>
        <result property="supQualGrad" column="sup_qual_grad"/>
        <result property="stanGrad" column="stan_grad"/>
        <result property="stanCertCode" column="stan_cert_code"/>
        <result property="safeProdLiceCode" column="safe_prod_lice_code"/>
        <result property="fundSour" column="fund_sour"/>
        <result property="estDate" column="est_date"/>
        <result property="regiCapi" column="regi_capi"/>
        <result property="addr" column="addr"/>
        <result property="regLoc" column="reg_loc"/>
        <result property="majAcci" column="maj_acci"/>
        <result property="legPers" column="leg_pers"/>
        <result property="legPersTel" column="leg_pers_tel"/>
        <result property="contaPers" column="conta_pers"/>
        <result property="contaPersMobi" column="conta_pers_mobi"/>
        <result property="contaPersAddr" column="conta_pers_addr"/>
        <result property="safetyLegPers" column="safety_leg_pers"/>
        <result property="safetyLegPersDuty" column="safety_leg_pers_duty"/>
        <result property="safetyLegPersTel" column="safety_leg_pers_tel"/>
        <result property="safetyLegPersMoph" column="safety_leg_pers_moph"/>
        <result property="safeProdConta" column="safe_prod_conta"/>
        <result property="safeProdContaTel" column="safe_prod_conta_tel"/>
        <result property="safeProdContaMpoh" column="safe_prod_conta_mpoh"/>
        <result property="accEmeConta" column="acc_eme_conta"/>
        <result property="accEmeContaMpoh" column="acc_eme_conta_mpoh"/>
        <result property="workPopNum" column="work_pop_num"/>
        <result property="safeManaOrg" column="safe_mana_org"/>
        <result property="fullManaTot" column="full_mana_tot"/>
        <result property="speOperPersTot" column="spe_oper_pers_tot"/>
        <result property="legRespPersTel" column="leg_resp_pers_tel"/>
        <result property="legRespPersFax" column="leg_resp_pers_fax"/>
        <result property="stanContaPers" column="stan_conta_pers"/>
        <result property="stanContaTel" column="stan_conta_tel"/>
        <result property="stanContaFax" column="stan_conta_fax"/>
        <result property="stanContaMoph" column="stan_conta_moph"/>
        <result property="stanContaEmail" column="stan_conta_email"/>
        <result property="note" column="note"/>
        <result property="collTime" column="coll_time"/>
        <result property="updTime" column="upd_time"/>
        <result property="recPers" column="rec_pers"/>
        <result property="orgType" column="org_type"/>
        <result property="confPersName" column="conf_pers_name"/>
        <result property="confPersMoph" column="conf_pers_moph"/>
        <result property="stat" column="stat"/>
        <result property="adGuid" column="ad_guid"/>
        <result property="wiunDuty" column="wiun_duty"/>
    </resultMap>
    <sql id="selectAttOrgExtVo">
        select guid, soc_cre_code, org_guid, wiun_name, org_clien_type, org_level, wiun_code,
               reg_name, leg_rep, wiun_wao_long, wiun_wao_lat, wiun_prop, admin_wiun_guid,
               if_wate_ente, pro_org_guid, is_leg_enti, if_mini_dire, contr_qual_grad,
               contr_cert_num, sup_qual_grad, stan_grad, stan_cert_code, safe_prod_lice_code,
               fund_sour, est_date, regi_capi, addr, reg_loc, maj_acci, leg_pers, leg_pers_tel,
               conta_pers, conta_pers_mobi, conta_pers_addr,
               safety_leg_pers, safety_leg_pers_duty, safety_leg_pers_tel, safety_leg_pers_moph,
               safe_prod_conta, safe_prod_conta_tel, safe_prod_conta_mpoh,
               acc_eme_conta, acc_eme_conta_mpoh,
               work_pop_num, safe_mana_org, full_mana_tot, spe_oper_pers_tot,
               leg_resp_pers_tel, leg_resp_pers_fax,
               stan_conta_pers, stan_conta_tel, stan_conta_fax, stan_conta_moph, stan_conta_email,
               note, coll_time, upd_time, rec_pers,
               org_type, conf_pers_name, conf_pers_moph, stat, ad_guid, wiun_duty
        from att_org_ext
    </sql>
    <select id="selectAttOrgExtByGuid" parameterType="String" resultMap="AttOrgExtResult">
        <include refid="selectAttOrgExtVo"/>
        where guid = #{guid}
    </select>
    <select id="selectAttOrgExtList" parameterType="com.goldenwater.slaj.hidd.domain.AttOrgExt" resultMap="AttOrgExtResult">
        <include refid="selectAttOrgExtVo"/>
        <where>
            <if test="orgGuid != null and orgGuid != ''">AND org_guid = #{orgGuid}</if>
            <if test="wiunName != null and wiunName != ''">AND wiun_name like '%' || #{wiunName} || '%'</if>
            <if test="wiunCode != null and wiunCode != ''">AND wiun_code = #{wiunCode}</if>
        </where>
    </select>
    <insert id="insertAttOrgExt" parameterType="com.goldenwater.slaj.hidd.domain.AttOrgExt">
        insert into att_org_ext (guid, soc_cre_code, org_guid, wiun_name, org_clien_type, org_level, wiun_code, reg_name, leg_rep, wiun_wao_long, wiun_wao_lat, wiun_prop, admin_wiun_guid, if_wate_ente, pro_org_guid, is_leg_enti, if_mini_dire, contr_qual_grad, contr_cert_num, sup_qual_grad, stan_grad, stan_cert_code, safe_prod_lice_code, fund_sour, est_date, regi_capi, addr, reg_loc, maj_acci, leg_pers, leg_pers_tel, conta_pers, conta_pers_mobi, conta_pers_addr, safety_leg_pers, safety_leg_pers_duty, safety_leg_pers_tel, safety_leg_pers_moph, safe_prod_conta, safe_prod_conta_tel, safe_prod_conta_mpoh, acc_eme_conta, acc_eme_conta_mpoh, work_pop_num, safe_mana_org, full_mana_tot, spe_oper_pers_tot, leg_resp_pers_tel, leg_resp_pers_fax, stan_conta_pers, stan_conta_tel, stan_conta_fax, stan_conta_moph, stan_conta_email, note, coll_time, upd_time, rec_pers, org_type, conf_pers_name, conf_pers_moph, stat, ad_guid, wiun_duty)
        values (#{guid}, #{socCreCode}, #{orgGuid}, #{wiunName}, #{orgClienType}, #{orgLevel}, #{wiunCode}, #{regName}, #{legRep}, #{wiunWaoLong}, #{wiunWaoLat}, #{wiunProp}, #{adminWiunGuid}, #{ifWateEnte}, #{proOrgGuid}, #{isLegEnti}, #{ifMiniDire}, #{contrQualGrad}, #{contrCertNum}, #{supQualGrad}, #{stanGrad}, #{stanCertCode}, #{safeProdLiceCode}, #{fundSour}, #{estDate}, #{regiCapi}, #{addr}, #{regLoc}, #{majAcci}, #{legPers}, #{legPersTel}, #{contaPers}, #{contaPersMobi}, #{contaPersAddr}, #{safetyLegPers}, #{safetyLegPersDuty}, #{safetyLegPersTel}, #{safetyLegPersMoph}, #{safeProdConta}, #{safeProdContaTel}, #{safeProdContaMpoh}, #{accEmeConta}, #{accEmeContaMpoh}, #{workPopNum}, #{safeManaOrg}, #{fullManaTot}, #{speOperPersTot}, #{legRespPersTel}, #{legRespPersFax}, #{stanContaPers}, #{stanContaTel}, #{stanContaFax}, #{stanContaMoph}, #{stanContaEmail}, #{note}, #{collTime}, #{updTime}, #{recPers}, #{orgType}, #{confPersName}, #{confPersMoph}, #{stat}, #{adGuid}, #{wiunDuty})
    </insert>
    <update id="updateAttOrgExt" parameterType="com.goldenwater.slaj.hidd.domain.AttOrgExt">
        update att_org_ext
        <set>
            <if test="socCreCode != null">soc_cre_code = #{socCreCode},</if>
            <if test="orgGuid != null">org_guid = #{orgGuid},</if>
            <if test="wiunName != null">wiun_name = #{wiunName},</if>
            <if test="orgClienType != null">org_clien_type = #{orgClienType},</if>
            <if test="orgLevel != null">org_level = #{orgLevel},</if>
            <if test="wiunCode != null">wiun_code = #{wiunCode},</if>
            <if test="regName != null">reg_name = #{regName},</if>
            <if test="legRep != null">leg_rep = #{legRep},</if>
            <if test="wiunWaoLong != null">wiun_wao_long = #{wiunWaoLong},</if>
            <if test="wiunWaoLat != null">wiun_wao_lat = #{wiunWaoLat},</if>
            <if test="wiunProp != null">wiun_prop = #{wiunProp},</if>
            <if test="adminWiunGuid != null">admin_wiun_guid = #{adminWiunGuid},</if>
            <if test="ifWateEnte != null">if_wate_ente = #{ifWateEnte},</if>
            <if test="proOrgGuid != null">pro_org_guid = #{proOrgGuid},</if>
            <if test="isLegEnti != null">is_leg_enti = #{isLegEnti},</if>
            <if test="ifMiniDire != null">if_mini_dire = #{ifMiniDire},</if>
            <if test="contrQualGrad != null">contr_qual_grad = #{contrQualGrad},</if>
            <if test="contrCertNum != null">contr_cert_num = #{contrCertNum},</if>
            <if test="supQualGrad != null">sup_qual_grad = #{supQualGrad},</if>
            <if test="stanGrad != null">stan_grad = #{stanGrad},</if>
            <if test="stanCertCode != null">stan_cert_code = #{stanCertCode},</if>
            <if test="safeProdLiceCode != null">safe_prod_lice_code = #{safeProdLiceCode},</if>
            <if test="fundSour != null">fund_sour = #{fundSour},</if>
            <if test="estDate != null">est_date = #{estDate},</if>
            <if test="regiCapi != null">regi_capi = #{regiCapi},</if>
            <if test="addr != null">addr = #{addr},</if>
            <if test="regLoc != null">reg_loc = #{regLoc},</if>
            <if test="majAcci != null">maj_acci = #{majAcci},</if>
            <if test="legPers != null">leg_pers = #{legPers},</if>
            <if test="legPersTel != null">leg_pers_tel = #{legPersTel},</if>
            <if test="contaPers != null">conta_pers = #{contaPers},</if>
            <if test="contaPersMobi != null">conta_pers_mobi = #{contaPersMobi},</if>
            <if test="contaPersAddr != null">conta_pers_addr = #{contaPersAddr},</if>
            <if test="safetyLegPers != null">safety_leg_pers = #{safetyLegPers},</if>
            <if test="safetyLegPersDuty != null">safety_leg_pers_duty = #{safetyLegPersDuty},</if>
            <if test="safetyLegPersTel != null">safety_leg_pers_tel = #{safetyLegPersTel},</if>
            <if test="safetyLegPersMoph != null">safety_leg_pers_moph = #{safetyLegPersMoph},</if>
            <if test="safeProdConta != null">safe_prod_conta = #{safeProdConta},</if>
            <if test="safeProdContaTel != null">safe_prod_conta_tel = #{safeProdContaTel},</if>
            <if test="safeProdContaMpoh != null">safe_prod_conta_mpoh = #{safeProdContaMpoh},</if>
            <if test="accEmeConta != null">acc_eme_conta = #{accEmeConta},</if>
            <if test="accEmeContaMpoh != null">acc_eme_conta_mpoh = #{accEmeContaMpoh},</if>
            <if test="workPopNum != null">work_pop_num = #{workPopNum},</if>
            <if test="safeManaOrg != null">safe_mana_org = #{safeManaOrg},</if>
            <if test="fullManaTot != null">full_mana_tot = #{fullManaTot},</if>
            <if test="speOperPersTot != null">spe_oper_pers_tot = #{speOperPersTot},</if>
            <if test="legRespPersTel != null">leg_resp_pers_tel = #{legRespPersTel},</if>
            <if test="legRespPersFax != null">leg_resp_pers_fax = #{legRespPersFax},</if>
            <if test="stanContaPers != null">stan_conta_pers = #{stanContaPers},</if>
            <if test="stanContaTel != null">stan_conta_tel = #{stanContaTel},</if>
            <if test="stanContaFax != null">stan_conta_fax = #{stanContaFax},</if>
            <if test="stanContaMoph != null">stan_conta_moph = #{stanContaMoph},</if>
            <if test="stanContaEmail != null">stan_conta_email = #{stanContaEmail},</if>
            <if test="note != null">note = #{note},</if>
            <if test="collTime != null">coll_time = #{collTime},</if>
            <if test="updTime != null">upd_time = #{updTime},</if>
            <if test="recPers != null">rec_pers = #{recPers},</if>
            <if test="orgType != null">org_type = #{orgType},</if>
            <if test="confPersName != null">conf_pers_name = #{confPersName},</if>
            <if test="confPersMoph != null">conf_pers_moph = #{confPersMoph},</if>
            <if test="stat != null">stat = #{stat},</if>
            <if test="adGuid != null">ad_guid = #{adGuid},</if>
            <if test="wiunDuty != null">wiun_duty = #{wiunDuty},</if>
        </set>
        where guid = #{guid}
    </update>
    <delete id="deleteAttOrgExtByGuid" parameterType="String">
        delete
        from att_org_ext
        where guid = #{guid}
    </delete>
    <delete id="deleteAttOrgExtByGuids" parameterType="String">
        delete from att_org_ext where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>
