|
|
@@ -325,7 +325,8 @@
|
|
|
count(if(status != 'refund' and o.goods_id = 15,1,NULL)) as numOfEpOrder,
|
|
|
(sum(if(o.goods_id = 15,money,0)) - sum(ifnull(if(o.goods_id = 15,refund_money,0), 0))) / 100 as epOrderMoney
|
|
|
from (select cu.user_id
|
|
|
- from (select relation_id
|
|
|
+ from (select relation_id,
|
|
|
+ ct.created_time
|
|
|
from `corp_user_tag` ct
|
|
|
where tag_id = #{tagIdStr}
|
|
|
<if test="startTime != null">
|
|
|
@@ -341,15 +342,20 @@
|
|
|
and o.status not in ('close', 'noPayment')
|
|
|
and o.money > 0
|
|
|
and o.money > ifnull(o.refund_money,0)
|
|
|
- <if test="startTime != null">
|
|
|
- and o.created_time >= #{startTime}
|
|
|
+ <if test="consumeStTime != null">
|
|
|
+ and o.created_time >= #{consumeStTime}
|
|
|
+ </if>
|
|
|
+ <if test="consumeEtTime != null">
|
|
|
+ and o.created_time < #{consumeEtTime}
|
|
|
</if>
|
|
|
+ and o.created_time > ct.created_time
|
|
|
</select>
|
|
|
|
|
|
<select id="getTagUserDataPage" resultType="com.cyksj.model.views.UserOrderDetailView">
|
|
|
select count(if(status != 'refund', 1, NULL)) as numOfOrder, (sum(money) - sum(ifnull(refund_money, 0))) / 100
|
|
|
as orderMoney,date_format(o.created_time,'%Y-%m-%d') as date from (select cu.user_id
|
|
|
- from (select relation_id
|
|
|
+ from (select relation_id,
|
|
|
+ ct.created_time
|
|
|
from `corp_user_tag` ct
|
|
|
where tag_id = #{tagIdStr}
|
|
|
<if test="startTime != null">
|
|
|
@@ -365,8 +371,12 @@
|
|
|
and o.status not in ('close', 'noPayment')
|
|
|
and o.money > 0
|
|
|
and o.money > ifnull(o.refund_money,0)
|
|
|
- <if test="startTime != null">
|
|
|
- and o.created_time >= #{startTime}
|
|
|
+ and o.created_time > ct.created_time
|
|
|
+ <if test="consumeStTime != null">
|
|
|
+ and o.created_time >= #{consumeStTime}
|
|
|
+ </if>
|
|
|
+ <if test="consumeEtTime != null">
|
|
|
+ and o.created_time < #{consumeEtTime}
|
|
|
</if>
|
|
|
group by date_format(o.created_time,'%Y-%m-%d')
|
|
|
order by date_format(o.created_time,'%Y-%m-%d') desc
|