xuhy
2025-01-13 6906168ccb03e4865d3e9385a9ae4a6e87008ca1
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
<?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.stylefeng.guns.modular.system.dao.TWithdrawalMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TWithdrawal">
        <id column="id" property="id"/>
        <result column="driverId" property="driverId"/>
        <result column="receivePaymentName" property="receivePaymentName"/>
        <result column="receivePaymentAccount" property="receivePaymentAccount"/>
        <result column="withdrawalType" property="withdrawalType"/>
        <result column="withdrawalMoney" property="withdrawalMoney"/>
        <result column="withdrawalTime" property="withdrawalTime"/>
        <result column="status" property="status"/>
        <result column="openBank" property="openBank"/>
        <result column="remark" property="remark"/>
        <result column="receiptVoucher" property="receiptVoucher"/>
    </resultMap>
    <select id="getWithdrawalList" resultType="java.util.Map">
        select
        t.id,
        t.driverId,
        t.receivePaymentName,
        t.receivePaymentAccount,
        t.withdrawalType,
        t.withdrawalMoney,
        t.withdrawalTime,
        t.status,
        t.openBank,
        t.remark,
        t.receiptVoucher,
        d.name as driverName,
        d.phone as driverPhone,
        d.balance as driverBalance
        from t_withdrawal t
        left join t_driver d on t.driverId = d.id
        <where>
            <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
                and t.withdrawalTime &gt;= CONCAT(#{beginTime},' 00:00:00') and t.withdrawalTime &lt;= CONCAT(#{endTime},' 23:59:59')
            </if>
            <if test="driverName != null and driverName != ''">
                and d.name like concat('%',#{driverName},'%')
            </if>
            <if test="status != null">
                and t.status = #{status}
            </if>
        </where>
        order by t.withdrawalTime desc
    </select>
    <select id="excel" resultType="java.util.Map">
        select
        t.id,
        t.driverId,
        t.receivePaymentName,
        t.receivePaymentAccount,
        t.withdrawalType,
        t.withdrawalMoney,
        t.withdrawalTime,
        t.status,
        t.openBank,
        t.remark,
        t.receiptVoucher,
        d.name as driverName,
        d.phone as driverPhone,
        d.balance as driverBalance
        from t_withdrawal t
        left join t_driver d on t.driverId = d.id
        <where>
            <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
                and t.withdrawalTime &gt;= CONCAT(#{beginTime},' 00:00:00') and t.withdrawalTime &lt;= CONCAT(#{endTime},' 23:59:59')
            </if>
            <if test="driverName != null and driverName != ''">
                and d.name like concat('%',#{driverName},'%')
            </if>
            <if test="status != null">
                and t.status = #{status}
            </if>
        </where>
        order by t.withdrawalTime desc
    </select>
 
 
</mapper>