<?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.BisHazMajRegWritRegorgMapper">
    <resultMap type="com.goldenwater.slaj.hazard.domain.BisHazMajRegWritRegorg" id="BisHazMajRegWritRegorgResult">
        <result property="guid" column="guid"/>
        <result property="hazGuid" column="haz_guid"/>
        <result property="regOrgGuid" column="reg_org_guid"/>
    </resultMap>
    <sql id="selectBisHazMajRegWritRegorgVo">
        select guid, haz_guid, reg_org_guid
        from bis_haz_maj_reg_writ_regorg
    </sql>
    <select id="selectBisHazMajRegWritRegorgByGuid" parameterType="String" resultMap="BisHazMajRegWritRegorgResult">
        <include refid="selectBisHazMajRegWritRegorgVo"/>
        where guid = #{guid}
    </select>
    <select id="selectBisHazMajRegWritRegorgList" parameterType="com.goldenwater.slaj.hazard.domain.BisHazMajRegWritRegorg" resultMap="BisHazMajRegWritRegorgResult">
        <include refid="selectBisHazMajRegWritRegorgVo"/>
        <where>
            <if test="hazGuid != null and hazGuid != ''">AND haz_guid = #{hazGuid}</if>
            <if test="guid != null and guid != ''">AND guid = #{guid}</if>
        </where>
    </select>
    <insert id="insertBisHazMajRegWritRegorg" parameterType="com.goldenwater.slaj.hazard.domain.BisHazMajRegWritRegorg">
        insert into bis_haz_maj_reg_writ_regorg (
            guid, haz_guid, reg_org_guid
        ) values (
            #{$(System.Collections.Hashtable.Prop)}, #{$(System.Collections.Hashtable.Prop)}, #{$(System.Collections.Hashtable.Prop)}
        )
    </insert>
    <update id="updateBisHazMajRegWritRegorg" parameterType="com.goldenwater.slaj.hazard.domain.BisHazMajRegWritRegorg">
        update bis_haz_maj_reg_writ_regorg
        <set>
            <if test="hazGuid != null">haz_guid = #{hazGuid},</if>
            <if test="regOrgGuid != null">reg_org_guid = #{regOrgGuid},</if>
        </set>
        where guid = #{guid}
    </update>
    <delete id="deleteBisHazMajRegWritRegorgByGuid" parameterType="String">
        delete from bis_haz_maj_reg_writ_regorg where guid = #{guid}
    </delete>
    <delete id="deleteBisHazMajRegWritRegorgByGuids" parameterType="String">
        delete from bis_haz_maj_reg_writ_regorg where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>