无关风月
2024-08-20 f237a61c412870933f47316a011237cd538de9bc
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
<?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.WithdrawalMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.Withdrawal">
        <id column="id" property="id" />
        <result column="userId" property="userId" />
        <result column="insertTime`" property="insertTime`" />
        <result column="amount" property="amount" />
        <result column="applyAmount" property="applyAmount" />
        <result column="state" property="state" />
        <result column="payment" property="payment" />
        <result column="reason" property="reason" />
    </resultMap>
 
 
    <select id="list" resultType="com.stylefeng.guns.modular.system.model.MoneyVO">
        select t1.*,t2.name as userName,t2.phone as phone
        from t_withdrawal t1
        left join t_user t2 on t1.userId= t2.id
        <where>
        <if test="null != state">
            and t1.state = #{state}
        </if>
        <if test="null != payment">
            and t1.payment = #{payment}
        </if>
        <if test="null != userName and '' != userName">
            and t2.name like CONCAT('%', #{userName}, '%')
        </if>
        <if test="null != phone and '' != phone">
            and t2.phone like CONCAT('%', #{phone}, '%')
        </if>
        <if test="null != startTime ">
            and t1.insertTime between #{startTime1} and #{endTime1}
        </if>
        </where>
        order by t1.state,t1.insertTime desc
    </select>
    <select id="rechargeList" resultType="com.stylefeng.guns.modular.system.vo.RechargeListVO">
        select t1.*,t2.name as userName,t2.phone as phone
        from t_recharge t1
        left join t_user t2 on t1.userId= t2.id
        where t1.state = 2
        <if test="null != userName and '' != userName">
            and t2.name like CONCAT('%', #{userName}, '%')
        </if>
        <if test="null != phone and '' != phone">
            and t2.phone like CONCAT('%', #{phone}, '%')
        </if>
        <if test="null != startTime ">
            and t1.insertTime between #{startTime} and #{endTime}
        </if>
        order by t1.state asc,t1.insertTime desc
    </select>
</mapper>