|
@@ -212,18 +212,23 @@
|
|
|
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',
|
|
|
(case
|
|
|
- when t3.ccr_value = '-' or t3.ccr_value is null
|
|
|
+ when t3.ccr_value is null or t3.ccr_value = 0
|
|
|
+ then '0%'
|
|
|
+ else concat(round(t3.ccr_value / 100, 2), '%')
|
|
|
+ end
|
|
|
+ ) as 'ccrValue',
|
|
|
+ (case
|
|
|
+ when t3.ccr_value is null or t3.ccr_value = 0
|
|
|
then 0
|
|
|
- else replace( t3.ccr_value,'%','')
|
|
|
+ else round(t3.ccr_value / 100 , 2)
|
|
|
end
|
|
|
) as 'ccrInt',
|
|
|
- t4.shop_star as 'shopStar',
|
|
|
- t4.mall_logistics_score as 'mallLogisticsScore',
|
|
|
- t4.shop_score as 'shopScore',
|
|
|
- t4.mall_service_score as 'mallServiceScore',
|
|
|
- t4.mall_quality_score as 'mallQualityScore',
|
|
|
+ t3.shop_star as 'shopStar',
|
|
|
+ t3.mall_logistics_score as 'mallLogisticsScore',
|
|
|
+ t3.shop_score as 'shopScore',
|
|
|
+ t3.mall_service_score as 'mallServiceScore',
|
|
|
+ t3.mall_quality_score as 'mallQualityScore',
|
|
|
(
|
|
|
case when t5.is_presale = 1
|
|
|
then '否'
|
|
@@ -235,10 +240,8 @@
|
|
|
from kuaishou_supply_chain t1
|
|
|
left join kuaishou_item_bind_user t2
|
|
|
on t1.item_id = t2.item_id
|
|
|
- left join kuaishou_item_ccr_info t3
|
|
|
+ left join kuaishou_activity_open_item_list t3
|
|
|
on t1.item_id = t3.item_id
|
|
|
- left join kuaishou_activity_open_item_list t4
|
|
|
- on t1.item_id = t4.item_id
|
|
|
left join kuaishou_item_list t5
|
|
|
on t1.item_id = t5.item_id
|
|
|
left join (
|
|
@@ -299,14 +302,23 @@
|
|
|
t3.mall_quality_score as 'mallQualityScore'
|
|
|
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
|
|
|
+ when tt.ccr_value is null or tt.ccr_value = 0
|
|
|
+ then '0%'
|
|
|
+ else concat(round(tt.ccr_value / 100, 2), '%')
|
|
|
+ end
|
|
|
+ ) as 'ccrValue',
|
|
|
+ (case
|
|
|
+ when tt.ccr_value is null or tt.ccr_value = 0
|
|
|
then 0
|
|
|
- else replace(tt.ccr_value, '%', '')
|
|
|
+ else round(tt.ccr_value / 100 , 2)
|
|
|
end
|
|
|
- ) as 'ccrInt',
|
|
|
- tt.ccr_value as 'ccrValue'
|
|
|
- from kuaishou_item_list t left join kuaishou_item_ccr_info tt
|
|
|
+ ) as 'ccrInt'
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ from kuaishou_item_list t left join kuaishou_activity_open_item_list tt
|
|
|
on t.item_id = tt.item_id
|
|
|
where
|
|
|
t.create_time >= str_to_date(concat(#{bindStartDate},' 00:00:01'),'%Y-%m-%d
|
|
@@ -968,7 +980,13 @@
|
|
|
round(sum(case when t1.send_status = 1 and order_status != 80 then 1 else 0 end) / sum(case when t1.order_status
|
|
|
!= 80 then 1 else 0 end) * 100, 2) as 'deliveryRadio',
|
|
|
round(t1.item_commission_rate / 10,2) as 'itemCommissionRate',
|
|
|
- t3.ccr_value as 'ccrValue',
|
|
|
+ (case
|
|
|
+ when t4.ccr_value is null or t4.ccr_value = 0
|
|
|
+ then '0%'
|
|
|
+ else concat(round(t4.ccr_value / 100, 2), '%')
|
|
|
+ end
|
|
|
+ ) as 'ccrValue'
|
|
|
+ ,
|
|
|
t4.shop_star as 'shopStar',
|
|
|
t4.mall_logistics_score as 'mallLogisticsScore',
|
|
|
t4.shop_score as 'shopScore',
|
|
@@ -985,8 +1003,7 @@
|
|
|
from kuaishou_supply_chain t1
|
|
|
left join kuaishou_item_bind_user t2
|
|
|
on t1.item_id = t2.item_id
|
|
|
- left join kuaishou_item_ccr_info t3
|
|
|
- on t1.item_id = t3.item_id
|
|
|
+
|
|
|
left join kuaishou_activity_open_item_list t4
|
|
|
on t1.item_id = t4.item_id
|
|
|
left join kuaishou_item_list t5
|
|
@@ -1247,18 +1264,28 @@
|
|
|
sum(case when t2.order_status != 80 then t2.total_regimental_settle_amount else 0 end) as
|
|
|
'totalRegimentalSettleAmount',
|
|
|
t2.item_commission_rate as 'itemCommissionRate',
|
|
|
- t3.ccr_value as 'ccrValue',
|
|
|
+
|
|
|
+
|
|
|
+ (case
|
|
|
+ when t3.ccr_value is null or t3.ccr_value = 0
|
|
|
+ then '0%'
|
|
|
+ else concat(round(t3.ccr_value / 100, 2), '%')
|
|
|
+ end
|
|
|
+ ) as 'ccrValue',
|
|
|
(case
|
|
|
- when t3.ccr_value = '-' or t3.ccr_value is null
|
|
|
+ when t3.ccr_value is null or t3.ccr_value = 0
|
|
|
then 0
|
|
|
- else replace(t3.ccr_value,'%','')
|
|
|
+ else round(t3.ccr_value / 100 , 2)
|
|
|
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
|
|
|
+ left join kuaishou_activity_open_item_list t3 on t1.item_id = t3.item_id
|
|
|
WHERE
|
|
|
1 = 1
|
|
|
<if test="start != null and start != ''">
|
|
@@ -1517,12 +1544,17 @@
|
|
|
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',
|
|
|
- t3.ccr_value as 'ccrValue'
|
|
|
+ (case
|
|
|
+ when t3.ccr_value is null or t3.ccr_value = 0
|
|
|
+ then '0%'
|
|
|
+ else concat(round(t3.ccr_value / 100, 2), '%')
|
|
|
+ end
|
|
|
+ ) 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
|
|
|
+ left join kuaishou_activity_open_item_list t3 on t1.item_id = t3.item_id
|
|
|
WHERE
|
|
|
1 = 1
|
|
|
<if test="start != null and start != ''">
|
|
@@ -2836,7 +2868,12 @@
|
|
|
|
|
|
</select>
|
|
|
<select id="exportBindOrder" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
- select *,t3.ccr_value as 'ccrValue',
|
|
|
+ select *, (case
|
|
|
+ when t4.ccr_value is null or t4.ccr_value = 0
|
|
|
+ then '0%'
|
|
|
+ else concat(round(t4.ccr_value / 100, 2), '%')
|
|
|
+ end
|
|
|
+ ) as 'ccrValue',
|
|
|
t4.shop_star as 'shopStar',
|
|
|
t4.mall_logistics_score as 'mallLogisticsScore',
|
|
|
t4.shop_score as 'shopScore',
|
|
@@ -2873,8 +2910,6 @@
|
|
|
from kuaishou_supply_chain
|
|
|
where stat_date >= #{start}
|
|
|
group by item_id) t2 on t1.itemId = t2.itemId
|
|
|
- left join kuaishou_item_ccr_info t3
|
|
|
- on t1.itemId = t3.item_id
|
|
|
left join kuaishou_activity_open_item_list t4
|
|
|
on t1.itemId = t4.item_id
|
|
|
left join kuaishou_item_list t5
|
|
@@ -3614,11 +3649,16 @@
|
|
|
</select>
|
|
|
<select id="shopDetail" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
SELECT t1.*,
|
|
|
- t2.ccr_value as 'ccrValue',
|
|
|
(case
|
|
|
- when t2.ccr_value = '-' or t2.ccr_value is null
|
|
|
+ when t2.ccr_value is null or t2.ccr_value = 0
|
|
|
+ then '0%'
|
|
|
+ else concat(round(t2.ccr_value / 100, 2), '%')
|
|
|
+ end
|
|
|
+ ) as 'ccrValue',
|
|
|
+ (case
|
|
|
+ when t2.ccr_value is null or t2.ccr_value = 0
|
|
|
then 0
|
|
|
- else replace( t2.ccr_value,'%','')
|
|
|
+ else round(t2.ccr_value / 100 , 2)
|
|
|
end
|
|
|
) as 'ccrInt',
|
|
|
t3.userName
|
|
@@ -3674,7 +3714,7 @@
|
|
|
|
|
|
</if>
|
|
|
|
|
|
- group by item_id) t1 left join kuaishou_item_ccr_info t2
|
|
|
+ group by item_id) t1 left join kuaishou_activity_open_item_list t2
|
|
|
on t1.itemId = t2.item_id
|
|
|
LEFT JOIN (select item_id as 'itemId',user_name as 'userName' from kuaishou_item_list WHERE media_id = 2 group
|
|
|
by item_id) t3
|