|
@@ -25,9 +25,12 @@
|
|
|
round(sum(case when order_status != 80 then 1 else 0 end) / count(oid),4) as 'validRadio',
|
|
|
sum(pay_amount) as 'payAmount',
|
|
|
sum(case when order_status != 80 then pay_amount else 0 end) as 'validPayAmount',
|
|
|
- sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) as 'deliveryNum',
|
|
|
- sum(case when send_status = 0 and order_status != 80 then 1 else 0 end) as 'notDeliveryNum',
|
|
|
+ sum(case when send_status = 1 then 1 else 0 end) as 'deliveryNum',
|
|
|
round(sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) / sum(case when order_status != 80
|
|
|
+ then 1 else 0 end),4) as 'shippingGreen',
|
|
|
+ sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) as 'effDeliveryNum',
|
|
|
+ sum(case when send_status = 0 and order_status != 80 then 1 else 0 end) as 'notDeliveryNum',
|
|
|
+ round(sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) / sum(case when send_status = 1
|
|
|
then 1 else 0 end),4) as 'deliveryRadio',
|
|
|
sum(case when order_status != 80 then regimental_promotion_amount else 0 end) as 'regimentalPromotionAmount'
|
|
|
from kuaishou_supply_chain
|
|
@@ -88,9 +91,12 @@
|
|
|
round(sum(case when order_status != 80 then 1 else 0 end) / count(oid),4) as 'validRadio',
|
|
|
sum(case when order_status != 80 then pay_amount else 0 end) as 'payAmount',
|
|
|
regimental_promotion_rate as 'regimentalPromotionRate',
|
|
|
- sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) as 'deliveryNum',
|
|
|
- sum(case when send_status = 0 and order_status != 80 then 1 else 0 end) as 'notDeliveryNum',
|
|
|
+ sum(case when send_status = 1 then 1 else 0 end) as 'deliveryNum',
|
|
|
round(sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) / sum(case when order_status != 80
|
|
|
+ then 1 else 0 end),4) as 'shippingGreen',
|
|
|
+ sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) as 'effDeliveryNum',
|
|
|
+ sum(case when send_status = 0 and order_status != 80 then 1 else 0 end) as 'notDeliveryNum',
|
|
|
+ round(sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) / sum(case when send_status = 1
|
|
|
then 1 else 0 end),4) as 'deliveryRadio'
|
|
|
from kuaishou_supply_chain
|
|
|
where 1= 1
|
|
@@ -149,10 +155,13 @@
|
|
|
count(t1.oid) as 'orderNum',
|
|
|
sum(case when t1.order_status != 80 then 1 else 0 end) as 'validOrderNUm',
|
|
|
round(sum(case when t1.order_status != 80 then 1 else 0 end) / count(t1.oid), 4) as 'validRadio',
|
|
|
- sum(case when t1.send_status = 1 and t1.order_status != 80 then 1 else 0 end) as 'deliveryNum',
|
|
|
+ sum(case when t1.send_status = 1 then 1 else 0 end) as 'deliveryNum',
|
|
|
+ round(sum(case when t1.send_status = 1 and t1.order_status != 80 then 1 else 0 end) / sum(case when t1.order_status != 80
|
|
|
+ then 1 else 0 end),4) as 'shippingGreen',
|
|
|
+ sum(case when t1.send_status = 1 and t1.order_status != 80 then 1 else 0 end) as 'effDeliveryNum',
|
|
|
sum(case when t1.send_status = 0 and t1.order_status != 80 then 1 else 0 end) as 'notDeliveryNum',
|
|
|
round(sum(case when t1.send_status = 1 and t1.order_status != 80 then 1 else 0 end) / sum(case when
|
|
|
- t1.order_status != 80 then 1 else 0 end), 4) as 'deliveryRadio',
|
|
|
+ send_status = 1 then 1 else 0 end), 4) as 'deliveryRadio',
|
|
|
t1.item_commission_rate as 'itemCommissionRate'
|
|
|
from kuaishou_supply_chain t1
|
|
|
left join kuaishou_item_bind_user t2
|
|
@@ -199,11 +208,14 @@
|
|
|
sum(case when order_status != 80 then 1 else 0 end) as 'validOrderNUm',
|
|
|
round(sum(case when order_status != 80 then 1 else 0 end) / count(oid),
|
|
|
4) as 'validRadio',
|
|
|
- sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) as 'deliveryNum',
|
|
|
+ sum(case when send_status = 1 then 1 else 0 end) as 'deliveryNum',
|
|
|
+ round(sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) / sum(case when order_status != 80
|
|
|
+ then 1 else 0 end),4) as 'shippingGreen',
|
|
|
+ sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) as 'effDeliveryNum',
|
|
|
sum(case when send_status = 0 and order_status != 80 then 1 else 0 end) as 'notDeliveryNum',
|
|
|
round(sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) / sum(case
|
|
|
when
|
|
|
- order_status != 80
|
|
|
+ send_status = 1
|
|
|
then 1
|
|
|
else 0 end),
|
|
|
4) as 'deliveryRadio',
|
|
@@ -256,9 +268,12 @@
|
|
|
regimental_promotion_rate as 'regimentalPromotionRate',
|
|
|
sum(case when order_status != 80 then 1 else 0 end) as 'validOrderNUm',
|
|
|
round(sum(case when order_status != 80 then 1 else 0 end) / count(oid),4) as 'validRadio',
|
|
|
- sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) as 'deliveryNum',
|
|
|
- sum(case when send_status = 0 and order_status != 80 then 1 else 0 end) as 'notDeliveryNum',
|
|
|
+ sum(case when send_status = 1 then 1 else 0 end) as 'deliveryNum',
|
|
|
round(sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) / sum(case when order_status != 80
|
|
|
+ then 1 else 0 end),4) as 'shippingGreen',
|
|
|
+ sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) as 'effDeliveryNum',
|
|
|
+ sum(case when send_status = 0 and order_status != 80 then 1 else 0 end) as 'notDeliveryNum',
|
|
|
+ round(sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) / sum(case when send_status = 1
|
|
|
then 1 else 0 end),4) as 'deliveryRadio'
|
|
|
from kuaishou_supply_chain
|
|
|
where 1= 1
|
|
@@ -292,9 +307,12 @@
|
|
|
count(oid) as 'orderNum',
|
|
|
sum(case when order_status != 80 then 1 else 0 end) as 'validOrderNUm',
|
|
|
round(sum(case when order_status != 80 then 1 else 0 end) / count(oid),4) as 'validRadio',
|
|
|
- sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) as 'deliveryNum',
|
|
|
- sum(case when send_status = 0 and order_status != 80 then 1 else 0 end) as 'notDeliveryNum',
|
|
|
+ sum(case when send_status = 1 then 1 else 0 end) as 'deliveryNum',
|
|
|
round(sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) / sum(case when order_status != 80
|
|
|
+ then 1 else 0 end),4) as 'shippingGreen',
|
|
|
+ sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) as 'effDeliveryNum',
|
|
|
+ sum(case when send_status = 0 and order_status != 80 then 1 else 0 end) as 'notDeliveryNum',
|
|
|
+ round(sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) / sum(case when send_status = 1
|
|
|
then 1 else 0 end),4) as 'deliveryRadio',
|
|
|
sum(case when order_status = 80 then 1 else 0 end) as 'invalidOrderNUm',
|
|
|
regimental_promotion_rate as 'regimentalPromotionRate',
|
|
@@ -869,10 +887,13 @@
|
|
|
count(t2.oid) as 'orderNum',
|
|
|
sum(case when t2.order_status != 80 then 1 else 0 end) as 'validOrderNUm',
|
|
|
round(sum(case when t2.order_status != 80 then 1 else 0 end) / count(t2.oid),4) as 'validRadio',
|
|
|
- sum(case when t2.send_status = 1 and t2.order_status != 80 then 1 else 0 end) as 'deliveryNum',
|
|
|
+ sum(case when t2.send_status = 1 then 1 else 0 end) as 'deliveryNum',
|
|
|
+ round(sum(case when t2.send_status = 1 and t2.order_status != 80 then 1 else 0 end) / sum(case when t2.order_status != 80
|
|
|
+ then 1 else 0 end),4) as 'shippingGreen',
|
|
|
+ sum(case when t2.send_status = 1 and t2.order_status != 80 then 1 else 0 end) as 'effDeliveryNum',
|
|
|
sum(case when t2.send_status = 0 and t2.order_status != 80 then 1 else 0 end) as 'notDeliveryNum',
|
|
|
round(sum(case when t2.send_status = 1 and t2.order_status != 80 then 1 else 0 end) / sum(case
|
|
|
- when t2.order_status != 80
|
|
|
+ when send_status = 1
|
|
|
then 1
|
|
|
else 0 end),
|
|
|
4) as 'deliveryRadio',
|
|
@@ -937,10 +958,21 @@
|
|
|
sum(
|
|
|
CASE
|
|
|
WHEN t2.send_status = 1
|
|
|
- AND t2.order_status != 80 THEN 1
|
|
|
+ THEN 1
|
|
|
ELSE 0
|
|
|
END
|
|
|
) AS 'deliveryNum',
|
|
|
+
|
|
|
+ round(sum(case when t2.send_status = 1 and t2.order_status != 80 then 1 else 0 end) / sum(case when t2.order_status != 80
|
|
|
+ then 1 else 0 end),4) as 'shippingGreen',
|
|
|
+
|
|
|
+ sum(
|
|
|
+ CASE
|
|
|
+ WHEN t2.send_status = 1
|
|
|
+ AND t2.order_status != 80 THEN 1
|
|
|
+ ELSE 0
|
|
|
+ END
|
|
|
+ ) AS 'effDeliveryNum',
|
|
|
sum(case when t2.send_status = 0 and t2.order_status != 80 then 1 else 0 end) as 'notDeliveryNum',
|
|
|
round(
|
|
|
sum(
|
|
@@ -951,7 +983,7 @@
|
|
|
END
|
|
|
) / sum(
|
|
|
CASE
|
|
|
- WHEN t2.order_status != 80 THEN 1
|
|
|
+ WHEN t2.send_status = 1 THEN 1
|
|
|
ELSE 0
|
|
|
END
|
|
|
),
|
|
@@ -1099,10 +1131,21 @@
|
|
|
sum(
|
|
|
CASE
|
|
|
WHEN t2.send_status = 1
|
|
|
- AND t2.order_status != 80 THEN 1
|
|
|
+ THEN 1
|
|
|
ELSE 0
|
|
|
END
|
|
|
) AS 'deliveryNum',
|
|
|
+
|
|
|
+ round(sum(case when t2.send_status = 1 and t2.order_status != 80 then 1 else 0 end) / sum(case when t2.order_status != 80
|
|
|
+ then 1 else 0 end),4) as 'shippingGreen',
|
|
|
+
|
|
|
+ sum(
|
|
|
+ CASE
|
|
|
+ WHEN t2.send_status = 1
|
|
|
+ AND t2.order_status != 80 THEN 1
|
|
|
+ ELSE 0
|
|
|
+ END
|
|
|
+ ) AS 'effDeliveryNum',
|
|
|
sum(case when t2.send_status = 0 and t2.order_status != 80 then 1 else 0 end) as 'notDeliveryNum',
|
|
|
round(
|
|
|
sum(
|
|
@@ -1113,7 +1156,7 @@
|
|
|
END
|
|
|
) / sum(
|
|
|
CASE
|
|
|
- WHEN t2.order_status != 80 THEN 1
|
|
|
+ WHEN t2.send_status != 80 THEN 1
|
|
|
ELSE 0
|
|
|
END
|
|
|
),
|
|
@@ -2049,10 +2092,13 @@
|
|
|
count(t2.oid) as 'orderNum',
|
|
|
sum(case when t2.order_status != 80 then 1 else 0 end) as 'validOrderNUm',
|
|
|
round(sum(case when t2.order_status != 80 then 1 else 0 end) / count(t2.oid), 4) as 'validRadio',
|
|
|
- sum(case when t2.send_status = 1 and t2.order_status != 80 then 1 else 0 end) as 'deliveryNum',
|
|
|
+ sum(case when t2.send_status = 1 then 1 else 0 end) as 'deliveryNum',
|
|
|
+ round(sum(case when send_status = 1 and order_status != 80 then 1 else 0 end) / sum(case when order_status != 80
|
|
|
+ then 1 else 0 end),4) as 'shippingGreen',
|
|
|
+ sum(case when t2.send_status = 1 and t2.order_status != 80 then 1 else 0 end) as 'effDeliveryNum',
|
|
|
sum(case when t2.send_status = 0 and t2.order_status != 80 then 1 else 0 end) as 'notDeliveryNum',
|
|
|
round(sum(case when t2.send_status = 1 and t2.order_status != 80 then 1 else 0 end) / sum(case
|
|
|
- when t2.order_status != 80
|
|
|
+ when t2.send_status = 1
|
|
|
then 1
|
|
|
else 0 end),
|
|
|
4) as 'deliveryRadio',
|
|
@@ -2202,7 +2248,7 @@
|
|
|
from user_promoters_count
|
|
|
where media_id = 2) ttttt
|
|
|
on t.collectSampleId = ttttt.user_id
|
|
|
- where t.orderNum > 0
|
|
|
+ where t.orderNum > 0
|
|
|
order by t.orderNum desc
|
|
|
</select>
|
|
|
<select id="bdTotalV2" resultType="com.alibaba.fastjson.JSONObject">
|