|
@@ -188,7 +188,13 @@
|
|
|
round(sum(case when t1.send_status = 1 and t1.order_status != 80 then 1 else 0 end) / sum(case when
|
|
|
send_status = 1 then 1 else 0 end), 4) as 'deliveryRadio',
|
|
|
t1.item_commission_rate as 'itemCommissionRate',
|
|
|
- t3.ccr_value as 'ccrValue'
|
|
|
+ t3.ccr_value as 'ccrValue',
|
|
|
+ (case
|
|
|
+ when t3.ccr_value = '-'
|
|
|
+ then 0
|
|
|
+ else replace( t3.ccr_value,'%','')
|
|
|
+ end
|
|
|
+ ) as 'ccrInt'
|
|
|
from kuaishou_supply_chain t1
|
|
|
left join kuaishou_item_bind_user t2
|
|
|
on t1.item_id = t2.item_id
|
|
@@ -217,14 +223,24 @@
|
|
|
|
|
|
|
|
|
<select id="itemBindList" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
- select *,t3.ccr_value as 'ccrValue'
|
|
|
- from (select item_id as 'itemId', item_title as 'itemTitle', user_id as 'userId', user_name as 'userName'
|
|
|
- from kuaishou_item_list
|
|
|
+ select t1.*,t2.*
|
|
|
+
|
|
|
+ from (select t.item_id as 'itemId', t.item_title as 'itemTitle', t.user_id as 'userId', t.user_name as
|
|
|
+ 'userName',
|
|
|
+ (case
|
|
|
+ when tt.ccr_value = '-' or tt.ccr_value is null
|
|
|
+ then 0
|
|
|
+ else replace(tt.ccr_value, '%', '')
|
|
|
+ end
|
|
|
+ ) as 'ccrInt',
|
|
|
+ tt.ccr_value as 'ccrValue'
|
|
|
+ from kuaishou_item_list t left join kuaishou_item_ccr_info tt
|
|
|
+ on t.item_id = tt.item_id
|
|
|
where
|
|
|
- create_time >= str_to_date(concat(#{bindStartDate},' 00:00:01'),'%Y-%m-%d
|
|
|
+ t.create_time >= str_to_date(concat(#{bindStartDate},' 00:00:01'),'%Y-%m-%d
|
|
|
%H:%i:%s')
|
|
|
and
|
|
|
- create_time <= str_to_date(concat(#{bindEndDate},' 23:59:59'),'%Y-%m-%d
|
|
|
+ t.create_time <= str_to_date(concat(#{bindEndDate},' 23:59:59'),'%Y-%m-%d
|
|
|
%H:%i:%s')
|
|
|
) t1
|
|
|
left join
|
|
@@ -248,10 +264,10 @@
|
|
|
else 0 end),
|
|
|
4) as 'deliveryRadio',
|
|
|
item_commission_rate as 'itemCommissionRate'
|
|
|
- from kuaishou_supply_chain t1
|
|
|
+ from kuaishou_supply_chain
|
|
|
where order_create_time >= #{start}
|
|
|
group by item_id) t2 on t1.itemId = t2.itemId
|
|
|
- left join kuaishou_item_ccr_info t3 on t1.itemId = t3.item_id
|
|
|
+
|
|
|
where 1 = 1
|
|
|
<if test="itemId != null and itemId != ''">
|
|
|
and t1.itemId = #{itemId}
|
|
@@ -1064,11 +1080,19 @@
|
|
|
) AS 'regimentalPromotionAmount',
|
|
|
sum(case when t2.order_status != 80 then t2.total_regimental_settle_amount else 0 end) as
|
|
|
'totalRegimentalSettleAmount',
|
|
|
- t2.item_commission_rate as 'itemCommissionRate'
|
|
|
+ t2.item_commission_rate as 'itemCommissionRate',
|
|
|
+ t3.ccr_value as 'ccrValue',
|
|
|
+ (case
|
|
|
+ when t3.ccr_value = '-'
|
|
|
+ then 0
|
|
|
+ else replace(t3.ccr_value,'%','')
|
|
|
+ end
|
|
|
+ ) as 'ccrInt'
|
|
|
FROM
|
|
|
kuaishou_item_bind_user t1
|
|
|
LEFT JOIN
|
|
|
kuaishou_supply_chain t2 ON t1.item_id = t2.item_id
|
|
|
+ left join kuaishou_item_ccr_info t3 on t1.item_id = t3.item_id
|
|
|
WHERE
|
|
|
1 = 1
|
|
|
<if test="start != null and start != ''">
|
|
@@ -1326,11 +1350,13 @@
|
|
|
round(
|
|
|
sum(case when t2.order_status != 80 then t2.total_regimental_settle_amount else 0 end) / 100,2) as
|
|
|
'totalRegimentalSettleAmount',
|
|
|
- concat(round(t2.item_commission_rate / 10),'%') as 'itemCommissionRate'
|
|
|
+ concat(round(t2.item_commission_rate / 10),'%') as 'itemCommissionRate',
|
|
|
+ t3.ccr_value as 'ccrValue'
|
|
|
FROM
|
|
|
kuaishou_item_bind_user t1
|
|
|
LEFT JOIN
|
|
|
kuaishou_supply_chain t2 ON t1.item_id = t2.item_id
|
|
|
+ left join kuaishou_item_ccr_info t3 on t1.item_id = t3.item_id
|
|
|
WHERE
|
|
|
1 = 1
|
|
|
<if test="start != null and start != ''">
|