<?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.yd.dal.mapper.transaction.TranLogMapper">
  <resultMap id="BaseResultMap" type="com.yd.dal.entity.transaction.TranLog">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="category" jdbcType="VARCHAR" property="category" />
    <result column="type" jdbcType="VARCHAR" property="type" />
    <result column="tran_no" jdbcType="VARCHAR" property="tranNo" />
    <result column="in_or_out" jdbcType="VARCHAR" property="inOrOut" />
    <result column="yd_code" jdbcType="VARCHAR" property="ydCode" />
    <result column="return_code" jdbcType="VARCHAR" property="returnCode" />
    <result column="return_message" jdbcType="VARCHAR" property="returnMessage" />
    <result column="tran_xml" jdbcType="VARCHAR" property="tranXml" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate" />
  </resultMap>
  <sql id="Base_Column_List">
    id, category, `type`, tran_no, in_or_out, yd_code, return_code, return_message, tran_xml, 
    remark, create_date, updated_date
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from t_tran_log
    where id = #{id,jdbcType=BIGINT}
  </select>
  <select id="findByTranLogOrderBy" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from t_tran_log
    <where>
      <if test="info.id != null">
        and id = #{info.id,jdbcType=VARCHAR}
      </if>
      <if test="info.category != null">
        and category = #{info.category,jdbcType=VARCHAR}
      </if>
      <if test="info.type != null">
        and `type` = #{info.type,jdbcType=VARCHAR}
      </if>
      <if test="info.tranNo != null">
        and tran_no = #{info.tranNo,jdbcType=VARCHAR}
      </if>
      <if test="info.inOrOut != null">
        and in_or_out = #{info.inOrOut,jdbcType=VARCHAR}
      </if>
      <if test="info.ydCode != null">
        and yd_code = #{info.ydCode,jdbcType=VARCHAR}
      </if>
      <if test="info.returnCode != null">
        and return_code = #{info.returnCode,jdbcType=VARCHAR}
      </if>
      <if test="info.returnMessage != null">
        and return_message = #{info.returnMessage,jdbcType=VARCHAR}
      </if>
      <if test="info.tranXml != null">
        and tran_xml = #{info.tranXml,jdbcType=VARCHAR}
      </if>
      <if test="info.remark != null">
        and remark = #{info.remark,jdbcType=VARCHAR}
      </if>
      <if test="info.createDate != null">
        and create_date = #{info.createDate,jdbcType=TIMESTAMP}
      </if>
      <if test="info.updatedDate != null">
        and updated_date = #{info.updatedDate,jdbcType=TIMESTAMP}
      </if>
    </where>
    <if test="orderBy != null">
        order by ${orderBy}
    </if>
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from t_tran_log
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.transaction.TranLog" useGeneratedKeys="true">
    insert into t_tran_log (category, `type`, tran_no, 
      in_or_out, yd_code, return_code, 
      return_message, tran_xml, remark, 
      create_date, updated_date)
    values (#{category,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{tranNo,jdbcType=VARCHAR}, 
      #{inOrOut,jdbcType=VARCHAR}, #{ydCode,jdbcType=VARCHAR}, #{returnCode,jdbcType=VARCHAR}, 
      #{returnMessage,jdbcType=VARCHAR}, #{tranXml,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, 
      #{createDate,jdbcType=TIMESTAMP}, #{updatedDate,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.transaction.TranLog" useGeneratedKeys="true">
    insert into t_tran_log
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="category != null">
        category,
      </if>
      <if test="type != null">
        `type`,
      </if>
      <if test="tranNo != null">
        tran_no,
      </if>
      <if test="inOrOut != null">
        in_or_out,
      </if>
      <if test="ydCode != null">
        yd_code,
      </if>
      <if test="returnCode != null">
        return_code,
      </if>
      <if test="returnMessage != null">
        return_message,
      </if>
      <if test="tranXml != null">
        tran_xml,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="createDate != null">
        create_date,
      </if>
      <if test="updatedDate != null">
        updated_date,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="category != null">
        #{category,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        #{type,jdbcType=VARCHAR},
      </if>
      <if test="tranNo != null">
        #{tranNo,jdbcType=VARCHAR},
      </if>
      <if test="inOrOut != null">
        #{inOrOut,jdbcType=VARCHAR},
      </if>
      <if test="ydCode != null">
        #{ydCode,jdbcType=VARCHAR},
      </if>
      <if test="returnCode != null">
        #{returnCode,jdbcType=VARCHAR},
      </if>
      <if test="returnMessage != null">
        #{returnMessage,jdbcType=VARCHAR},
      </if>
      <if test="tranXml != null">
        #{tranXml,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="updatedDate != null">
        #{updatedDate,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.transaction.TranLog">
    update t_tran_log
    <set>
      <if test="category != null">
        category = #{category,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        `type` = #{type,jdbcType=VARCHAR},
      </if>
      <if test="tranNo != null">
        tran_no = #{tranNo,jdbcType=VARCHAR},
      </if>
      <if test="inOrOut != null">
        in_or_out = #{inOrOut,jdbcType=VARCHAR},
      </if>
      <if test="ydCode != null">
        yd_code = #{ydCode,jdbcType=VARCHAR},
      </if>
      <if test="returnCode != null">
        return_code = #{returnCode,jdbcType=VARCHAR},
      </if>
      <if test="returnMessage != null">
        return_message = #{returnMessage,jdbcType=VARCHAR},
      </if>
      <if test="tranXml != null">
        tran_xml = #{tranXml,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="updatedDate != null">
        updated_date = #{updatedDate,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.transaction.TranLog">
    update t_tran_log
    set category = #{category,jdbcType=VARCHAR},
      `type` = #{type,jdbcType=VARCHAR},
      tran_no = #{tranNo,jdbcType=VARCHAR},
      in_or_out = #{inOrOut,jdbcType=VARCHAR},
      yd_code = #{ydCode,jdbcType=VARCHAR},
      return_code = #{returnCode,jdbcType=VARCHAR},
      return_message = #{returnMessage,jdbcType=VARCHAR},
      tran_xml = #{tranXml,jdbcType=VARCHAR},
      remark = #{remark,jdbcType=VARCHAR},
      create_date = #{createDate,jdbcType=TIMESTAMP},
      updated_date = #{updatedDate,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>