MallBizPaymentDao.xml 13.2 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.MallBizPaymentDao">
    <resultMap id="BaseResultMap" type="com.diligrp.cashier.mall.model.MallBizPayment">
        <id column="id" jdbcType="BIGINT" property="id" />
        <result column="pay_trade_no" jdbcType="VARCHAR" property="payTradeNo" />
        <result column="biz_order_id" jdbcType="VARCHAR" property="bizOrderId" />
        <result column="order_id" jdbcType="VARCHAR" property="orderId" />
        <result column="trade_id" jdbcType="VARCHAR" property="tradeId" />
        <result column="user_code" jdbcType="VARCHAR" property="userCode" />
        <result column="pay_trade_id" jdbcType="VARCHAR" property="payTradeId" />
        <result column="firm_id" jdbcType="VARCHAR" property="firmId" />
        <result column="mch_id" jdbcType="VARCHAR" property="mchId" />
        <result column="card_no" jdbcType="VARCHAR" property="cardNo" />
        <result column="username" jdbcType="VARCHAR" property="username" />
        <result column="user_id" jdbcType="BIGINT" property="userId" />
        <result column="account_id" jdbcType="BIGINT" property="accountId" />
        <result column="fund_account_id" jdbcType="BIGINT" property="fundAccountId" />
        <result column="open_id" jdbcType="VARCHAR" property="openId" />
        <result column="pay_fee" jdbcType="BIGINT" property="payFee" />
        <result column="pay_state" jdbcType="TINYINT" property="payState" />
        <result column="pay_time" jdbcType="TIMESTAMP" property="payTime" />
        <result column="channel_id" jdbcType="TINYINT" property="channelId" />
        <result column="cashier_url" jdbcType="VARCHAR" property="cashierUrl" />
        <result column="payment_callback" jdbcType="VARCHAR" property="paymentCallback" />
        <result column="version" jdbcType="INTEGER" property="version" />
        <result column="created_time" jdbcType="TIMESTAMP" property="createdTime" />
        <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" />
    </resultMap>
    <sql id="Base_Column_List">
        id, pay_trade_no, biz_order_id, order_id, trade_id, pay_trade_id, firm_id, mch_id, card_no,
    username, user_id, account_id, fund_account_id, open_id, pay_fee, pay_state, pay_time,
    channel_id, cashier_url, payment_callback, version, created_time, modified_time
    </sql>
    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from mall_biz_payment
        where id = #{id,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete
        from mall_biz_payment
        where id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.diligrp.cashier.mall.model.MallBizPayment">
        insert into mall_biz_payment (id, pay_trade_no, biz_order_id,
                                      order_id, trade_id, pay_trade_id,
                                      firm_id, mch_id, card_no, username,
                                      user_id, account_id, fund_account_id,
                                      open_id, pay_fee, pay_state,
                                      pay_time, channel_id, cashier_url,
                                      payment_callback, version, created_time,
                                      modified_time)
        values (#{id,jdbcType=BIGINT}, #{payTradeNo,jdbcType=VARCHAR}, #{bizOrderId,jdbcType=VARCHAR},
                #{orderId,jdbcType=VARCHAR}, #{tradeId,jdbcType=VARCHAR}, #{payTradeId,jdbcType=VARCHAR},
                #{firmId,jdbcType=VARCHAR}, #{mchId,jdbcType=VARCHAR}, #{cardNo,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR},
                #{userId,jdbcType=BIGINT}, #{accountId,jdbcType=BIGINT}, #{fundAccountId,jdbcType=BIGINT},
                #{openId,jdbcType=VARCHAR}, #{payFee,jdbcType=BIGINT}, #{payState,jdbcType=TINYINT},
                #{payTime,jdbcType=TIMESTAMP}, #{channelId,jdbcType=TINYINT}, #{cashierUrl,jdbcType=VARCHAR},
                #{paymentCallback,jdbcType=VARCHAR}, #{version,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP},
                #{modifiedTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective" parameterType="com.diligrp.cashier.mall.model.MallBizPayment">
        insert into mall_biz_payment
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">
                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="userCode != null">
                user_code,
            </if>
            <if test="payTradeId != null">
                pay_trade_id,
            </if>
            <if test="firmId != null">
                firm_id,
            </if>
            <if test="mchId != null">
                mch_id,
            </if>
            <if test="cardNo != null">
                card_no,
            </if>
            <if test="username != null">
                username,
            </if>
            <if test="userId != null">
                user_id,
            </if>
            <if test="accountId != null">
                account_id,
            </if>
            <if test="fundAccountId != null">
                fund_account_id,
            </if>
            <if test="openId != null">
                open_id,
            </if>
            <if test="payFee != null">
                pay_fee,
            </if>
            <if test="payState != null">
                pay_state,
            </if>
            <if test="payTime != null">
                pay_time,
            </if>
            <if test="channelId != null">
                channel_id,
            </if>
            <if test="cashierUrl != null">
                cashier_url,
            </if>
            <if test="paymentCallback != null">
                payment_callback,
            </if>
            <if test="version != null">
                version,
            </if>
            <if test="createdTime != null">
                created_time,
            </if>
            <if test="modifiedTime != null">
                modified_time,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">
                #{id,jdbcType=BIGINT},
            </if>
            <if test="payTradeNo != null">
                #{payTradeNo,jdbcType=VARCHAR},
            </if>
            <if test="bizOrderId != null">
                #{bizOrderId,jdbcType=VARCHAR},
            </if>
            <if test="orderId != null">
                #{orderId,jdbcType=VARCHAR},
            </if>
            <if test="tradeId != null">
                #{tradeId,jdbcType=VARCHAR},
            </if>
            <if test="userCode != null">
                #{userCode,jdbcType=VARCHAR},
            </if>
            <if test="payTradeId != null">
                #{payTradeId,jdbcType=VARCHAR},
            </if>
            <if test="firmId != null">
                #{firmId,jdbcType=VARCHAR},
            </if>
            <if test="mchId != null">
                #{mchId,jdbcType=VARCHAR},
            </if>
            <if test="cardNo != null">
                #{cardNo,jdbcType=VARCHAR},
            </if>
            <if test="username != null">
                #{username,jdbcType=VARCHAR},
            </if>
            <if test="userId != null">
                #{userId,jdbcType=BIGINT},
            </if>
            <if test="accountId != null">
                #{accountId,jdbcType=BIGINT},
            </if>
            <if test="fundAccountId != null">
                #{fundAccountId,jdbcType=BIGINT},
            </if>
            <if test="openId != null">
                #{openId,jdbcType=VARCHAR},
            </if>
            <if test="payFee != null">
                #{payFee,jdbcType=BIGINT},
            </if>
            <if test="payState != null">
                #{payState,jdbcType=TINYINT},
            </if>
            <if test="payTime != null">
                #{payTime,jdbcType=TIMESTAMP},
            </if>
            <if test="channelId != null">
                #{channelId,jdbcType=TINYINT},
            </if>
            <if test="cashierUrl != null">
                #{cashierUrl,jdbcType=VARCHAR},
            </if>
            <if test="paymentCallback != null">
                #{paymentCallback,jdbcType=VARCHAR},
            </if>
            <if test="version != null">
                #{version,jdbcType=INTEGER},
            </if>
            <if test="createdTime != null">
                #{createdTime,jdbcType=TIMESTAMP},
            </if>
            <if test="modifiedTime != null">
                #{modifiedTime,jdbcType=TIMESTAMP},
            </if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.diligrp.cashier.mall.model.MallBizPayment">
        update mall_biz_payment
        <set>
            <if test="payTradeNo != null">
                pay_trade_no = #{payTradeNo,jdbcType=VARCHAR},
            </if>
            <if test="bizOrderId != null">
                biz_order_id = #{bizOrderId,jdbcType=VARCHAR},
            </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="firmId != null">
                firm_id = #{firmId,jdbcType=VARCHAR},
            </if>
            <if test="mchId != null">
                mch_id = #{mchId,jdbcType=VARCHAR},
            </if>
            <if test="cardNo != null">
                card_no = #{cardNo,jdbcType=VARCHAR},
            </if>
            <if test="username != null">
                username = #{username,jdbcType=VARCHAR},
            </if>
            <if test="userId != null">
                user_id = #{userId,jdbcType=BIGINT},
            </if>
            <if test="accountId != null">
                account_id = #{accountId,jdbcType=BIGINT},
            </if>
            <if test="fundAccountId != null">
                fund_account_id = #{fundAccountId,jdbcType=BIGINT},
            </if>
            <if test="openId != null">
                open_id = #{openId,jdbcType=VARCHAR},
            </if>
            <if test="payFee != null">
                pay_fee = #{payFee,jdbcType=BIGINT},
            </if>
            <if test="payState != null">
                pay_state = #{payState,jdbcType=TINYINT},
            </if>
            <if test="payTime != null">
                pay_time = #{payTime,jdbcType=TIMESTAMP},
            </if>
            <if test="channelId != null">
                channel_id = #{channelId,jdbcType=TINYINT},
            </if>
            <if test="cashierUrl != null">
                cashier_url = #{cashierUrl,jdbcType=VARCHAR},
            </if>
            <if test="paymentCallback != null">
                payment_callback = #{paymentCallback,jdbcType=VARCHAR},
            </if>
            version = version + 1,
        </set>
        where id = #{id}
        and version = #{version}
    </update>
    <update id="updateByPrimaryKey" parameterType="com.diligrp.cashier.mall.model.MallBizPayment">
        update mall_biz_payment
        set pay_trade_no = #{payTradeNo,jdbcType=VARCHAR},
            biz_order_id = #{bizOrderId,jdbcType=VARCHAR},
            order_id = #{orderId,jdbcType=VARCHAR},
            trade_id = #{tradeId,jdbcType=VARCHAR},
            pay_trade_id = #{payTradeId,jdbcType=VARCHAR},
            firm_id = #{firmId,jdbcType=VARCHAR},
            mch_id = #{mchId,jdbcType=VARCHAR},
            card_no = #{cardNo,jdbcType=VARCHAR},
            username = #{username,jdbcType=VARCHAR},
            user_id = #{userId,jdbcType=BIGINT},
            account_id = #{accountId,jdbcType=BIGINT},
            fund_account_id = #{fundAccountId,jdbcType=BIGINT},
            open_id = #{openId,jdbcType=VARCHAR},
            pay_fee = #{payFee,jdbcType=BIGINT},
            pay_state = #{payState,jdbcType=TINYINT},
            pay_time = #{payTime,jdbcType=TIMESTAMP},
            channel_id = #{channelId,jdbcType=TINYINT},
            cashier_url = #{cashierUrl,jdbcType=VARCHAR},
            payment_callback = #{paymentCallback,jdbcType=VARCHAR},
            version = #{version,jdbcType=INTEGER},
            created_time = #{createdTime,jdbcType=TIMESTAMP},
            modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
        where id = #{id,jdbcType=BIGINT}
    </update>

    <select id="getByPayTradeId" resultType="com.diligrp.cashier.mall.model.MallBizPayment">
        select
        <include refid="Base_Column_List" />
        from mall_biz_payment
        where pay_trade_id = #{tradeId,jdbcType=VARCHAR}
    </select>

</mapper>