<?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>