<?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.HazardSourceMapper">
    <resultMap type="com.goldenwater.slaj.hazard.domain.HazardSource" id="HazardSourceResult">
        <result property="guid" column="guid"/>
        <result property="biskSources" column="bisk_sources"/>
        <result property="hazardRate" column="hazard_rate"/>
        <result property="qateCoefficient" column="qate_coefficient"/>
        <result property="rControlRate" column="r_control_rate"/>
        <result property="rootRogName" column="root_rog_name"/>
        <result property="orgName" column="org_name"/>
        <result property="createTime" column="create_time"/>
        <result property="projectCount" column="project_count"/>
        <result property="fidentified" column="fidentified"/>
        <result property="gaIdentification" column="ga_identification"/>
        <result property="gbIdentification" column="gb_identification"/>
        <result property="gabIdentification" column="gab_identification"/>
        <result property="jmeasures" column="jmeasures"/>
        <result property="jlmeasures" column="jlmeasures"/>
        <result property="lmeasures" column="lmeasures"/>
        <result property="rootGuid" column="root_guid"/>
        <result property="orgGuid" column="org_guid"/>
    </resultMap>
    <sql id="selectHazardSourceVo">
        select guid, bisk_sources, hazard_rate, qate_coefficient, r_control_rate, root_rog_name, org_name, create_time, project_count, fidentified, ga_identification, gb_identification, gab_identification, jmeasures, jlmeasures, lmeasures, root_guid, org_guid
        from hazard_source
    </sql>
    <select id="selectHazardSourceByGuid" parameterType="String" resultMap="HazardSourceResult">
        <include refid="selectHazardSourceVo"/>
        where guid = #{guid}
    </select>
    <select id="selectHazardSourceList" parameterType="com.goldenwater.slaj.hazard.domain.HazardSource" resultMap="HazardSourceResult">
        <include refid="selectHazardSourceVo"/>
        <where>
            <if test="orgGuid != null and orgGuid != ''">AND org_guid = #{orgGuid}</if>
            <if test="rootGuid != null and rootGuid != ''">AND root_guid = #{rootGuid}</if>
            <if test="guid != null and guid != ''">AND guid = #{guid}</if>
        </where>
    </select>
    <insert id="insertHazardSource" parameterType="com.goldenwater.slaj.hazard.domain.HazardSource">
        insert into hazard_source (
            guid, bisk_sources, hazard_rate, qate_coefficient, r_control_rate, root_rog_name, org_name, create_time, project_count, fidentified, ga_identification, gb_identification, gab_identification, jmeasures, jlmeasures, lmeasures, root_guid, org_guid
        ) 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)}, #{$(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)}, #{$(System.Collections.Hashtable.Prop)}
        )
    </insert>
    <update id="updateHazardSource" parameterType="com.goldenwater.slaj.hazard.domain.HazardSource">
        update hazard_source
        <set>
            <if test="biskSources != null">bisk_sources = #{biskSources},</if>
            <if test="hazardRate != null">hazard_rate = #{hazardRate},</if>
            <if test="qateCoefficient != null">qate_coefficient = #{qateCoefficient},</if>
            <if test="rControlRate != null">r_control_rate = #{rControlRate},</if>
            <if test="rootRogName != null">root_rog_name = #{rootRogName},</if>
            <if test="orgName != null">org_name = #{orgName},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="projectCount != null">project_count = #{projectCount},</if>
            <if test="fidentified != null">fidentified = #{fidentified},</if>
            <if test="gaIdentification != null">ga_identification = #{gaIdentification},</if>
            <if test="gbIdentification != null">gb_identification = #{gbIdentification},</if>
            <if test="gabIdentification != null">gab_identification = #{gabIdentification},</if>
            <if test="jmeasures != null">jmeasures = #{jmeasures},</if>
            <if test="jlmeasures != null">jlmeasures = #{jlmeasures},</if>
            <if test="lmeasures != null">lmeasures = #{lmeasures},</if>
            <if test="rootGuid != null">root_guid = #{rootGuid},</if>
            <if test="orgGuid != null">org_guid = #{orgGuid},</if>
        </set>
        where guid = #{guid}
    </update>
    <delete id="deleteHazardSourceByGuid" parameterType="String">
        delete from hazard_source where guid = #{guid}
    </delete>
    <delete id="deleteHazardSourceByGuids" parameterType="String">
        delete from hazard_source where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>