1
zhujie
6 天以前 ec15861e14c66c38b1a8f5fffc6975d7da6c315c
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.mzl.flower.mapper.wallet.WalletWithdrawRecordMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.mzl.flower.entity.wallet.WalletWithdrawRecordDO">
        <id column="id" property="id" />
        <result column="create_by" property="createBy" />
        <result column="create_time" property="createTime" />
        <result column="update_by" property="updateBy" />
        <result column="update_time" property="updateTime" />
        <result column="deleted" property="deleted" />
        <result column="supplier_id" property="supplierId" />
        <result column="amount" property="amount" />
        <result column="once_withdraw_amount" property="onceWithdrawAmount" />
        <result column="withdraw_state" property="withdrawState" />
        <result column="method" property="method" />
        <result column="approve_by" property="approveBy" />
        <result column="approve_time" property="approveTime" />
        <result column="approve_state" property="approveState" />
        <result column="reject_reason" property="rejectReason" />
    </resultMap>
    <select id="queryPage" resultType="com.mzl.flower.dto.response.wallet.WalletWithdrawRecordVO">
        select t.* ,s.name supplierName , u.nick_name AS approveName from t_wallet_withdraw_record t
        left join t_supplier_info s on t.supplier_id = s.id
        LEFT JOIN t_user u ON t.approve_by = u.id
        where t.deleted= 0
        <if test="dto.supplierName != null and dto.supplierName != ''">
            and s.name like concat('%', #{dto.supplierName}, '%')
        </if>
        <if test="dto.supplierId != null and dto.supplierId != ''">
            and t.supplier_id = #{dto.supplierId}
        </if>
        <if test="dto.approveState != null and dto.approveState != ''">
            and t.approve_state = #{dto.approveState}
        </if>
        <if test="dto.withdrawState != null and dto.withdrawState != ''">
            and t.withdraw_state = #{dto.withdrawState}
        </if>
 
        <if test="dto.createStartDate!=null ">
               AND DATE_FORMAT(t.create_time, '%Y-%m-%d') &gt;= #{dto.createStartDate}
        </if>
        <if test="dto.endEndDate!=null ">
               AND DATE_FORMAT(t.create_time, '%Y-%m-%d') &lt;= #{dto.endEndDate}
        </if>
        <if test="dto.approveStartDate!=null ">
            AND DATE_FORMAT(t.approve_time, '%Y-%m-%d') &gt;= #{dto.approveStartDate}
        </if>
        <if test="dto.approveEndDate!=null ">
            AND DATE_FORMAT(t.approve_time, '%Y-%m-%d') &lt;= #{dto.approveEndDate}
        </if>
 
        order by t.create_time desc
    </select>
 
</mapper>