|
|
|
@ -290,13 +290,14 @@
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectWxSumCusNumByConditionShopManager" resultType="java.lang.Integer">
|
|
|
|
|
SELECT count(customer_id) from op_seller_customer_relation
|
|
|
|
|
WHERE store_id = #{storeId}
|
|
|
|
|
SELECT count(customer_id) from op_seller_customer_relation t, op_customer t2
|
|
|
|
|
WHERE t.store_id = #{storeId}
|
|
|
|
|
and t.customer_id = t2.id
|
|
|
|
|
<if test="startDate != null">
|
|
|
|
|
and DATE_FORMAT(create_time,'%Y-%m-%d') >= DATE_FORMAT(#{startDate},'%Y-%m-%d')
|
|
|
|
|
and DATE_FORMAT(t2.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{startDate},'%Y-%m-%d')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="endDate != null">
|
|
|
|
|
and DATE_FORMAT(create_time,'%Y-%m-%d') <= DATE_FORMAT(#{endDate},'%Y-%m-%d')
|
|
|
|
|
and DATE_FORMAT(t2.create_time,'%Y-%m-%d') <= DATE_FORMAT(#{endDate},'%Y-%m-%d')
|
|
|
|
|
</if>
|
|
|
|
|
group by store_id
|
|
|
|
|
</select>
|
|
|
|
@ -366,12 +367,13 @@
|
|
|
|
|
t1.id AS storeId
|
|
|
|
|
FROM
|
|
|
|
|
poi_store t1
|
|
|
|
|
LEFT JOIN `op_seller_customer_relation` t2 ON t1.id = t2.store_id
|
|
|
|
|
JOIN `op_seller_customer_relation` t2 ON t1.id = t2.store_id
|
|
|
|
|
JOIN op_customer t3 on t2.customer_id = t3.id
|
|
|
|
|
<if test="startDate != null">
|
|
|
|
|
and DATE_FORMAT(t2.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{startDate},'%Y-%m-%d')
|
|
|
|
|
and DATE_FORMAT(t3.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{startDate},'%Y-%m-%d')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="endDate != null">
|
|
|
|
|
and DATE_FORMAT(t2.create_time,'%Y-%m-%d') <= DATE_FORMAT(#{endDate},'%Y-%m-%d')
|
|
|
|
|
and DATE_FORMAT(t3.create_time,'%Y-%m-%d') <= DATE_FORMAT(#{endDate},'%Y-%m-%d')
|
|
|
|
|
</if>
|
|
|
|
|
WHERE
|
|
|
|
|
t1.STATUS = 1
|
|
|
|
|