|
@@ -661,7 +661,8 @@
|
|
t1.validOrderNUm - t2.lastValidOrderNUm as 'validOrderNumGap',
|
|
t1.validOrderNUm - t2.lastValidOrderNUm as 'validOrderNumGap',
|
|
t1.mcnPromotionAmount - t2.lastMcnPromotionAmount as 'mcnPromotionAmountGap',
|
|
t1.mcnPromotionAmount - t2.lastMcnPromotionAmount as 'mcnPromotionAmountGap',
|
|
t1.grossMargin - t2.lastGrossMargin as 'grossMarginGap'
|
|
t1.grossMargin - t2.lastGrossMargin as 'grossMarginGap'
|
|
- from (select date_format(#{date},'%Y/%m/%d') as 'date',
|
|
|
|
|
|
+ from (select
|
|
|
|
+ concat(concat(concat( date_format(#{startDate},'%m%d'),'~')), date_format(#{endDate},'%m%d') ) as 'date',
|
|
round(sum(pay_amount) / 100, 2) as 'gmv',
|
|
round(sum(pay_amount) / 100, 2) as 'gmv',
|
|
count(oid) as 'orderNum',
|
|
count(oid) as 'orderNum',
|
|
round(sum(case when order_status != 80 then pay_amount else 0 end) / 100, 2) as 'validGmv',
|
|
round(sum(case when order_status != 80 then pay_amount else 0 end) / 100, 2) as 'validGmv',
|
|
@@ -669,7 +670,9 @@
|
|
round(sum(mcn_promotion_amount) / 100, 2) as 'mcnPromotionAmount',
|
|
round(sum(mcn_promotion_amount) / 100, 2) as 'mcnPromotionAmount',
|
|
round(sum(mcn_promotion_amount) / sum(pay_amount) * 100, 2) as 'grossMargin'
|
|
round(sum(mcn_promotion_amount) / sum(pay_amount) * 100, 2) as 'grossMargin'
|
|
from jy_order_list t1
|
|
from jy_order_list t1
|
|
- where t1.stat_date = #{date}
|
|
|
|
|
|
+ where 1 = 1
|
|
|
|
+ and t1.stat_date >= #{startDate}
|
|
|
|
+ and t1.stat_date <= #{endDate}
|
|
<if test='dataType == "1" '>
|
|
<if test='dataType == "1" '>
|
|
and t1.clip_user_id in (
|
|
and t1.clip_user_id in (
|
|
select promoter_id from jy_kuaishou_promoter
|
|
select promoter_id from jy_kuaishou_promoter
|
|
@@ -685,7 +688,11 @@
|
|
)
|
|
)
|
|
</if>
|
|
</if>
|
|
) t1
|
|
) t1
|
|
- join (select date_format(#{lastDate} ,'%Y/%m/%d') as 'lastDate',
|
|
|
|
|
|
+ join
|
|
|
|
+ (
|
|
|
|
+ select
|
|
|
|
+ concat(concat(concat( date_format(#{lastStart},'%m%d'),'~')), date_format(#{lastEnd},'%m%d') ) as
|
|
|
|
+ 'lastDate',
|
|
round(sum(pay_amount) / 100, 2) as 'lastGmv',
|
|
round(sum(pay_amount) / 100, 2) as 'lastGmv',
|
|
count(oid) as 'lastOrderNum',
|
|
count(oid) as 'lastOrderNum',
|
|
round(sum(case when order_status != 80 then pay_amount else 0 end) / 100, 2) as 'lastValidGmv',
|
|
round(sum(case when order_status != 80 then pay_amount else 0 end) / 100, 2) as 'lastValidGmv',
|
|
@@ -693,7 +700,9 @@
|
|
round(sum(mcn_promotion_amount) / 100, 2) as 'lastMcnPromotionAmount',
|
|
round(sum(mcn_promotion_amount) / 100, 2) as 'lastMcnPromotionAmount',
|
|
round(sum(mcn_promotion_amount) / sum(pay_amount) * 100, 2) as 'lastGrossMargin'
|
|
round(sum(mcn_promotion_amount) / sum(pay_amount) * 100, 2) as 'lastGrossMargin'
|
|
from jy_order_list t1
|
|
from jy_order_list t1
|
|
- where t1.stat_date = #{lastDate}
|
|
|
|
|
|
+ where 1 = 1
|
|
|
|
+ and t1.stat_date >= #{lastStart}
|
|
|
|
+ and t1.stat_date <= #{lastEnd}
|
|
<if test='dataType == "1"'>
|
|
<if test='dataType == "1"'>
|
|
and t1.clip_user_id in (
|
|
and t1.clip_user_id in (
|
|
select promoter_id from jy_kuaishou_promoter
|
|
select promoter_id from jy_kuaishou_promoter
|