|
|
@ -6,7 +6,7 @@
|
|
|
|
SELECT t2.id,t2.`name`,
|
|
|
|
SELECT t2.id,t2.`name`,
|
|
|
|
t2.member_id as idCard,t0.name as shopName,t0.code as shopCode,
|
|
|
|
t2.member_id as idCard,t0.name as shopName,t0.code as shopCode,
|
|
|
|
t4.name as sellerName, t3.birthday, t2.phone,
|
|
|
|
t4.name as sellerName, t3.birthday, t2.phone,
|
|
|
|
t3.name as vipName,t3.phone as vipPhone, t5.staff_code as sellerCode, t1.create_time as createTime
|
|
|
|
t3.name as vipName,t3.phone as vipPhone, t5.staff_code as sellerCode, t2.create_time as createTime
|
|
|
|
from op_seller_customer_relation t1
|
|
|
|
from op_seller_customer_relation t1
|
|
|
|
left join poi_store t0 on t0.id = t1.store_id
|
|
|
|
left join poi_store t0 on t0.id = t1.store_id
|
|
|
|
left join poi_store_staff t5 ON t5.store_id = t0.id and t1.user_id = t5.id
|
|
|
|
left join poi_store_staff t5 ON t5.store_id = t0.id and t1.user_id = t5.id
|
|
|
@ -25,18 +25,18 @@
|
|
|
|
</otherwise>
|
|
|
|
</otherwise>
|
|
|
|
</choose>
|
|
|
|
</choose>
|
|
|
|
<if test="startDate != null">
|
|
|
|
<if test="startDate != null">
|
|
|
|
and t1.create_time >= #{startDate}
|
|
|
|
and t2.create_time >= #{startDate}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="endDate != null">
|
|
|
|
<if test="endDate != null">
|
|
|
|
and t1.create_time <![CDATA[ < ]]> #{endDate}
|
|
|
|
and t2.create_time <![CDATA[ < ]]> #{endDate}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
order by t1.create_time desc,t2.id desc,t1.user_id desc
|
|
|
|
order by t2.create_time desc,t2.id desc,t1.user_id desc
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<select id="selectCustomerInfoBySellerId" resultType="com.kiisoo.ic.customer.bean.OpCustomerDTO">
|
|
|
|
<select id="selectCustomerInfoBySellerId" resultType="com.kiisoo.ic.customer.bean.OpCustomerDTO">
|
|
|
|
SELECT t2.id,t2.`name`,
|
|
|
|
SELECT t2.id,t2.`name`,
|
|
|
|
t2.member_id as idCard,t0.name as shopName,t0.code as shopCode,
|
|
|
|
t2.member_id as idCard,t0.name as shopName,t0.code as shopCode,
|
|
|
|
t4.name as sellerName, t3.birthday, t2.phone,
|
|
|
|
t4.name as sellerName, t3.birthday, t2.phone,
|
|
|
|
t3.name as vipName,t3.phone as vipPhone, t5.staff_code as sellerCode, t1.create_time as createTime
|
|
|
|
t3.name as vipName,t3.phone as vipPhone, t5.staff_code as sellerCode, t2.create_time as createTime
|
|
|
|
from op_seller_customer_relation t1
|
|
|
|
from op_seller_customer_relation t1
|
|
|
|
left join poi_store t0 on t0.id = t1.store_id
|
|
|
|
left join poi_store t0 on t0.id = t1.store_id
|
|
|
|
left join poi_store_staff t5 ON t5.store_id = t0.id and t1.user_id = t5.id
|
|
|
|
left join poi_store_staff t5 ON t5.store_id = t0.id and t1.user_id = t5.id
|
|
|
@ -45,19 +45,19 @@
|
|
|
|
LEFT JOIN privilage_user t4 ON t4.id = t5.user_id where 1 =1
|
|
|
|
LEFT JOIN privilage_user t4 ON t4.id = t5.user_id where 1 =1
|
|
|
|
and t1.user_id = #{sellerId}
|
|
|
|
and t1.user_id = #{sellerId}
|
|
|
|
<if test="startDate != null">
|
|
|
|
<if test="startDate != null">
|
|
|
|
and t1.create_time >= #{startDate}
|
|
|
|
and t2.create_time >= #{startDate}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="endDate != null">
|
|
|
|
<if test="endDate != null">
|
|
|
|
and t1.create_time <![CDATA[ < ]]> #{endDate}
|
|
|
|
and t2.create_time <![CDATA[ < ]]> #{endDate}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
GROUP BY t2.id
|
|
|
|
GROUP BY t2.id
|
|
|
|
order by t1.create_time desc,t2.id desc
|
|
|
|
order by t2.create_time desc,t2.id desc
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<!--客户list-->
|
|
|
|
<!--客户list-->
|
|
|
|
<select id="selectCustomerList" resultType="com.kiisoo.ic.customer.entity.OpCustomer">
|
|
|
|
<select id="selectCustomerList" resultType="com.kiisoo.ic.customer.entity.OpCustomer">
|
|
|
|
select t1.id as id, t1.`name` as name, t1.member_id as memberId, t1.phone as phone,
|
|
|
|
select t1.id as id, t1.`name` as name, t1.member_id as memberId, t1.phone as phone,
|
|
|
|
t2.create_time as registerTime, t2.type as validType, t2.store_id as shopId
|
|
|
|
t1.create_time as registerTime, t2.type as validType, t2.store_id as shopId
|
|
|
|
from op_customer t1, op_seller_customer_relation t2
|
|
|
|
from op_customer t1, op_seller_customer_relation t2
|
|
|
|
where t1.id=t2.customer_id
|
|
|
|
where t1.id=t2.customer_id
|
|
|
|
<if test="memberId != null">
|
|
|
|
<if test="memberId != null">
|
|
|
@ -73,10 +73,10 @@
|
|
|
|
and t2.user_id=#{sellerId}
|
|
|
|
and t2.user_id=#{sellerId}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="startDate != null and startDate != ''">
|
|
|
|
<if test="startDate != null and startDate != ''">
|
|
|
|
and t2.create_time <![CDATA[ >= ]]> #{startDate}
|
|
|
|
and t1.create_time <![CDATA[ >= ]]> #{startDate}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="endDate != null and endDate != ''">
|
|
|
|
<if test="endDate != null and endDate != ''">
|
|
|
|
and t2.create_time <![CDATA[ <= ]]> #{endDate}
|
|
|
|
and t1.create_time <![CDATA[ <= ]]> #{endDate}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
@ -95,10 +95,10 @@
|
|
|
|
and t2.type = #{type}
|
|
|
|
and t2.type = #{type}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="startDate != null and startDate != ''">
|
|
|
|
<if test="startDate != null and startDate != ''">
|
|
|
|
and t2.create_time <![CDATA[ >= ]]> #{startDate}
|
|
|
|
and t1.create_time <![CDATA[ >= ]]> #{startDate}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="endDate != null and endDate != ''">
|
|
|
|
<if test="endDate != null and endDate != ''">
|
|
|
|
and t2.create_time <![CDATA[ <= ]]> #{endDate}
|
|
|
|
and t1.create_time <![CDATA[ <= ]]> #{endDate}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|