|
|
@ -46,22 +46,19 @@
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<select id="selectFriendListByShopId" resultType="com.kiisoo.ic.customer.bean.FriendDTO">
|
|
|
|
<select id="selectFriendListByShopId" resultType="com.kiisoo.ic.customer.bean.FriendDTO">
|
|
|
|
|
|
|
|
|
|
|
|
SELECT DISTINCT
|
|
|
|
SELECT
|
|
|
|
t2. NAME AS customerName ,
|
|
|
|
t2. NAME AS customerName ,
|
|
|
|
t2.id AS customerId ,
|
|
|
|
t2.id AS customerId ,
|
|
|
|
IFNULL(t3.phone , '') AS mobile ,
|
|
|
|
IFNULL(t3.phone , '') AS mobile ,
|
|
|
|
t1.user_id AS inviteSellerId ,
|
|
|
|
t1.user_id AS inviteSellerId ,
|
|
|
|
t2.create_time AS addTime ,
|
|
|
|
t2.create_time AS addTime ,
|
|
|
|
t2.avatar_url AS avatar ,
|
|
|
|
t2.avatar_url AS avatar ,
|
|
|
|
t3. LEVEL AS vipFlag,
|
|
|
|
t3. LEVEL AS vipFlag
|
|
|
|
t5.`name` as inviteSellerName
|
|
|
|
|
|
|
|
FROM
|
|
|
|
FROM
|
|
|
|
op_seller_customer_relation t1
|
|
|
|
op_seller_customer_relation t1
|
|
|
|
left join op_customer t2 on t1.customer_id = t2.id
|
|
|
|
join op_customer t2 on t1.customer_id = t2.id
|
|
|
|
LEFT JOIN op_vip t3 ON t2.member_id = t3.id
|
|
|
|
LEFT JOIN op_vip t3 ON t2.member_id = t3.id
|
|
|
|
AND t3. STATUS = 1
|
|
|
|
AND t3. STATUS = 1
|
|
|
|
left JOIN poi_store_staff t4 ON t4.store_id = t1.store_id and t4.id = t1.user_id
|
|
|
|
|
|
|
|
left JOIN privilage_user t5 ON t4.user_id = t5.id
|
|
|
|
|
|
|
|
WHERE
|
|
|
|
WHERE
|
|
|
|
1 = 1
|
|
|
|
1 = 1
|
|
|
|
<if test="type == 1">
|
|
|
|
<if test="type == 1">
|
|
|
@ -87,7 +84,6 @@
|
|
|
|
<if test="endDate != null">
|
|
|
|
<if test="endDate != null">
|
|
|
|
and date(t1.create_time) <= #{endDate}
|
|
|
|
and date(t1.create_time) <= #{endDate}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
group by t2.id
|
|
|
|
|
|
|
|
order by t1.create_time desc
|
|
|
|
order by t1.create_time desc
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<!--根据导购id查询导购名-->
|
|
|
|
<!--根据导购id查询导购名-->
|
|
|
@ -134,22 +130,19 @@
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectFriendListByShopIdAndDate" resultType="com.kiisoo.ic.customer.bean.FriendDTO">
|
|
|
|
<select id="selectFriendListByShopIdAndDate" resultType="com.kiisoo.ic.customer.bean.FriendDTO">
|
|
|
|
SELECT DISTINCT
|
|
|
|
SELECT
|
|
|
|
t2. NAME AS customerName ,
|
|
|
|
t2. NAME AS customerName ,
|
|
|
|
t2.id AS customerId ,
|
|
|
|
t2.id AS customerId ,
|
|
|
|
IFNULL(t3.phone , '') AS mobile ,
|
|
|
|
IFNULL(t3.phone , '') AS mobile ,
|
|
|
|
t1.user_id AS inviteSellerId ,
|
|
|
|
t1.user_id AS inviteSellerId ,
|
|
|
|
t2.create_time AS addTime ,
|
|
|
|
t2.create_time AS addTime ,
|
|
|
|
t2.avatar_url AS avatar ,
|
|
|
|
t2.avatar_url AS avatar ,
|
|
|
|
t3. LEVEL AS vipFlag,
|
|
|
|
t3. LEVEL AS vipFlag
|
|
|
|
t5.`name` as inviteSellerName
|
|
|
|
|
|
|
|
FROM
|
|
|
|
FROM
|
|
|
|
op_seller_customer_relation t1
|
|
|
|
op_seller_customer_relation t1
|
|
|
|
join op_customer t2 on t1.customer_id = t2.id
|
|
|
|
join op_customer t2 on t1.customer_id = t2.id
|
|
|
|
LEFT JOIN op_vip t3 ON t2.member_id = t3.id
|
|
|
|
LEFT JOIN op_vip t3 ON t2.member_id = t3.id
|
|
|
|
AND t3. STATUS = 1
|
|
|
|
AND t3. STATUS = 1
|
|
|
|
JOIN poi_store_staff t4 ON t4.store_id = t1.store_id and t4.id = t1.user_id
|
|
|
|
|
|
|
|
JOIN privilage_user t5 ON t4.user_id = t5.id
|
|
|
|
|
|
|
|
WHERE
|
|
|
|
WHERE
|
|
|
|
1 = 1
|
|
|
|
1 = 1
|
|
|
|
<if test="type == 1">
|
|
|
|
<if test="type == 1">
|
|
|
@ -169,7 +162,6 @@
|
|
|
|
(t2.name LIKE CONCAT('%',#{search},'%') OR t3.phone LIKE
|
|
|
|
(t2.name LIKE CONCAT('%',#{search},'%') OR t3.phone LIKE
|
|
|
|
CONCAT('%',#{search},'%'))
|
|
|
|
CONCAT('%',#{search},'%'))
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
group by t2.id,t1.user_id
|
|
|
|
|
|
|
|
order by t1.create_time desc
|
|
|
|
order by t1.create_time desc
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|