TdBPayBlncacWxSMapper.xml
5.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?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.pay.mapper.smapper.TdBPayBlncacWxSMapper">
<resultMap id="BaseResultMap" type="com.zteits.pay.domain.TdBPayBlncacWx">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="tradetime" property="tradetime" jdbcType="VARCHAR"/>
<result column="appid" property="appid" jdbcType="VARCHAR"/>
<result column="mchid" property="mchid" jdbcType="VARCHAR"/>
<result column="submch" property="submch" jdbcType="VARCHAR"/>
<result column="device_no" property="deviceNo" jdbcType="VARCHAR"/>
<result column="transaction_id" property="transactionId" jdbcType="VARCHAR"/>
<result column="out_trade_no" property="outTradeNo" jdbcType="VARCHAR"/>
<result column="openid" property="openid" jdbcType="VARCHAR"/>
<result column="trade_type" property="tradeType" jdbcType="VARCHAR"/>
<result column="trade_status" property="tradeStatus" jdbcType="VARCHAR"/>
<result column="bank" property="bank" jdbcType="VARCHAR"/>
<result column="currency" property="currency" jdbcType="VARCHAR"/>
<result column="total_fee" property="totalFee" jdbcType="VARCHAR"/>
<result column="coupon_fee" property="couponFee" jdbcType="VARCHAR"/>
<result column="refund_transaction_id" property="refundTransactionId" jdbcType="VARCHAR"/>
<result column="out_refund_no" property="outRefundNo" jdbcType="VARCHAR"/>
<result column="refund_fee" property="refundFee" jdbcType="VARCHAR"/>
<result column="refund_coupon_fee" property="refundCouponFee" jdbcType="VARCHAR"/>
<result column="refund_type" property="refundType" jdbcType="VARCHAR"/>
<result column="refund_status" property="refundStatus" jdbcType="VARCHAR"/>
<result column="productname" property="productname" jdbcType="VARCHAR"/>
<result column="attach" property="attach" jdbcType="VARCHAR"/>
<result column="fee" property="fee" jdbcType="VARCHAR"/>
<result column="rate" property="rate" jdbcType="VARCHAR"/>
<result column="data_state" property="dataState" jdbcType="INTEGER" />
<result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List">
id, tradetime, 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
</sql>
<insert id="insertWXPayBincac" parameterType="java.util.List">
insert into td_b_pay_blncac_wx (tradetime, 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="payBlncacWxList" separator="," item="item" index="index">
(
#{item.tradetime,jdbcType=VARCHAR}, #{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=VARCHAR},
#{item.tradeStatus,jdbcType=VARCHAR}, #{item.bank,jdbcType=VARCHAR}, #{item.currency,jdbcType=VARCHAR},
#{item.totalFee,jdbcType=VARCHAR}, #{item.couponFee,jdbcType=VARCHAR},
#{item.refundTransactionId,jdbcType=VARCHAR},
#{item.outRefundNo,jdbcType=VARCHAR}, #{item.refundFee,jdbcType=VARCHAR},
#{item.refundCouponFee,jdbcType=VARCHAR},
#{item.refundType,jdbcType=VARCHAR}, #{item.refundStatus,jdbcType=VARCHAR},
#{item.productname,jdbcType=VARCHAR},
#{item.attach,jdbcType=VARCHAR}, #{item.fee,jdbcType=VARCHAR}, #{item.rate,jdbcType=VARCHAR},
#{item.dataState,jdbcType=INTEGER},#{item.createDate,jdbcType=TIMESTAMP}
)
</foreach>
</insert>
<delete id="deleteWXPayBincacByTradeTime">
DELETE FROM td_b_pay_blncac_wx
<where>
<choose>
<when test="null == tradeTime">
1=2
</when>
<otherwise>
DATE(tradetime) >= DATE(#{tradeTime})
AND
DATE(tradetime) < date_sub(DATE(#{tradeTime}),interval -1 day)
</otherwise>
</choose>
</where>
</delete>
<!-- 根据支付单list查询微信对账单数据 -->
<select id="querywxPayBlncacListByPayOrderIds" resultMap="BaseResultMap">
select * from
td_b_pay_blncac_wx
where 1=1
and out_trade_no in
<foreach collection="list" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</select>
</mapper>