<?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.BisHazIdenEvaMapper">
    <resultMap type="com.goldenwater.slaj.hazard.domain.BisHazIdenEva" id="BisHazIdenEvaResult">
        <result property="guid" column="guid"/>
        <result property="hazGuid" column="haz_guid"/>
        <result property="evaOrgName" column="eva_org_name"/>
        <result property="evaeDate" column="evae_date"/>
        <result property="legPers" column="leg_pers"/>
        <result property="idenEvaResu" column="iden_eva_resu"/>
        <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="toDate" column="to_date"/>
    </resultMap>
    <sql id="selectBisHazIdenEvaVo">
        select guid, haz_guid, eva_org_name, evae_date, leg_pers, iden_eva_resu,
               note, coll_time, upd_time, rec_pers, to_date
        from bis_haz_iden_eva
    </sql>
    <select id="selectBisHazIdenEvaByGuid" parameterType="String" resultMap="BisHazIdenEvaResult">
        <include refid="selectBisHazIdenEvaVo"/>
        where guid = #{guid}
    </select>
    <select id="selectBisHazIdenEvaList" parameterType="com.goldenwater.slaj.hazard.domain.BisHazIdenEva" resultMap="BisHazIdenEvaResult">
        <include refid="selectBisHazIdenEvaVo"/>
        <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="insertBisHazIdenEva" parameterType="com.goldenwater.slaj.hazard.domain.BisHazIdenEva">
        insert into bis_haz_iden_eva (
            guid, haz_guid, eva_org_name, evae_date, leg_pers, iden_eva_resu,
            note, coll_time, upd_time, rec_pers, to_date
        ) values (
            #{guid}, #{hazGuid}, #{evaOrgName}, #{evaeDate}, #{legPers}, #{idenEvaResu},
            #{note}, #{collTime}, #{updTime}, #{recPers}, #{toDate}
        )
    </insert>
    <update id="updateBisHazIdenEva" parameterType="com.goldenwater.slaj.hazard.domain.BisHazIdenEva">
        update bis_haz_iden_eva
        <set>
            <if test="hazGuid != null">haz_guid = #{hazGuid},</if>
            <if test="evaOrgName != null">eva_org_name = #{evaOrgName},</if>
            <if test="evaeDate != null">evae_date = #{evaeDate},</if>
            <if test="legPers != null">leg_pers = #{legPers},</if>
            <if test="idenEvaResu != null">iden_eva_resu = #{idenEvaResu},</if>
            <if test="note != null">note = #{note},</if>
            <if test="updTime != null">upd_time = #{updTime},</if>
            <if test="recPers != null">rec_pers = #{recPers},</if>
            <if test="toDate != null">to_date = #{toDate},</if>
        </set>
        where guid = #{guid}
    </update>
    <delete id="deleteBisHazIdenEvaByGuid" parameterType="String">
        delete from bis_haz_iden_eva where guid = #{guid}
    </delete>
    <delete id="deleteBisHazIdenEvaByGuids" parameterType="String">
        delete from bis_haz_iden_eva where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>
