<?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.SupplierMapper">
|
|
|
<select id="querySupplier" resultType="com.mzl.flower.dto.response.supplier.SupplierDTO">
|
SELECT
|
t.*,
|
s.name as stationName,
|
st.`name` as typeName
|
FROM
|
t_supplier_info t
|
LEFT JOIN t_station s ON t.station_id = s.id
|
LEFT JOIN t_supplier_type st ON t.type_id = st.id
|
WHERE t.deleted = 0
|
<if test="dto.name!=null and dto.name!=''">
|
AND t.name LIKE CONCAT('%',#{dto.name}, '%')
|
</if>
|
<if test="dto.status!=null and dto.status!=''">
|
AND t.status = #{dto.status}
|
</if>
|
<if test="dto.tel!=null and dto.tel!=''">
|
AND t.contact_tel LIKE CONCAT('%',#{dto.tel}, '%')
|
</if>
|
<if test="dto.stationId!=null and dto.stationId!=''">
|
AND t.station_id = #{dto.stationId}
|
</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>
|
order by t.create_time desc
|
</select>
|
<select id="findSupplierDetail" resultType="com.mzl.flower.dto.response.supplier.SupplierDTO"
|
parameterType="java.lang.Long">
|
SELECT
|
t.*,
|
s.name as stationName,
|
st.`name` as typeName
|
FROM
|
t_supplier_info t
|
LEFT JOIN t_station s ON t.station_id = s.id
|
LEFT JOIN t_supplier_type st ON t.type_id = st.id
|
WHERE t.id=#{id}
|
</select>
|
<select id="getCurrentSupplier" resultType="com.mzl.flower.dto.response.supplier.SupplierDTO"
|
parameterType="java.lang.String">
|
SELECT
|
t.*,
|
s.name as stationName,
|
st.`name` as typeName
|
FROM
|
t_supplier_info t
|
LEFT JOIN t_station s ON t.station_id = s.id
|
LEFT JOIN t_supplier_type st ON t.type_id = st.id
|
WHERE t.user_Id=#{userId}
|
</select>
|
</mapper>
|