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