<?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.ruoyi.ss.callback.mapper.CallbackLogMapper">

    <resultMap type="CallbackLog" id="EtCallbackLogResult">
        <result property="id"    column="id"    />
        <result property="body2"    column="body2"    />
        <result property="body"    column="body"    />
        <result property="createTime"    column="create_time"    />
        <result property="type"    column="type"    />
    </resultMap>

    <sql id="selectEtCallbackLogVo">
        select id, body2, body, create_time, type from ss_callback_log
    </sql>

    <select id="selectEtCallbackLogList" parameterType="CallbackLog" resultMap="EtCallbackLogResult">
        <include refid="selectEtCallbackLogVo"/>
        <where>
            <if test="body2 != null  and body2 != ''"> and body2 = #{body2}</if>
            <if test="body != null  and body != ''"> and body = #{body}</if>
            <if test="type != null  and type != ''"> and type = #{type}</if>
        </where>
    </select>

    <select id="selectEtCallbackLogById" parameterType="Long" resultMap="EtCallbackLogResult">
        <include refid="selectEtCallbackLogVo"/>
        where id = #{id}
    </select>

    <insert id="insertEtCallbackLog" parameterType="CallbackLog">
        insert into ss_callback_log
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="body2 != null">body2,</if>
            <if test="body != null">body,</if>
            <if test="createTime != null">create_time,</if>
            <if test="type != null">type,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="body2 != null">#{body2},</if>
            <if test="body != null">#{body},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="type != null">#{type},</if>
         </trim>
    </insert>

    <update id="updateEtCallbackLog" parameterType="CallbackLog">
        update ss_callback_log
        <trim prefix="SET" suffixOverrides=",">
            <if test="body2 != null">body2 = #{body2},</if>
            <if test="body != null">body = #{body},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="type != null">type = #{type},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteEtCallbackLogById" parameterType="Long">
        delete from ss_callback_log where id = #{id}
    </delete>

    <delete id="deleteEtCallbackLogByIds" parameterType="String">
        delete from ss_callback_log where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
