<?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.TBusiHazardWarmMapper">
    <resultMap type="com.goldenwater.slaj.hazard.domain.TBusiHazardWarm" id="TBusiHazardWarmResult">
        <result property="guid" column="guid"/>
        <result property="warmLevel" column="warm_level"/>
        <result property="warmThreshold" column="warm_threshold"/>
        <result property="currentThreshold" column="current_threshold"/>
        <result property="controlMeasure" column="control_measure"/>
        <result property="emgcMeasure" column="emgc_measure"/>
        <result property="hazGuid" column="haz_guid"/>
        <result property="createTime" column="create_time"/>
        <result property="updateTime" column="update_time"/>
        <result property="content" column="content"/>
        <result property="remark" column="remark"/>
        <result property="creperGuid" column="creper_guid"/>
        <result property="updperGuid" column="updper_guid"/>
        <result property="orgGuid" column="org_guid"/>
    </resultMap>
    <sql id="selectTBusiHazardWarmVo">
        select guid, warm_level, warm_threshold, current_threshold, control_measure, emgc_measure, haz_guid, create_time, update_time, content, remark, creper_guid, updper_guid, org_guid
        from t_busi_hazard_warm
    </sql>
    <select id="selectTBusiHazardWarmByGuid" parameterType="String" resultMap="TBusiHazardWarmResult">
        <include refid="selectTBusiHazardWarmVo"/>
        where guid = #{guid}
    </select>
    <select id="selectTBusiHazardWarmList" parameterType="com.goldenwater.slaj.hazard.domain.TBusiHazardWarm" resultMap="TBusiHazardWarmResult">
        <include refid="selectTBusiHazardWarmVo"/>
        <where>
            <if test="orgGuid != null and orgGuid != ''">AND org_guid = #{orgGuid}</if>
            <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="insertTBusiHazardWarm" parameterType="com.goldenwater.slaj.hazard.domain.TBusiHazardWarm">
        insert into t_busi_hazard_warm (
            guid, warm_level, warm_threshold, current_threshold, control_measure, emgc_measure, haz_guid, create_time, update_time, content, remark, creper_guid, updper_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)}
        )
    </insert>
    <update id="updateTBusiHazardWarm" parameterType="com.goldenwater.slaj.hazard.domain.TBusiHazardWarm">
        update t_busi_hazard_warm
        <set>
            <if test="warmLevel != null">warm_level = #{warmLevel},</if>
            <if test="warmThreshold != null">warm_threshold = #{warmThreshold},</if>
            <if test="currentThreshold != null">current_threshold = #{currentThreshold},</if>
            <if test="controlMeasure != null">control_measure = #{controlMeasure},</if>
            <if test="emgcMeasure != null">emgc_measure = #{emgcMeasure},</if>
            <if test="hazGuid != null">haz_guid = #{hazGuid},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="content != null">content = #{content},</if>
            <if test="remark != null">remark = #{remark},</if>
            <if test="creperGuid != null">creper_guid = #{creperGuid},</if>
            <if test="updperGuid != null">updper_guid = #{updperGuid},</if>
            <if test="orgGuid != null">org_guid = #{orgGuid},</if>
        </set>
        where guid = #{guid}
    </update>
    <delete id="deleteTBusiHazardWarmByGuid" parameterType="String">
        delete from t_busi_hazard_warm where guid = #{guid}
    </delete>
    <delete id="deleteTBusiHazardWarmByGuids" parameterType="String">
        delete from t_busi_hazard_warm where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>