MallBizPaymentOrderDao.xml 7.57 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.diligrp.cashier.mall.dao.MallBizPaymentOrderDao">
  <resultMap id="BaseResultMap" type="com.diligrp.cashier.mall.model.MallBizPaymentOrder">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="biz_payment_id" jdbcType="BIGINT" property="bizPaymentId" />
    <result column="pay_trade_no" jdbcType="VARCHAR" property="payTradeNo" />
    <result column="biz_order_id" jdbcType="BIGINT" property="bizOrderId" />
    <result column="order_id" jdbcType="VARCHAR" property="orderId" />
    <result column="trade_id" jdbcType="VARCHAR" property="tradeId" />
    <result column="pay_trade_id" jdbcType="VARCHAR" property="payTradeId" />
    <result column="pay_status" jdbcType="INTEGER" property="payState" />
    <result column="pay_fee" jdbcType="BIGINT" property="payFee" />
    <result column="pay_time" jdbcType="TIMESTAMP" property="payTime" />
  </resultMap>
  <sql id="Base_Column_List">
    id, biz_payment_id, pay_trade_no, biz_order_id, order_id, trade_id, pay_trade_id,
    pay_state, pay_fee, pay_time
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from mall_biz_payment_order
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from mall_biz_payment_order
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.diligrp.cashier.mall.model.MallBizPaymentOrder">
    insert into mall_biz_payment_order (id, biz_payment_id, pay_trade_no,
      biz_order_id, order_id, trade_id,
      pay_trade_id, pay_fee, pay_time
      )
    values (#{id,jdbcType=BIGINT}, #{bizPaymentId,jdbcType=BIGINT}, #{payTradeNo,jdbcType=VARCHAR},
      #{bizOrderId,jdbcType=BIGINT}, #{orderId,jdbcType=VARCHAR}, #{tradeId,jdbcType=VARCHAR},
      #{payTradeId,jdbcType=VARCHAR}, #{payFee,jdbcType=BIGINT}, #{payTime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.diligrp.cashier.mall.model.MallBizPaymentOrder">
    insert into mall_biz_payment_order
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="bizPaymentId != null">
        biz_payment_id,
      </if>
      <if test="payTradeNo != null">
        pay_trade_no,
      </if>
      <if test="bizOrderId != null">
        biz_order_id,
      </if>
      <if test="orderId != null">
        order_id,
      </if>
      <if test="tradeId != null">
        trade_id,
      </if>
      <if test="payTradeId != null">
        pay_trade_id,
      </if>
      <if test="payFee != null">
        pay_fee,
      </if>
      <if test="payTime != null">
        pay_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="bizPaymentId != null">
        #{bizPaymentId,jdbcType=BIGINT},
      </if>
      <if test="payTradeNo != null">
        #{payTradeNo,jdbcType=VARCHAR},
      </if>
      <if test="bizOrderId != null">
        #{bizOrderId,jdbcType=BIGINT},
      </if>
      <if test="orderId != null">
        #{orderId,jdbcType=VARCHAR},
      </if>
      <if test="tradeId != null">
        #{tradeId,jdbcType=VARCHAR},
      </if>
      <if test="payTradeId != null">
        #{payTradeId,jdbcType=VARCHAR},
      </if>
      <if test="payFee != null">
        #{payFee,jdbcType=BIGINT},
      </if>
      <if test="payTime != null">
        #{payTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.diligrp.cashier.mall.model.MallBizPaymentOrder">
    update mall_biz_payment_order
    <set>
      <if test="bizPaymentId != null">
        biz_payment_id = #{bizPaymentId,jdbcType=BIGINT},
      </if>
      <if test="payTradeNo != null">
        pay_trade_no = #{payTradeNo,jdbcType=VARCHAR},
      </if>
      <if test="bizOrderId != null">
        biz_order_id = #{bizOrderId,jdbcType=BIGINT},
      </if>
      <if test="orderId != null">
        order_id = #{orderId,jdbcType=VARCHAR},
      </if>
      <if test="tradeId != null">
        trade_id = #{tradeId,jdbcType=VARCHAR},
      </if>
      <if test="payTradeId != null">
        pay_trade_id = #{payTradeId,jdbcType=VARCHAR},
      </if>
      <if test="payFee != null">
        pay_fee = #{payFee,jdbcType=BIGINT},
      </if>
      <if test="payState != null">
        pay_state = #{payState,jdbcType=INTEGER},
      </if>
      <if test="payTime != null">
        pay_time = #{payTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.diligrp.cashier.mall.model.MallBizPaymentOrder">
    update mall_biz_payment_order
    set biz_payment_id = #{bizPaymentId,jdbcType=BIGINT},
      pay_trade_no = #{payTradeNo,jdbcType=VARCHAR},
      biz_order_id = #{bizOrderId,jdbcType=BIGINT},
      order_id = #{orderId,jdbcType=VARCHAR},
      trade_id = #{tradeId,jdbcType=VARCHAR},
      pay_trade_id = #{payTradeId,jdbcType=VARCHAR},
      pay_fee = #{payFee,jdbcType=BIGINT},
      pay_time = #{payTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
    <insert id="batchInsert" parameterType="java.util.List">
      insert into mall_biz_payment_order (id, biz_payment_id, pay_trade_no,
        biz_order_id, order_id, trade_id,
        pay_trade_id, pay_fee, pay_time
        )
      values
      <foreach collection="list" item="item" index="index" separator=",">
        (#{item.id,jdbcType=BIGINT}, #{item.bizPaymentId,jdbcType=BIGINT}, #{item.payTradeNo,jdbcType=VARCHAR},
          #{item.bizOrderId,jdbcType=BIGINT}, #{item.orderId,jdbcType=VARCHAR}, #{item.tradeId,jdbcType=VARCHAR},
          #{item.payTradeId,jdbcType=VARCHAR}, #{item.payFee,jdbcType=BIGINT}, #{item.payTime,jdbcType=TIMESTAMP}
          )
      </foreach>
    </insert>

    <select id="getMallBizPaymentOrder" resultType="com.diligrp.cashier.mall.model.MallBizPaymentOrder">
        select
        <include refid="Base_Column_List" />
        from mall_biz_payment_order
        <where>
            and order_id = #{orderId}
            <if test="tradeId != null and tradeId != ''">
                and trade_id = #{tradeId}
            </if>
        </where>
    </select>

    <select id="listPaymentOrderByBizPaymentId"
            resultType="com.diligrp.cashier.mall.model.MallBizPaymentOrder">
        select
        <include refid="Base_Column_List" />
        from mall_biz_payment_order
        where biz_payment_id = #{bizPaymentId}
    </select>

    <select id="listPaymentOrderByBizOrderId" resultType="com.diligrp.cashier.mall.model.MallBizPaymentOrder">
        select
        <include refid="Base_Column_List" />
        from mall_biz_payment_order
        where biz_order_id = #{bizOrderId}
    </select>

    <update id="updateByPayment">
        update mall_biz_payment_order
        set
        pay_state = #{payState},
        pay_time = #{payTime}
        where biz_payment_id = #{id}
    </update>

    <select id="listPaymentOrderByBizOrderIds" resultType="com.diligrp.cashier.mall.model.MallBizPaymentOrder">
        select
        <include refid="Base_Column_List" />
        from mall_biz_payment_order
        where biz_order_id in
        <foreach collection="bizOrderIds" item="bizOrderId" index="index" open="(" close=")" separator=",">
            #{bizOrderId}
        </foreach>
    </select>
</mapper>