<?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.TBusiRespPerMapper">
    <resultMap type="com.goldenwater.slaj.hazard.domain.TBusiRespPer" id="TBusiRespPerResult">
        <result property="guid" column="guid"/>
        <result property="name" column="name"/>
        <result property="phone" column="phone"/>
        <result property="createPer" column="create_per"/>
        <result property="createTime" column="create_time"/>
        <result property="updatePer" column="update_per"/>
        <result property="updateTime" column="update_time"/>
        <result property="dataSign" column="data_sign"/>
    </resultMap>
    <sql id="selectTBusiRespPerVo">
        select guid, name, phone, create_per, create_time, update_per, update_time, data_sign
        from t_busi_resp_per
    </sql>
    <select id="selectTBusiRespPerByGuid" parameterType="String" resultMap="TBusiRespPerResult">
        <include refid="selectTBusiRespPerVo"/>
        where guid = #{guid}
    </select>
    <select id="selectTBusiRespPerList" parameterType="com.goldenwater.slaj.hazard.domain.TBusiRespPer" resultMap="TBusiRespPerResult">
        <include refid="selectTBusiRespPerVo"/>
        <where>
            <if test="name != null and name != ''">AND name like '%' || #{name} || '%'</if>
            <if test="phone != null and phone != ''">AND phone like '%' || #{phone} || '%'</if>
            <if test="createPer != null and createPer != ''">AND create_per like '%' || #{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>
            <if test="dataSign != null and dataSign != ''">AND data_sign = #{dataSign}</if>
        </where>
    </select>
    <insert id="insertTBusiRespPer" parameterType="com.goldenwater.slaj.hazard.domain.TBusiRespPer">
        insert into t_busi_resp_per (
            guid,
            name,
            phone,
            create_per,
            create_time,
            update_per,
            update_time,
            data_sign
        ) values (
            #{guid},
            #{name},
            #{phone},
            #{createPer},
            #{createTime},
            #{updatePer},
            #{updateTime},
            #{dataSign}
        )
    </insert>
    <update id="updateTBusiRespPer" parameterType="com.goldenwater.slaj.hazard.domain.TBusiRespPer">
        update t_busi_resp_per
        <set>
            <if test="name != null">name = #{name},</if>
            <if test="phone != null">phone = #{phone},</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>
            <if test="dataSign != null">data_sign = #{dataSign},</if>
        </set>
        where guid = #{guid}
    </update>
    <delete id="deleteTBusiRespPerByGuid" parameterType="String">
        delete from t_busi_resp_per where guid = #{guid}
    </delete>
    <delete id="deleteTBusiRespPerByGuids" parameterType="String">
        delete from t_busi_resp_per where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>
