OrdersPayHbfqMapper.xml 3.9 KB
<?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.yohoufo.dal.order.OrdersPayHbfqMapper" >
  <resultMap id="BaseResultMap" type="com.yohoufo.dal.order.model.OrdersPayHbfq" >
    <id column="fq_trade_no" property="fqTradeNo" jdbcType="VARCHAR" />
    <result column="pay_order_code" property="payOrderCode" jdbcType="VARCHAR" />
    <result column="uid" property="uid" jdbcType="INTEGER" />
    <result column="create_time" property="createTime" jdbcType="INTEGER" />
    <result column="update_time" property="updateTime" jdbcType="INTEGER" />
  </resultMap>
  <sql id="Base_Column_List" >
    fq_trade_no, pay_order_code, uid, create_time, update_time
  </sql>

  <insert id="insertOnDuplicateUpdate" parameterType="com.yoho.yhorder.dal.model.OrdersPayHbfq" >
    insert into orders_pay_hbfq (fq_trade_no, pay_order_code, uid, create_time)
    values(#{fqTradeNo,jdbcType=VARCHAR}, #{payOrderCode,jdbcType=VARCHAR}, #{uid,jdbcType=INTEGER}, UNIX_TIMESTAMP())
    on duplicate key update update_time = UNIX_TIMESTAMP()
  </insert>

  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from orders_pay_hbfq
    where fq_trade_no = #{fqTradeNo,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from orders_pay_hbfq
    where fq_trade_no = #{fqTradeNo,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.yohoufo.dal.order.model.OrdersPayHbfq" >
    insert into orders_pay_hbfq (fq_trade_no, pay_order_code, uid, 
      create_time, update_time)
    values (#{fqTradeNo,jdbcType=VARCHAR}, #{payOrderCode,jdbcType=VARCHAR}, #{uid,jdbcType=INTEGER}, 
      #{createTime,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="com.yohoufo.dal.order.model.OrdersPayHbfq" >
    insert into orders_pay_hbfq
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="fqTradeNo != null" >
        fq_trade_no,
      </if>
      <if test="payOrderCode != null" >
        pay_order_code,
      </if>
      <if test="uid != null" >
        uid,
      </if>
      <if test="createTime != null" >
        create_time,
      </if>
      <if test="updateTime != null" >
        update_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="fqTradeNo != null" >
        #{fqTradeNo,jdbcType=VARCHAR},
      </if>
      <if test="payOrderCode != null" >
        #{payOrderCode,jdbcType=VARCHAR},
      </if>
      <if test="uid != null" >
        #{uid,jdbcType=INTEGER},
      </if>
      <if test="createTime != null" >
        #{createTime,jdbcType=INTEGER},
      </if>
      <if test="updateTime != null" >
        #{updateTime,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.yohoufo.dal.order.model.OrdersPayHbfq" >
    update orders_pay_hbfq
    <set >
      <if test="payOrderCode != null" >
        pay_order_code = #{payOrderCode,jdbcType=VARCHAR},
      </if>
      <if test="uid != null" >
        uid = #{uid,jdbcType=INTEGER},
      </if>
      <if test="createTime != null" >
        create_time = #{createTime,jdbcType=INTEGER},
      </if>
      <if test="updateTime != null" >
        update_time = #{updateTime,jdbcType=INTEGER},
      </if>
    </set>
    where fq_trade_no = #{fqTradeNo,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.yohoufo.dal.order.model.OrdersPayHbfq" >
    update orders_pay_hbfq
    set pay_order_code = #{payOrderCode,jdbcType=VARCHAR},
      uid = #{uid,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=INTEGER},
      update_time = #{updateTime,jdbcType=INTEGER}
    where fq_trade_no = #{fqTradeNo,jdbcType=VARCHAR}
  </update>
</mapper>