|
|
@@ -72,9 +72,10 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getMonthAiExNumOfUser" resultType="java.lang.Integer">
|
|
|
- select count(distinct user_id)
|
|
|
+ select count(distinct buyer_id)
|
|
|
from `order_don` od
|
|
|
- where status not in ('close','refund','noPayment')
|
|
|
+ where status not in ('close','noPayment')
|
|
|
+ and (refund_money is null or refund_money != money)
|
|
|
and created_time BETWEEN #{lastMonth} and #{thisMonth}
|
|
|
and sku_id in
|
|
|
<foreach collection="skuIds" item="item" open="(" separator="," close=")">
|
|
|
@@ -83,19 +84,21 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getMonthAiExNumOfUserByType" resultType="java.lang.Integer">
|
|
|
- select count(distinct user_id) from (select user_id
|
|
|
+ select count(distinct buyer_id) from (select buyer_id
|
|
|
from `order_don` od
|
|
|
- where status not in ('close','refund','noPayment')
|
|
|
+ where status not in ('close','noPayment')
|
|
|
+ and (refund_money is null or refund_money != money)
|
|
|
and created_time BETWEEN #{lastMonth} and #{thisMonth}
|
|
|
and sku_id in
|
|
|
<foreach collection="skuIds" item="item" open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>) s where EXISTS(select id
|
|
|
from order_don
|
|
|
- where status not in ('close','refund','noPayment')
|
|
|
+ where status not in ('close','noPayment')
|
|
|
+ and (refund_money is null or refund_money != money)
|
|
|
and created_time between #{thisMonth} and #{nextMonth}
|
|
|
and order_type = #{type}
|
|
|
- and user_id = s.user_id
|
|
|
+ and buyer_id = s.buyer_id
|
|
|
and sku_id in
|
|
|
<foreach collection="skuIds" item="item" open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
@@ -104,9 +107,10 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getMonthAiRenewNumOfUser" resultType="java.lang.Integer">
|
|
|
- select count(distinct user_id)
|
|
|
+ select count(distinct buyer_id)
|
|
|
from `order_don` od
|
|
|
- where status not in ('close','refund','noPayment')
|
|
|
+ where status not in ('close','noPayment')
|
|
|
+ and (refund_money is null or refund_money != money)
|
|
|
and created_time BETWEEN #{thisMonth} and #{nextMonth}
|
|
|
and order_type = 2
|
|
|
and sku_id in
|