|
|
@ -220,34 +220,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectCustomersByCpUserId" resultType="java.util.Map">
|
|
|
|
<select id="selectCustomersByCpUserId" resultType="java.util.Map">
|
|
|
|
SELECT
|
|
|
|
SELECT
|
|
|
|
t2.staff_code as cpUserId,
|
|
|
|
t3.cp_user_id as cpUserId,
|
|
|
|
count(1) as sumCustomer
|
|
|
|
count(1) as sumCustomer
|
|
|
|
FROM
|
|
|
|
FROM
|
|
|
|
op_seller_customer_relation t ,
|
|
|
|
op_seller_customer_relation t ,
|
|
|
|
poi_store_staff t2,
|
|
|
|
privilage_cp_user t3,
|
|
|
|
privilage_cp_user t3
|
|
|
|
privilage_cp_user_store t4
|
|
|
|
WHERE
|
|
|
|
WHERE
|
|
|
|
t2.store_id = t.store_id
|
|
|
|
t4.store_id = t.store_id
|
|
|
|
AND t2.id = t.user_id
|
|
|
|
AND t3.id = t4.cp_user_id
|
|
|
|
AND t3.cp_user_id = t2.staff_code
|
|
|
|
|
|
|
|
GROUP BY
|
|
|
|
GROUP BY
|
|
|
|
t2.store_id
|
|
|
|
t.store_id
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectCustomersByCpUserIdByList" resultType="java.util.Map">
|
|
|
|
<select id="selectCustomersByCpUserIdByList" resultType="java.util.Map">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SELECT
|
|
|
|
SELECT
|
|
|
|
t2.staff_code as cpUserId,
|
|
|
|
t3.cp_user_id as cpUserId,
|
|
|
|
count(1) as sumCustomer
|
|
|
|
count(1) as sumCustomer
|
|
|
|
FROM
|
|
|
|
FROM
|
|
|
|
op_seller_customer_relation t ,
|
|
|
|
op_seller_customer_relation t ,
|
|
|
|
poi_store_staff t2,
|
|
|
|
privilage_cp_user t3,
|
|
|
|
privilage_cp_user t3
|
|
|
|
privilage_cp_user_store t4
|
|
|
|
WHERE
|
|
|
|
WHERE
|
|
|
|
t2.store_id = t.store_id
|
|
|
|
t4.store_id = t.store_id
|
|
|
|
AND t2.id = t.user_id
|
|
|
|
and t3.id = t4.cp_user_id
|
|
|
|
AND t3.cp_user_id = t2.staff_code
|
|
|
|
and t3.cp_user_id in
|
|
|
|
AND t3.cp_user_id in
|
|
|
|
|
|
|
|
<foreach collection="cpUserIds" separator="," item="item" close=")" index="index" open="(">
|
|
|
|
<foreach collection="cpUserIds" separator="," item="item" close=")" index="index" open="(">
|
|
|
|
#{item}
|
|
|
|
#{item}
|
|
|
|
</foreach>
|
|
|
|
</foreach>
|
|
|
|