1
zj
2024-06-13 66c2ab8a29786a5ee15c649890c5ec3c876c4774
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?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.yami.trading.dao.user.WalletLogMapper">
 
 
 
    <select id="pagedQueryRecharge" resultType="java.util.HashMap">
        select
            log.order_no as order_no,
        log.create_time_ts as createTimeTs,
        log.wallettype as coin, log.amount as amount, log.status as status, date_format(log.create_time,'%y-%m-%d %h:%i:%s') as createtime,
            recharge.description as failure_msg, recharge.tx as hash, recharge.address as address, recharge.channel_amount as volume,
            recharge.coin as symbol, recharge.blockchain_name as blockchain_name, recharge.tx as tx
 
        from t_wallet_log as log
                 left join t_recharge_blockchain_order as recharge on recharge.order_no = log.order_no
 
        where 1=1
 
          and log.category =#{category}
            <if test="partyId!=null and partyId!=''">
                and log.party_id =#{partyId}
 
            </if>
 
 
        <if test="orderNoNull!=null and orderNoNull!=''">
            and log.order_no is not null and log.order_no !=''
 
        </if>
        order by log.create_time desc
    </select>
 
 
 
 
    <select id="pagedQueryWithdraw" resultType="java.util.HashMap">
        select
        log.order_no as order_no,
        log.wallettype as coin,
        log.amount as amount,
        log.status as status,
        date_format(log.create_time, '%Y-%m-%d %h:%i:%s') as createtime,
        withdraw.amount_fee as fee,
        log.create_time_ts as createTimeTs,
        withdraw.address as 'to',
        withdraw.failure_msg as failure_msg,
        withdraw.tx as tx,
        withdraw.volume as volume,
        withdraw.method as coin_blockchain,
        withdraw.remarks as remarks
        from
        t_wallet_log as log
        left join tz_withdraw_order as withdraw on withdraw.order_no = log.order_no
        where
        1 = 1
 
        and log.category =#{category}
        <if test="partyId!=null and partyId!=''">
            and log.party_id =#{partyId}
        </if>
 
 
        <if test="orderNoNull!=null and orderNoNull!=''">
            and log.order_no is not null and log.order_no !=''
        </if>
        order by log.create_time desc
    </select>
 
    <select id="pagedQueryRecords" resultType="java.util.HashMap">
        select
            log.category as category,
            log.wallettype as wallet_type,
            log.amount as amount,
            log.status as status,
            log.order_no order_no,
            date_format( log.create_time, '%Y-%m-%d %H:%i:%s' ) as createtimestr,
            withdraw.failure_msg as withdraw_failure_msg,
            recharge.description as recharge_failure_msg
        from
            t_wallet_log as log
                left join tz_withdraw_order as withdraw on withdraw.order_no = log.order_no
                left join t_recharge_blockchain_order as recharge on recharge.order_no = log.order_no
        where
            1 = 1
          and log.order_no is not null
          and log.order_no != ''
         and log.PARTY_ID =#{partyId}
            <choose>
                <when test="category!=null and category!=''">
                    and log.category=#{category}
                </when>
                    <otherwise>
                        and (log.category = 'recharge' or log.category = 'withdraw')
                    </otherwise>
 
            </choose>
        <if test="startTime != null  and startTime!='' ">
            AND <![CDATA[ DATE(log.create_time) >= DATE(#{startTime})  ]]>
        </if>
        <if test="endTime != null and endTime!=''">
            AND <![CDATA[ DATE(log.create_time) <= DATE(#{endTime}) ]]>
        </if>
        <if test="walletType != null  and walletType!=''">
            AND  log.wallettype =#{walletType}
        </if>
 
        <if test="status != null">
            AND  log.status =#{status}
        </if>
        order by log.create_time desc
    </select>
 
 
</mapper>