<?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.TBusiInspectTaskMapper">
    <resultMap type="com.goldenwater.slaj.hazard.domain.TBusiInspectTask" id="TBusiInspectTaskResult">
        <result property="guid" column="guid"/>
        <result property="hazIdenGuid" column="haz_iden_guid"/>
        <result property="startTime" column="start_time"/>
        <result property="cycleNum" column="cycle_num"/>
        <result property="quantType" column="quant_type"/>
        <result property="early" column="early"/>
        <result property="threshold" column="threshold"/>
        <result property="orgGuid" column="org_guid"/>
        <result property="status" column="status"/>
        <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="selectTBusiInspectTaskVo">
        select guid, haz_iden_guid, start_time, cycle_num, quant_type, early, threshold, org_guid, status, create_per, create_time, update_per, update_time
        from t_busi_inspect_task
    </sql>
    <select id="selectTBusiInspectTaskByGuid" parameterType="String" resultMap="TBusiInspectTaskResult">
        <include refid="selectTBusiInspectTaskVo"/>
        where guid = #{guid}
    </select>
    <select id="selectTBusiInspectTaskList" parameterType="com.goldenwater.slaj.hazard.domain.TBusiInspectTask" resultMap="TBusiInspectTaskResult">
        <include refid="selectTBusiInspectTaskVo"/>
        <where>
            <if test="hazIdenGuid != null and hazIdenGuid != ''">AND haz_iden_guid like '%' || #{hazIdenGuid} || '%'</if>
            <if test="startTime != null and startTime != ''">AND start_time like '%' || #{startTime} || '%'</if>
            <if test="quantType != null and quantType != ''">AND quant_type like '%' || #{quantType} || '%'</if>
            <if test="early != null and early != ''">AND early = #{early}</if>
            <if test="threshold != null and threshold != ''">AND threshold = #{threshold}</if>
            <if test="orgGuid != null and orgGuid != ''">AND org_guid = #{orgGuid}</if>
            <if test="status != null and status != ''">AND status = #{status}</if>
            <if test="createPer != null and createPer != ''">AND create_per = #{createPer}</if>
            <if test="createTime != null and createTime != ''">AND create_time = #{createTime}</if>
            <if test="updatePer != null and updatePer != ''">AND update_per = #{updatePer}</if>
            <if test="updateTime != null and updateTime != ''">AND update_time = #{updateTime}</if>
        </where>
    </select>
    <insert id="insertTBusiInspectTask" parameterType="com.goldenwater.slaj.hazard.domain.TBusiInspectTask">
        insert into t_busi_inspect_task (
            guid,
            haz_iden_guid,
            start_time,
            cycle_num,
            quant_type,
            early,
            threshold,
            org_guid,
            status,
            create_per,
            create_time,
            update_per,
            update_time
        ) values (
            #{guid},
            #{hazIdenGuid},
            #{startTime},
            #{cycleNum},
            #{quantType},
            #{early},
            #{threshold},
            #{orgGuid},
            #{status},
            #{createPer},
            #{createTime},
            #{updatePer},
            #{updateTime}
        )
    </insert>
    <update id="updateTBusiInspectTask" parameterType="com.goldenwater.slaj.hazard.domain.TBusiInspectTask">
        update t_busi_inspect_task
        <set>
            <if test="hazIdenGuid != null">haz_iden_guid = #{hazIdenGuid},</if>
            <if test="startTime != null">start_time = #{startTime},</if>
            <if test="cycleNum != null">cycle_num = #{cycleNum},</if>
            <if test="quantType != null">quant_type = #{quantType},</if>
            <if test="early != null">early = #{early},</if>
            <if test="threshold != null">threshold = #{threshold},</if>
            <if test="orgGuid != null">org_guid = #{orgGuid},</if>
            <if test="status != null">status = #{status},</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="deleteTBusiInspectTaskByGuid" parameterType="String">
        delete from t_busi_inspect_task where guid = #{guid}
    </delete>
    <delete id="deleteTBusiInspectTaskByGuids" parameterType="String">
        delete from t_busi_inspect_task where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>
