<?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.TBusiInspectItemMapper">
    <resultMap type="com.goldenwater.slaj.hazard.domain.TBusiInspectItem" id="TBusiInspectItemResult">
        <result property="guid" column="guid"/>
        <result property="recordGuid" column="record_guid"/>
        <result property="content" column="content"/>
        <result property="dataType" column="data_type"/>
        <result property="itemValue" column="item_value"/>
        <result property="result" column="result"/>
        <result property="remark" column="remark"/>
        <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="selectTBusiInspectItemVo">
        select guid, record_guid, content, data_type, item_value, result, remark, create_per, create_time, update_per, update_time
        from t_busi_inspect_item
    </sql>
    <select id="selectTBusiInspectItemByGuid" parameterType="String" resultMap="TBusiInspectItemResult">
        <include refid="selectTBusiInspectItemVo"/>
        where guid = #{guid}
    </select>
    <select id="selectTBusiInspectItemList" parameterType="com.goldenwater.slaj.hazard.domain.TBusiInspectItem" resultMap="TBusiInspectItemResult">
        <include refid="selectTBusiInspectItemVo"/>
        <where>
            <if test="recordGuid != null and recordGuid != ''">AND record_guid like '%' || #{recordGuid} || '%'</if>
            <if test="content != null and content != ''">AND content like '%' || #{content} || '%'</if>
            <if test="dataType != null and dataType != ''">AND data_type like '%' || #{dataType} || '%'</if>
            <if test="itemValue != null and itemValue != ''">AND item_value = #{itemValue}</if>
            <if test="result != null and result != ''">AND result = #{result}</if>
            <if test="remark != null and remark != ''">AND remark = #{remark}</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="insertTBusiInspectItem" parameterType="com.goldenwater.slaj.hazard.domain.TBusiInspectItem">
        insert into t_busi_inspect_item (
            guid,
            record_guid,
            content,
            data_type,
            item_value,
            result,
            remark,
            create_per,
            create_time,
            update_per,
            update_time
        ) values (
            #{guid},
            #{recordGuid},
            #{content},
            #{dataType},
            #{itemValue},
            #{result},
            #{remark},
            #{createPer},
            #{createTime},
            #{updatePer},
            #{updateTime}
        )
    </insert>
    <update id="updateTBusiInspectItem" parameterType="com.goldenwater.slaj.hazard.domain.TBusiInspectItem">
        update t_busi_inspect_item
        <set>
            <if test="recordGuid != null">record_guid = #{recordGuid},</if>
            <if test="content != null">content = #{content},</if>
            <if test="dataType != null">data_type = #{dataType},</if>
            <if test="itemValue != null">item_value = #{itemValue},</if>
            <if test="result != null">result = #{result},</if>
            <if test="remark != null">remark = #{remark},</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="deleteTBusiInspectItemByGuid" parameterType="String">
        delete from t_busi_inspect_item where guid = #{guid}
    </delete>
    <delete id="deleteTBusiInspectItemByGuids" parameterType="String">
        delete from t_busi_inspect_item where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>
