yumeng 2 年 前
コミット
1498320253

+ 26 - 6
ruixuan-live/src/main/resources/mapper/isc/SupplyChainMapper.xml

@@ -23,6 +23,7 @@
         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',
         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 'deliveryRadio'
         from kuaishou_supply_chain
@@ -73,6 +74,7 @@
         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',
         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 'deliveryRadio'
 
@@ -129,8 +131,10 @@
         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',
         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 'deliveryRadio'
+        then 1 else 0 end),4) as 'deliveryRadio',
+        item_commission_rate as 'itemCommissionRate'
         from kuaishou_supply_chain
         where 1= 1
         <if test="start != null and start != ''">
@@ -180,6 +184,7 @@
         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',
         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 'deliveryRadio'
         from kuaishou_supply_chain
@@ -213,12 +218,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 = 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
         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',
         sum(case when order_status != 80 then pay_amount else 0 end) as 'payAmount',
-        sum(case when order_status != 80 then regimental_promotion_amount else 0 end) as 'regimentalPromotionAmount'
+        sum(case when order_status != 80 then regimental_promotion_amount else 0 end) as 'regimentalPromotionAmount',
+        sum(case when order_status != 80 then total_regimental_settle_amount else 0 end) as 'totalRegimentalSettleAmount'
         from kuaishou_supply_chain
         where 1= 1
         <if test="start != null and start != ''">
@@ -280,7 +287,8 @@
         select
         sum(order_amount) as 'orderAmount',
         sum(base_amount) as 'baseAmount',
-        sum(regimental_promotion_amount) as 'regimentalPromotionAmount'
+        sum(case when order_status != 80 then regimental_promotion_amount else 0 end) as 'regimentalPromotionAmount',
+        sum(case when order_status != 80 then total_regimental_settle_amount else 0 end) as 'totalRegimentalSettleAmount'
         from kuaishou_supply_chain
         where 1= 1
         <if test="start != null and start != ''">
@@ -319,6 +327,7 @@
         select
         count(distinct promoter_id) as 'promoterNum',
         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',
         round(sum(case when send_status = 1 then 1 else 0 end) / sum(case when order_status != 80 then 1 else 0 end),4)
         as 'deliveryRadio'
         from kuaishou_supply_chain
@@ -342,6 +351,7 @@
         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 then 1 else 0 end) as 'deliveryNum',
+        sum(case when send_status = 0 and order_status != 80 then 1 else 0 end) as 'notDeliveryNum',
         round(sum(case when send_status = 1 then 1 else 0 end) / sum(case when order_status != 80 then 1 else 0 end),4)
         as 'deliveryRadio'
         from kuaishou_supply_chain
@@ -379,6 +389,7 @@
         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',
         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 'deliveryRadio'
         from kuaishou_supply_chain
@@ -458,6 +469,7 @@
         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) * 100,2) 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',
         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) * 100,2) as 'deliveryRadio'
         from kuaishou_supply_chain
@@ -498,6 +510,7 @@
         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) * 100,2) 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',
         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) * 100,2) as 'deliveryRadio'
         from kuaishou_supply_chain
@@ -537,6 +550,7 @@
         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) * 100,2) 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',
         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) * 100,2) as 'deliveryRadio'
         from kuaishou_supply_chain
@@ -573,7 +587,8 @@
         t2.user_id as 'userId',
         case when t2.user_id is null then 1 else 2 end as 'status',
         t2.user_name as 'userName',
-        t2.create_time as 'bindTime'
+        t2.create_time as 'bindTime',
+        t1.item_commission_rate as 'itemCommissionRate'
         from kuaishou_item_info t1
         left join kuaishou_item_bind_user t2 on t1.item_id = t2.item_id
         where 1 = 1
@@ -620,6 +635,7 @@
         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 = 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
         then 1
@@ -629,7 +645,8 @@
         sum(case when t2.order_status != 80 then t2.pay_amount else 0 end) as 'payAmount',
         sum(case
         when t2.order_status != 80 then t2.regimental_promotion_amount
-        else 0 end) as 'regimentalPromotionAmount'
+        else 0 end) as 'regimentalPromotionAmount',
+        sum(case when t2.order_status != 80 then t2.total_regimental_settle_amount else 0 end) as 'totalRegimentalSettleAmount'
         from kuaishou_item_bind_user t1
         left join kuaishou_supply_chain t2
         on t1.item_id = t2.item_id
@@ -682,6 +699,7 @@
         ELSE 0
         END
         ) AS 'deliveryNum',
+        sum(case when t2.send_status = 0 and t2.order_status != 80 then 1 else 0 end) as 'notDeliveryNum',
         round(
         sum(
         CASE
@@ -715,7 +733,9 @@
         WHEN t2.order_status != 80 THEN t2.regimental_promotion_amount
         ELSE 0
         END
-        ) AS 'regimentalPromotionAmount'
+        ) 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'
         FROM
         kuaishou_item_bind_user t1
         LEFT JOIN