WithdrawRecordMapper.xml
3.3 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
<?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.sibu.orderHelper.integral.dao.WithdrawRecordDao">
<resultMap type="com.sibu.orderHelper.integral.reponse.WithdrawRecordResponse" id="withdrawRecordResponse">
<id column="id" property="id" />
<result column="member_id" property="memberId" />
<result column="partner_trade_no" property="partnerTradeNo" />
<result column="open_id" property="openId" />
<result column="amount" property="amount" />
<result column="user_name" property="userName" />
<result column="pay_desc" property="payDesc" />
<result column="pay_dt" property="payDt" />
<result column="create_dt" property="createDt" />
<result column="status" property="status" />
<result column="fail_code" property="failCode" />
<result column="operator" property="operator" />
</resultMap>
<resultMap type="com.sibu.orderHelper.integral.reponse.WithdrawRecordDetailResponse" id="withdrawRecordDetailResponse">
<result column="amount" property="amount" />
<result column="wechat" property="wechat" />
<collection property="statusTimeLine" column="id" ofType="com.sibu.orderHelper.integral.reponse.WithDrawRecodeDetailTimeLineResponse">
<result column="status" property="status" />
</collection>
</resultMap>
<!--查询已提现金额-->
<select id="selectHasWithdrawSum" parameterType="java.util.Map" resultType="java.math.BigDecimal">
select sum(amount) from t_withdraw_record where status in(1,2) and member_id=#{memberId}
</select>
<!--添加申请提现记录-->
<insert id="insertWithdrawRecord" useGeneratedKeys="true" keyProperty="id" parameterType="com.sibu.orderHelper.integral.model.AddWithdrawRecord">
insert into t_withdraw_record(member_id,partner_trade_no,open_id,amount,user_name,wechat)
VALUE(
#{memberId},
#{partnerTradeNo},
#{openId},
#{amount},
#{userName},
#{wechat}
)
</insert>
<!--添加申请提现详情进度记录-->
<insert id="insertWithdrawRecordDetail" parameterType="com.sibu.orderHelper.integral.model.AddWithDrawDetailBean">
insert into t_withdraw_record_status(withdraw_recode_id,status,create_dt)
VALUE(
#{withdrawRecodeId},
#{status},
NOW()
)
</insert>
<!--分页查询提现记录-->
<select id="selectHasWithdrawForPage" parameterType="java.util.Map" resultMap="withdrawRecordResponse">
select * from t_withdraw_record where member_id=#{memberId} limit #{pageNow},#{pageSize}
</select>
<!--查询提现记录详情-->
<select id="selectWithdrawDetail" parameterType="java.util.Map" resultMap="withdrawRecordDetailResponse">
select ts.status,t.amount,t.wechat from t_withdraw_record_status ts,t_withdraw_record t where ts.withdraw_recode_id=#{withdrawRecordId} AND t.id=ts.withdraw_recode_id ORDER BY ts.create_dt DESC
</select>
<!--查询总记录条数-->
<select id="selectCountWithdraw" parameterType="java.util.Map" resultType="java.lang.Integer">
select count(1) from t_withdraw_record where member_id=#{memberId}
</select>
</mapper>