<?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.TBusiHazardArchiveMapper">
    <resultMap type="com.goldenwater.slaj.hazard.domain.TBusiHazardArchive" id="TBusiHazardArchiveResult">
        <result property="guid" column="guid"/>
        <result property="hazIdenGuid" column="haz_iden_guid"/>
        <result property="orgGuid" column="org_guid"/>
        <result property="status" column="status"/>
        <result property="wiunGuid" column="wiun_guid"/>
        <result property="createPer" column="create_per"/>
        <result property="createTime" column="create_time"/>
        <result property="updatePer" column="update_per"/>
        <result property="updateTime" column="update_time"/>
    </resultMap>
    <sql id="selectTBusiHazardArchiveVo">
        select guid, haz_iden_guid, org_guid, status, wiun_guid, create_per, create_time, update_per, update_time
        from t_busi_hazard_archive
    </sql>
    <select id="selectTBusiHazardArchiveByGuid" parameterType="String" resultMap="TBusiHazardArchiveResult">
        <include refid="selectTBusiHazardArchiveVo"/>
        where guid = #{guid}
    </select>
    <select id="selectTBusiHazardArchiveList" parameterType="com.goldenwater.slaj.hazard.domain.TBusiHazardArchive" resultMap="TBusiHazardArchiveResult">
        <include refid="selectTBusiHazardArchiveVo"/>
        <where>
            <if test="orgGuid != null and orgGuid != ''">AND org_guid = #{orgGuid}</if>
            <if test="hazIdenGuid != null and hazIdenGuid != ''">AND haz_iden_guid = #{hazIdenGuid}</if>
            <if test="guid != null and guid != ''">AND guid = #{guid}</if>
        </where>
    </select>
    <insert id="insertTBusiHazardArchive" parameterType="com.goldenwater.slaj.hazard.domain.TBusiHazardArchive">
        insert into t_busi_hazard_archive (
            guid, haz_iden_guid, org_guid, status, wiun_guid, create_per, create_time, update_per, update_time
        ) values (
            #{$(System.Collections.Hashtable.Prop)}, #{$(System.Collections.Hashtable.Prop)}, #{$(System.Collections.Hashtable.Prop)}, #{$(System.Collections.Hashtable.Prop)}, #{$(System.Collections.Hashtable.Prop)}, #{$(System.Collections.Hashtable.Prop)}, #{$(System.Collections.Hashtable.Prop)}, #{$(System.Collections.Hashtable.Prop)}, #{$(System.Collections.Hashtable.Prop)}
        )
    </insert>
    <update id="updateTBusiHazardArchive" parameterType="com.goldenwater.slaj.hazard.domain.TBusiHazardArchive">
        update t_busi_hazard_archive
        <set>
            <if test="hazIdenGuid != null">haz_iden_guid = #{hazIdenGuid},</if>
            <if test="orgGuid != null">org_guid = #{orgGuid},</if>
            <if test="status != null">status = #{status},</if>
            <if test="wiunGuid != null">wiun_guid = #{wiunGuid},</if>
            <if test="createPer != null">create_per = #{createPer},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updatePer != null">update_per = #{updatePer},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
        </set>
        where guid = #{guid}
    </update>
    <delete id="deleteTBusiHazardArchiveByGuid" parameterType="String">
        delete from t_busi_hazard_archive where guid = #{guid}
    </delete>
    <delete id="deleteTBusiHazardArchiveByGuids" parameterType="String">
        delete from t_busi_hazard_archive where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>