yumeng 2 年 前
コミット
c687605902

+ 14 - 5
ruixuan-live/src/main/resources/mapper/isc/SupplyChainMapper.xml

@@ -33,7 +33,7 @@
         from
         (select item_id as 'itemId',
         item_title as 'itemTitle',
-        image_url  as 'imageUrl',
+        image_url as 'imageUrl',
         count(oid) as 'orderNum'
         from kuaishou_supply_chain
         where promoter_id = #{promoterId}
@@ -182,7 +182,7 @@
         sum(case when order_status != 80 then 1 else 0 end) as 'validOrderNUm',
         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 pay_amount else 0 end) as 'payAmount',
         sum(case when order_status != 80 then regimental_promotion_amount else 0 end) as 'regimentalPromotionAmount'
         from kuaishou_supply_chain
         where 1= 1
@@ -299,7 +299,12 @@
         item_id as 'itemId',
         item_title as 'itemTitle',
         image_url as 'imageUrl',
-        count(oid) as 'orderNum'
+        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),2) as 'validRadio',
+        sum(case when send_status = 1 then 1 else 0 end) as 'deliveryNum',
+        round(sum(case when send_status = 1 then 1 else 0 end) / sum(case when order_status != 80 then 1 else 0 end),2) as 'deliveryRadio'
+
         from kuaishou_supply_chain
         where 1= 1
         <if test="nowStartHourTemp != null and nowStartHourTemp != ''">
@@ -350,7 +355,9 @@
         from (select
         promoter_id as 'promoterId',
         promoter_nick_name as 'promoterNickName',
-        count(oid) as 'orderNum'
+        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),2) as 'validRadio'
         from kuaishou_supply_chain
         where 1= 1
         <if test="nowStartHourTemp != null and nowStartHourTemp != ''">
@@ -381,7 +388,9 @@
         select
         promoter_id as 'promoterId',
         promoter_nick_name as 'promoterNickName',
-        count(oid) as 'orderNum'
+        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),2) as 'validRadio'
         from kuaishou_supply_chain
         where 1= 1
         <if test="start != null and start != ''">