陶杰
2024-12-06 984c102eb4e632985e45b7c4be1545c53c87b589
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
<?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.supplier.SupplierSubMapper">
 
 
    <select id="querySupplierSub" resultType="com.mzl.flower.dto.response.supplier.SupplierSubVO">
        SELECT
        t.*,s.name as supplierName,s.contact_name as contactName,s.contact_tel as contactTel
        FROM
            t_supplier_sub_info t
        LEFT JOIN t_supplier_info s ON t.supplier_id = s.id
        WHERE t.deleted = 0
        <if test="dto.supplierId!=null ">
            AND t.supplier_id =#{dto.supplierId}
        </if>
 
        <if test="dto.supplierName!=null and dto.supplierName!=''">
            AND s.name LIKE CONCAT('%',#{dto.supplierName}, '%')
        </if>
 
        <if test="dto.supplierPhone!=null and dto.supplierPhone!=''">
            AND s.contact_tel LIKE CONCAT('%',#{dto.supplierPhone}, '%')
        </if>
 
        <if test="dto.phone!=null and dto.phone!=''">
            AND t.phone LIKE CONCAT('%',#{dto.phone}, '%')
        </if>
 
<!--        <if test="dto.createDateBegin!=null ">-->
<!--            <![CDATA[-->
<!--               AND t.create_time >= #{dto.createDateBegin}-->
<!--            ]]>-->
<!--        </if>-->
<!--        <if test="dto.createDateEnd!=null ">-->
<!--            <![CDATA[-->
<!--               AND t.create_time <= #{dto.createDateEnd}-->
<!--            ]]>-->
<!--        </if>-->
        <if test="dto.isEnabled!=null">
            AND t.is_enabled = #{dto.isEnabled}
        </if>
        <if test="dto.id!=null">
            AND t.id = #{dto.id}
        </if>
        order by t.create_time desc
    </select>
 
</mapper>