<?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.hazard.mapper.BisHachRecRepMapper">
    <resultMap type="com.goldenwater.slaj.hazard.domain.BisHachRecRep" id="BisHachRecRepResult">
        <result property="guid" column="guid"/>
        <result property="repGuid" column="rep_guid"/>
        <result property="repOrgGuid" column="rep_org_guid"/>
        <result property="repAct" column="rep_act"/>
        <result property="returnDesc" column="return_desc"/>
        <result property="ifImplSche" column="if_impl_sche"/>
        <result property="sadFirst" column="sad_first"/>
        <result property="ifSateMeet" column="if_sate_meet"/>
        <result property="sadSecond" column="sad_second"/>
        <result property="ifDgrsRec" column="if_dgrs_rec"/>
        <result property="sadThird" column="sad_third"/>
        <result property="oporgNum" column="oporg_num"/>
        <result property="sadFourth" column="sad_fourth"/>
        <result property="oporgProp" column="oporg_prop"/>
        <result property="sadFifth" column="sad_fifth"/>
        <result property="hachTypeNum" column="hach_type_num"/>
        <result property="sadSixth" column="sad_sixth"/>
        <result property="hazMajNum" column="haz_maj_num"/>
        <result property="sadSeventh" column="sad_seventh"/>
        <result property="hiddNum" column="hidd_num"/>
        <result property="sadEighth" column="sad_eighth"/>
        <result property="hazMajRec" column="haz_maj_rec"/>
        <result property="sadNinth" column="sad_ninth"/>
        <result property="oporgPersNum" column="oporg_pers_num"/>
        <result property="sadTenth" column="sad_tenth"/>
        <result property="systNum" column="syst_num"/>
        <result property="sadEleventh" column="sad_eleventh"/>
        <result property="hachEmerPlan" column="hach_emer_plan"/>
        <result property="sadTwelfth" column="sad_twelfth"/>
        <result property="trainEmeNum" column="train_eme_num"/>
        <result property="sadThirtth" column="sad_thirtth"/>
        <result property="note" column="note"/>
        <result property="collTime" column="coll_time"/>
        <result property="updTime" column="upd_time"/>
        <result property="recPers" column="rec_pers"/>
    </resultMap>
    <sql id="selectBisHachRecRepVo">
        select guid, rep_guid, rep_org_guid, rep_act, return_desc, if_impl_sche,
               sad_first, if_sate_meet, sad_second, if_dgrs_rec, sad_third, oporg_num,
               sad_fourth, oporg_prop, sad_fifth, hach_type_num, sad_sixth, haz_maj_num,
               sad_seventh, hidd_num, sad_eighth, haz_maj_rec, sad_ninth, oporg_pers_num,
               sad_tenth, syst_num, sad_eleventh, hach_emer_plan, sad_twelfth, train_eme_num,
               sad_thirtth, note, coll_time, upd_time, rec_pers
        from bis_hach_rec_rep
    </sql>
    <select id="selectBisHachRecRepByGuid" parameterType="String" resultMap="BisHachRecRepResult">
        <include refid="selectBisHachRecRepVo"/>
        where guid = #{guid}
    </select>
    <select id="selectBisHachRecRepList" parameterType="com.goldenwater.slaj.hazard.domain.BisHachRecRep" resultMap="BisHachRecRepResult">
        <include refid="selectBisHachRecRepVo"/>
        <where>
            <if test="repGuid != null and repGuid != ''">AND rep_guid = #{repGuid}</if>
            <if test="guid != null and guid != ''">AND guid = #{guid}</if>
        </where>
    </select>
    <insert id="insertBisHachRecRep" parameterType="com.goldenwater.slaj.hazard.domain.BisHachRecRep">
        insert into bis_hach_rec_rep (
            guid, rep_guid, rep_org_guid, rep_act, return_desc, if_impl_sche,
            sad_first, if_sate_meet, sad_second, if_dgrs_rec, sad_third, oporg_num,
            sad_fourth, oporg_prop, sad_fifth, hach_type_num, sad_sixth, haz_maj_num,
            sad_seventh, hidd_num, sad_eighth, haz_maj_rec, sad_ninth, oporg_pers_num,
            sad_tenth, syst_num, sad_eleventh, hach_emer_plan, sad_twelfth, train_eme_num,
            sad_thirtth, note, coll_time, upd_time, rec_pers
        ) values (
            #{guid}, #{repGuid}, #{repOrgGuid}, #{repAct}, #{returnDesc}, #{ifImplSche},
            #{sadFirst}, #{ifSateMeet}, #{sadSecond}, #{ifDgrsRec}, #{sadThird}, #{oporgNum},
            #{sadFourth}, #{oporgProp}, #{sadFifth}, #{hachTypeNum}, #{sadSixth}, #{hazMajNum},
            #{sadSeventh}, #{hiddNum}, #{sadEighth}, #{hazMajRec}, #{sadNinth}, #{oporgPersNum},
            #{sadTenth}, #{systNum}, #{sadEleventh}, #{hachEmerPlan}, #{sadTwelfth}, #{trainEmeNum},
            #{sadThirtth}, #{note}, #{collTime}, #{updTime}, #{recPers}
        )
    </insert>
    <update id="updateBisHachRecRep" parameterType="com.goldenwater.slaj.hazard.domain.BisHachRecRep">
        update bis_hach_rec_rep
        <set>
            <if test="repGuid != null">rep_guid = #{repGuid},</if>
            <if test="repOrgGuid != null">rep_org_guid = #{repOrgGuid},</if>
            <if test="repAct != null">rep_act = #{repAct},</if>
            <if test="returnDesc != null">return_desc = #{returnDesc},</if>
            <if test="ifImplSche != null">if_impl_sche = #{ifImplSche},</if>
            <if test="sadFirst != null">sad_first = #{sadFirst},</if>
            <if test="ifSateMeet != null">if_sate_meet = #{ifSateMeet},</if>
            <if test="sadSecond != null">sad_second = #{sadSecond},</if>
            <if test="ifDgrsRec != null">if_dgrs_rec = #{ifDgrsRec},</if>
            <if test="sadThird != null">sad_third = #{sadThird},</if>
            <if test="oporgNum != null">oporg_num = #{oporgNum},</if>
            <if test="sadFourth != null">sad_fourth = #{sadFourth},</if>
            <if test="oporgProp != null">oporg_prop = #{oporgProp},</if>
            <if test="sadFifth != null">sad_fifth = #{sadFifth},</if>
            <if test="hachTypeNum != null">hach_type_num = #{hachTypeNum},</if>
            <if test="sadSixth != null">sad_sixth = #{sadSixth},</if>
            <if test="hazMajNum != null">haz_maj_num = #{hazMajNum},</if>
            <if test="sadSeventh != null">sad_seventh = #{sadSeventh},</if>
            <if test="hiddNum != null">hidd_num = #{hiddNum},</if>
            <if test="sadEighth != null">sad_eighth = #{sadEighth},</if>
            <if test="hazMajRec != null">haz_maj_rec = #{hazMajRec},</if>
            <if test="sadNinth != null">sad_ninth = #{sadNinth},</if>
            <if test="oporgPersNum != null">oporg_pers_num = #{oporgPersNum},</if>
            <if test="sadTenth != null">sad_tenth = #{sadTenth},</if>
            <if test="systNum != null">syst_num = #{systNum},</if>
            <if test="sadEleventh != null">sad_eleventh = #{sadEleventh},</if>
            <if test="hachEmerPlan != null">hach_emer_plan = #{hachEmerPlan},</if>
            <if test="sadTwelfth != null">sad_twelfth = #{sadTwelfth},</if>
            <if test="trainEmeNum != null">train_eme_num = #{trainEmeNum},</if>
            <if test="sadThirtth != null">sad_thirtth = #{sadThirtth},</if>
            <if test="note != null">note = #{note},</if>
            <if test="updTime != null">upd_time = #{updTime},</if>
            <if test="recPers != null">rec_pers = #{recPers},</if>
        </set>
        where guid = #{guid}
    </update>
    <delete id="deleteBisHachRecRepByGuid" parameterType="String">
        delete from bis_hach_rec_rep where guid = #{guid}
    </delete>
    <delete id="deleteBisHachRecRepByGuids" parameterType="String">
        delete from bis_hach_rec_rep where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>
