<?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.bootdo.system.dao.ThirdMsgLogDOMapper">
  <resultMap id="BaseResultMap" type="com.bootdo.system.domain.ThirdMsgLogDO">
    <!--@mbg.generated-->
    <!--@Table tl_third_msg_log-->
    <id column="log_id" jdbcType="INTEGER" property="logId" />
    <result column="operation_type" jdbcType="VARCHAR" property="operationType" />
    <result column="result_code" jdbcType="VARCHAR" property="resultCode" />
    <result column="result_Desc" jdbcType="VARCHAR" property="resultDesc" />
    <result column="relate_id" jdbcType="VARCHAR" property="relateId" />
    <result column="cost" jdbcType="VARCHAR" property="cost" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="call_type" jdbcType="VARCHAR" property="callType" />
    <result column="data" jdbcType="LONGVARCHAR" property="data" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--@mbg.generated-->
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <!--@mbg.generated-->
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    log_id, operation_type, result_code, result_Desc, relate_id, cost, create_time, call_type, 
    `data`
  </sql>
  <select id="selectByExample" parameterType="com.bootdo.system.domain.ThirdMsgLogDOExample" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from tl_third_msg_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select 
    <include refid="Base_Column_List" />
    from tl_third_msg_log
    where log_id = #{logId,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    <!--@mbg.generated-->
    delete from tl_third_msg_log
    where log_id = #{logId,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.bootdo.system.domain.ThirdMsgLogDOExample">
    <!--@mbg.generated-->
    delete from tl_third_msg_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" keyColumn="log_id" keyProperty="logId" parameterType="com.bootdo.system.domain.ThirdMsgLogDO" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into tl_third_msg_log (operation_type, result_code, result_Desc, 
      relate_id, cost, create_time, 
      call_type, `data`)
    values (#{operationType,jdbcType=VARCHAR}, #{resultCode,jdbcType=VARCHAR}, #{resultDesc,jdbcType=VARCHAR}, 
      #{relateId,jdbcType=VARCHAR}, #{cost,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
      #{callType,jdbcType=VARCHAR}, #{data,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" keyColumn="log_id" keyProperty="logId" parameterType="com.bootdo.system.domain.ThirdMsgLogDO" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into tl_third_msg_log
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="operationType != null">
        operation_type,
      </if>
      <if test="resultCode != null">
        result_code,
      </if>
      <if test="resultDesc != null">
        result_Desc,
      </if>
      <if test="relateId != null">
        relate_id,
      </if>
      <if test="cost != null">
        cost,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="callType != null">
        call_type,
      </if>
      <if test="data != null">
        `data`,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="operationType != null">
        #{operationType,jdbcType=VARCHAR},
      </if>
      <if test="resultCode != null">
        #{resultCode,jdbcType=VARCHAR},
      </if>
      <if test="resultDesc != null">
        #{resultDesc,jdbcType=VARCHAR},
      </if>
      <if test="relateId != null">
        #{relateId,jdbcType=VARCHAR},
      </if>
      <if test="cost != null">
        #{cost,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="callType != null">
        #{callType,jdbcType=VARCHAR},
      </if>
      <if test="data != null">
        #{data,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.bootdo.system.domain.ThirdMsgLogDOExample" resultType="java.lang.Long">
    <!--@mbg.generated-->
    select count(*) from tl_third_msg_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--@mbg.generated-->
    update tl_third_msg_log
    <set>
      <if test="record.logId != null">
        log_id = #{record.logId,jdbcType=INTEGER},
      </if>
      <if test="record.operationType != null">
        operation_type = #{record.operationType,jdbcType=VARCHAR},
      </if>
      <if test="record.resultCode != null">
        result_code = #{record.resultCode,jdbcType=VARCHAR},
      </if>
      <if test="record.resultDesc != null">
        result_Desc = #{record.resultDesc,jdbcType=VARCHAR},
      </if>
      <if test="record.relateId != null">
        relate_id = #{record.relateId,jdbcType=VARCHAR},
      </if>
      <if test="record.cost != null">
        cost = #{record.cost,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.callType != null">
        call_type = #{record.callType,jdbcType=VARCHAR},
      </if>
      <if test="record.data != null">
        `data` = #{record.data,jdbcType=LONGVARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--@mbg.generated-->
    update tl_third_msg_log
    set log_id = #{record.logId,jdbcType=INTEGER},
      operation_type = #{record.operationType,jdbcType=VARCHAR},
      result_code = #{record.resultCode,jdbcType=VARCHAR},
      result_Desc = #{record.resultDesc,jdbcType=VARCHAR},
      relate_id = #{record.relateId,jdbcType=VARCHAR},
      cost = #{record.cost,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      call_type = #{record.callType,jdbcType=VARCHAR},
      `data` = #{record.data,jdbcType=LONGVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.bootdo.system.domain.ThirdMsgLogDO">
    <!--@mbg.generated-->
    update tl_third_msg_log
    <set>
      <if test="operationType != null">
        operation_type = #{operationType,jdbcType=VARCHAR},
      </if>
      <if test="resultCode != null">
        result_code = #{resultCode,jdbcType=VARCHAR},
      </if>
      <if test="resultDesc != null">
        result_Desc = #{resultDesc,jdbcType=VARCHAR},
      </if>
      <if test="relateId != null">
        relate_id = #{relateId,jdbcType=VARCHAR},
      </if>
      <if test="cost != null">
        cost = #{cost,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="callType != null">
        call_type = #{callType,jdbcType=VARCHAR},
      </if>
      <if test="data != null">
        `data` = #{data,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where log_id = #{logId,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.bootdo.system.domain.ThirdMsgLogDO">
    <!--@mbg.generated-->
    update tl_third_msg_log
    set operation_type = #{operationType,jdbcType=VARCHAR},
      result_code = #{resultCode,jdbcType=VARCHAR},
      result_Desc = #{resultDesc,jdbcType=VARCHAR},
      relate_id = #{relateId,jdbcType=VARCHAR},
      cost = #{cost,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      call_type = #{callType,jdbcType=VARCHAR},
      `data` = #{data,jdbcType=LONGVARCHAR}
    where log_id = #{logId,jdbcType=INTEGER}
  </update>
  <update id="updateBatch" parameterType="java.util.List">
    <!--@mbg.generated-->
    update tl_third_msg_log
    <trim prefix="set" suffixOverrides=",">
      <trim prefix="operation_type = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when log_id = #{item.logId,jdbcType=INTEGER} then #{item.operationType,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="result_code = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when log_id = #{item.logId,jdbcType=INTEGER} then #{item.resultCode,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="result_Desc = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when log_id = #{item.logId,jdbcType=INTEGER} then #{item.resultDesc,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="relate_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when log_id = #{item.logId,jdbcType=INTEGER} then #{item.relateId,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="cost = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when log_id = #{item.logId,jdbcType=INTEGER} then #{item.cost,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="create_time = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when log_id = #{item.logId,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
        </foreach>
      </trim>
      <trim prefix="call_type = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when log_id = #{item.logId,jdbcType=INTEGER} then #{item.callType,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="`data` = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when log_id = #{item.logId,jdbcType=INTEGER} then #{item.data,jdbcType=LONGVARCHAR}
        </foreach>
      </trim>
    </trim>
    where log_id in
    <foreach close=")" collection="list" item="item" open="(" separator=", ">
      #{item.logId,jdbcType=INTEGER}
    </foreach>
  </update>
  <insert id="batchInsert" keyColumn="log_id" keyProperty="logId" parameterType="map" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into tl_third_msg_log
    (operation_type, result_code, result_Desc, relate_id, cost, create_time, call_type, 
      `data`)
    values
    <foreach collection="list" item="item" separator=",">
      (#{item.operationType,jdbcType=VARCHAR}, #{item.resultCode,jdbcType=VARCHAR}, #{item.resultDesc,jdbcType=VARCHAR}, 
        #{item.relateId,jdbcType=VARCHAR}, #{item.cost,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, 
        #{item.callType,jdbcType=VARCHAR}, #{item.data,jdbcType=LONGVARCHAR})
    </foreach>
  </insert>
</mapper>