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
116
117
118
<?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="cn.iocoder.yudao.module.wealth.dal.mysql.commissionPayable.CommissionPayableMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
-->
<select id="getCommissionPayablePage" resultType="cn.iocoder.yudao.module.wealth.vo.commissionPayable.CommissionPayableBackVO">
select cp.*
from ecw_commission_payable cp
left join ecw_customer c
on c.id = cp.customer_id
where cp.deleted = 0
<if test="query.feeType != null">
AND cp.fee_type = #{query.feeType}
</if>
<if test="query.state != null">
AND cp.state = #{query.state}
</if>
<if test="query.customerId != null">
AND cp.customer_id = #{query.customerId}
</if>
<if test="query.customerName != null and query.customerName != ''">
AND cp.customer_name LIKE concat('%',#{query.customerName},'%')
</if>
<if test="query.payableNo != null and query.payableNo !=''">
AND cp.payable_no LIKE concat('%',#{query.payableNo},'%')
</if>
<if test="query.paymentId != null">
AND cp.payment_id = #{query.paymentId}
</if>
<if test="query.paymentNo != null and query.paymentNo !=''">
AND cp.payment_no LIKE concat('%',#{query.paymentNo},'%')
</if>
<if test="query.orderNo != null and query.orderNo !=''">
AND cp.order_no LIKE concat('%',#{query.orderNo},'%')
</if>
<if test="query.startWarehouseId != null ">
AND cp.start_warehouse_id = #{query.startWarehouseId}
</if>
<if test="query.destWarehouseId != null ">
AND cp.dest_warehouse_id = #{query.destWarehouseId}
</if>
<if test="query.transportId != null ">
AND cp.transport_id = #{query.transportId}
</if>
<if test="query.ids != null ">
AND cp.id in
<foreach item="id" index="1" collection="query.ids" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<!-- <if test="query.searchKey != null and query.searchKey !=''">-->
<!-- AND (-->
<!-- c.name LIKE concat('%',#{query.searchKey},'%')-->
<!-- or c.number LIKE concat('%',#{query.searchKey},'%')-->
<!-- or c.new_phone LIKE concat('%',#{query.searchKey},'%')-->
<!-- )-->
<!-- </if>-->
</select>
<select id="getCommissionPayableList" resultType="cn.iocoder.yudao.module.wealth.vo.commissionPayable.CommissionPayableBackVO">
select cp.*
from ecw_commission_payable cp
left join ecw_customer c
on c.id = cp.customer_id
where cp.deleted = 0
<if test="query.feeType != null">
AND cp.fee_type = #{query.feeType}
</if>
<if test="query.state != null">
AND cp.state = #{query.state}
</if>
<if test="query.customerId != null">
AND cp.customer_id = #{query.customerId}
</if>
<if test="query.customerName != null and query.customerName != ''">
AND cp.customer_name LIKE concat('%',#{query.customerName},'%')
</if>
<if test="query.payableNo != null and query.payableNo !=''">
AND cp.payable_no LIKE concat('%',#{query.payableNo},'%')
</if>
<if test="query.paymentId != null">
AND cp.payment_id = #{query.paymentId}
</if>
<if test="query.paymentNo != null and query.paymentNo !=''">
AND cp.payment_no LIKE concat('%',#{query.paymentNo},'%')
</if>
<if test="query.orderNo != null and query.orderNo !=''">
AND cp.order_no LIKE concat('%',#{query.orderNo},'%')
</if>
<if test="query.startWarehouseId != null ">
AND cp.start_warehouse_id = #{query.startWarehouseId}
</if>
<if test="query.destWarehouseId != null ">
AND cp.dest_warehouse_id = #{query.destWarehouseId}
</if>
<if test="query.transportId != null ">
AND cp.transport_id = #{query.transportId}
</if>
<if test="query.ids != null ">
AND cp.id in
<foreach item="id" index="1" collection="query.ids" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<!-- <if test="query.searchKey != null and query.searchKey !=''">-->
<!-- AND (-->
<!-- c.name LIKE concat('%',#{query.searchKey},'%')-->
<!-- or c.number LIKE concat('%',#{query.searchKey},'%')-->
<!-- or c.new_phone LIKE concat('%',#{query.searchKey},'%')-->
<!-- )-->
<!-- </if>-->
</select>
</mapper>