PaymentTradeOrderMapper.xml
4.21 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
<?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="cn.com.glsx.dj.platform.payment.mapper.PaymentTradeOrderMapper">
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.platform.payment.model.PaymentTradeOrder">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="out_trade_no" jdbcType="VARCHAR" property="outTradeNo" />
<result column="business_app_out_id" jdbcType="VARCHAR" property="businessAppOutId" />
<result column="pay_platform" jdbcType="VARCHAR" property="payPlatform" />
<result column="mch_id" jdbcType="VARCHAR" property="mchId" />
<result column="order_code" jdbcType="VARCHAR" property="orderCode" />
<result column="trade_no" jdbcType="VARCHAR" property="tradeNo" />
<result column="total_fee" jdbcType="INTEGER" property="totalFee" />
<result column="fee" jdbcType="INTEGER" property="fee" />
<result column="currency" jdbcType="VARCHAR" property="currency" />
<result column="subject" jdbcType="VARCHAR" property="subject" />
<result column="business_code" jdbcType="VARCHAR" property="businessCode" />
<result column="attach_data" jdbcType="VARCHAR" property="attachData" />
<result column="pay_type" jdbcType="TINYINT" property="payType" />
<result column="trade_status" jdbcType="TINYINT" property="tradeStatus" />
<result column="biz_notify_url" jdbcType="VARCHAR" property="bizNotifyUrl" />
<result column="trade_time" jdbcType="BIGINT" property="tradeTime" />
<result column="trade_expire" jdbcType="BIGINT" property="tradeExpire" />
<result column="trade_result" jdbcType="VARCHAR" property="tradeResult" />
<result column="payee_usercode" property="payeeUsercode"/>
<result column="refund_fee" property="refundFee"/>
<result column="created_by" jdbcType="VARCHAR" property="createdBy" />
<result column="created_date" jdbcType="TIMESTAMP" property="createdDate" />
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy" />
<result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate" />
<result column="deleted_flag" jdbcType="CHAR" property="deletedFlag" />
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
-->
id, out_trade_no,business_app_out_id,pay_platform,mch_id, order_code, trade_no, total_fee,fee, currency, subject, business_code,
attach_data, pay_type, trade_status, biz_notify_url, trade_time, trade_expire, trade_result,payee_usercode,refund_fee,
created_by, created_date, updated_by, updated_date, deleted_flag
</sql>
<select id="selectOneByOutTradeNo" parameterType="java.lang.String" resultMap="BaseResultMap">
select <include refid="Base_Column_List" /> from dj_payment_trade_order
where deleted_flag = 'N'
and trade_expire > DATE_FORMAT(NOW(),'%Y%m%d%H%i%s')
and out_trade_no = #{outTradeNo} and trade_status = 1
</select>
<select id="selectOneByOrderCode" parameterType="java.lang.String" resultMap="BaseResultMap">
select <include refid="Base_Column_List" /> from dj_payment_trade_order
where deleted_flag = 'N'
and trade_expire > DATE_FORMAT(NOW(),'%Y%m%d%H%i%s')
and order_code = #{orderCode} and trade_status = 1
order by id desc
limit 1
</select>
<select id="selectNotPay" parameterType="cn.com.glsx.dj.platform.payment.model.PaymentTradeOrder" resultMap="BaseResultMap">
select <include refid="Base_Column_List" /> from dj_payment_trade_order
where deleted_flag = 'N'
and trade_expire > DATE_FORMAT(NOW(),'%Y%m%d%H%i%s')
and order_code = #{orderCode} and trade_status = 1 and business_app_out_id = #{businessAppOutId}
order by id desc
limit 1
</select>
<select id="listTradeOrderByOutTradeNos" parameterType="java.util.List" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from dj_payment_trade_order
where deleted_flag = 'N'
<if test="outTradeNos != null and outTradeNos.size()>0">
and out_trade_no in
<foreach collection="outTradeNos" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>