You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.4 KiB
XML
33 lines
1.4 KiB
XML
6 years ago
|
<?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.kiisoo.ic.customer.mapper.OpSellerCustomerRelationDOMapper">
|
||
|
<select id="selectShopListByDate" resultType="com.kiisoo.ic.customer.bean.FriendDTO">
|
||
|
select t2.name as customerName,t2.id as customerId,t2.phone as mobile,t5.name as inviteSellerName,t4.id as inviteSellerId,t1.create_time as addTime
|
||
|
from op_seller_customer_relation t1,op_customer t2,poi_store_staff t4,privilage_user t5
|
||
|
where t1.customer_id = t2.id
|
||
|
and t1.user_id = t5.userId
|
||
|
and t1.user_id = t4.user_id
|
||
|
and t1.store_id = t4.store_id
|
||
|
<if test="userId != null">
|
||
|
t1.user_id = #{userId}
|
||
|
</if>
|
||
|
<if test="shopId != null">
|
||
|
t1.store_id = #{shopId}
|
||
|
</if>
|
||
|
<if test="sellerId != null">
|
||
|
t4.id = #{sellerId}
|
||
|
</if>
|
||
|
<if test="search != null and search !=''">
|
||
|
and
|
||
|
CONCAT(IFNULL(t2.name,''),IFNULL(t2.phone,''))
|
||
|
LIKE CONCAT('%',#{search},'%')
|
||
|
</if>
|
||
|
<if test="startDate != null">
|
||
|
DATE_FORMAT(t1.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{startDate},'%Y-%m-%d')
|
||
|
</if>
|
||
|
<if test="endDate != null">
|
||
|
DATE_FORMAT(t1.create_time,'%Y-%m-%d') <= DATE_FORMAT(#{endDate},'%Y-%m-%d')
|
||
|
</if>
|
||
|
</select>
|
||
|
</mapper>
|