TdBPayBlncacWxTransferSMapper.xml 8.5 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.zteits.order.mapper.smapper.TdBPayBlncacWxTransferSMapper">
    <resultMap id="BaseResultMap" type="com.zteits.order.domain.TdBPayBlncacWxTransfer">
        <id column="id" jdbcType="INTEGER" property="id" />
        <result column="trade_time" jdbcType="TIMESTAMP" property="tradeTime" />
        <result column="org_id" jdbcType="BIGINT" property="orgId" />
        <result column="appid" jdbcType="VARCHAR" property="appid" />
        <result column="mchid" jdbcType="VARCHAR" property="mchid" />
        <result column="submch" jdbcType="VARCHAR" property="submch" />
        <result column="device_no" jdbcType="VARCHAR" property="deviceNo" />
        <result column="transaction_id" jdbcType="VARCHAR" property="transactionId" />
        <result column="out_trade_no" jdbcType="VARCHAR" property="outTradeNo" />
        <result column="openid" jdbcType="VARCHAR" property="openid" />
        <result column="trade_type" jdbcType="INTEGER" property="tradeType" />
        <result column="trade_status" jdbcType="INTEGER" property="tradeStatus" />
        <result column="bank" jdbcType="VARCHAR" property="bank" />
        <result column="currency" jdbcType="VARCHAR" property="currency" />
        <result column="total_fee" jdbcType="BIGINT" property="totalFee" />
        <result column="coupon_fee" jdbcType="BIGINT" property="couponFee" />
        <result column="refund_transaction_id" jdbcType="VARCHAR" property="refundTransactionId" />
        <result column="out_refund_no" jdbcType="VARCHAR" property="outRefundNo" />
        <result column="refund_fee" jdbcType="BIGINT" property="refundFee" />
        <result column="refund_coupon_fee" jdbcType="BIGINT" property="refundCouponFee" />
        <result column="refund_type" jdbcType="INTEGER" property="refundType" />
        <result column="refund_status" jdbcType="INTEGER" property="refundStatus" />
        <result column="productname" jdbcType="VARCHAR" property="productname" />
        <result column="attach" jdbcType="VARCHAR" property="attach" />
        <result column="fee" jdbcType="BIGINT" property="fee" />
        <result column="rate" jdbcType="VARCHAR" property="rate" />
        <result column="data_state" jdbcType="INTEGER" property="dataState" />
        <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    </resultMap>
    <sql id="Example_Where_Clause">
        <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">
        <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">
        id,
        trade_time,
        org_id,
        appid,
        mchid,
        submch,
        device_no,
        transaction_id,
        out_trade_no,
        openid,
        trade_type,
        trade_status,
        bank,
        currency,
        total_fee,
        coupon_fee,
        refund_transaction_id,
        out_refund_no,
        refund_fee,
        refund_coupon_fee,
        refund_type,
        refund_status,
        productname,
        attach,
        fee,
        rate,
        data_state,
        create_date
    </sql>

    <insert id="insertWXPayBincacTransfer" parameterType="java.util.List">
        insert into td_b_pay_blncac_wx_transfer
        (
        trade_time,org_id, appid, mchid,
        submch, device_no, transaction_id,
        out_trade_no, openid, trade_type,
        trade_status, bank, currency,
        total_fee, coupon_fee, refund_transaction_id,
        out_refund_no, refund_fee, refund_coupon_fee,
        refund_type, refund_status, productname,
        attach, fee, rate,data_state,create_date
        )
        values
        <foreach collection="payBlncacWxTransfers" separator="," item="item" index="index">
            (
            #{item.tradeTime,jdbcType=TIMESTAMP},
            #{item.orgId,jdbcType=BIGINT},
            #{item.appid,jdbcType=VARCHAR},
            #{item.mchid,jdbcType=VARCHAR},
            #{item.submch,jdbcType=VARCHAR},
            #{item.deviceNo,jdbcType=VARCHAR},
            #{item.transactionId,jdbcType=VARCHAR},
            #{item.outTradeNo,jdbcType=VARCHAR},
            #{item.openid,jdbcType=VARCHAR},
            #{item.tradeType,jdbcType=INTEGER},
            #{item.tradeStatus,jdbcType=INTEGER},
            #{item.bank,jdbcType=VARCHAR},
            #{item.currency,jdbcType=VARCHAR},
            #{item.totalFee,jdbcType=BIGINT},
            #{item.couponFee,jdbcType=BIGINT},
            #{item.refundTransactionId,jdbcType=VARCHAR},
            #{item.outRefundNo,jdbcType=VARCHAR},
            #{item.refundFee,jdbcType=BIGINT},
            #{item.refundCouponFee,jdbcType=BIGINT},
            #{item.refundType,jdbcType=INTEGER},
            #{item.refundStatus,jdbcType=INTEGER},
            #{item.productname,jdbcType=VARCHAR},
            #{item.attach,jdbcType=VARCHAR},
            #{item.fee,jdbcType=BIGINT},
            #{item.rate,jdbcType=VARCHAR},
            #{item.dataState,jdbcType=INTEGER},
            #{item.createDate,jdbcType=TIMESTAMP}
            )

        </foreach>
    </insert>

    <delete id="deleteWXPayBincacTransferByTradeTime">
        DELETE FROM td_b_pay_blncac_wx_transfer
        <where>
            <choose>
                <when test="null == tradeTime">
                    1=2
                </when>
                <otherwise>
                    DATE(trade_time) &gt;= DATE(#{tradeTime})
                    AND
                    DATE(trade_time) &lt; date_sub(DATE(#{tradeTime}),interval -1 day)
                </otherwise>
            </choose>

        </where>

    </delete>


</mapper>