yumeng 2 年之前
父節點
當前提交
061a8d3ee0
共有 1 個文件被更改,包括 8 次插入4 次删除
  1. 8 4
      ruixuan-live/src/main/resources/mapper/isc/SupplyChainMapper.xml

+ 8 - 4
ruixuan-live/src/main/resources/mapper/isc/SupplyChainMapper.xml

@@ -230,7 +230,8 @@
     <select id="getOrderTotal" resultType="com.alibaba.fastjson.JSONObject">
         select
         count(oid) as 'orderNum',
-        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 'validOrderNUm',
+        sum(case when order_status = 80 then 1 else 0 end) as 'invalidOrderNUm'
         from kuaishou_supply_chain
         where 1= 1
         <if test="start != null and start != ''">
@@ -269,7 +270,8 @@
     <select id="getAmountTotal" resultType="com.alibaba.fastjson.JSONObject">
         select
         sum(order_amount) as 'orderAmount',
-        sum(base_amount) as 'baseAmount'
+        sum(base_amount) as 'baseAmount',
+        sum(regimental_promotion_amount) as 'regimentalPromotionAmount'
         from kuaishou_supply_chain
         where 1= 1
         <if test="start != null and start != ''">
@@ -306,8 +308,10 @@
     </select>
     <select id="getServiceAmountTotal" resultType="com.alibaba.fastjson.JSONObject">
         select
-        sum(regimental_promotion_amount) as 'regimentalPromotionAmount',
-        count(distinct promoter_id) as 'promoterNum'
+        count(distinct promoter_id) as 'promoterNum',
+        sum(case when send_status = 1 and order_status != 80 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),4)
+        as 'deliveryRadio'
         from kuaishou_supply_chain
         where 1= 1
         <if test="start != null and start != ''">