Browse Source

首页调整

yumeng 1 year ago
parent
commit
a423330712

+ 22 - 5
ruixuan-live/src/main/resources/mapper/bytedance/BytedancePromoterOrderListMapper.xml

@@ -180,10 +180,19 @@
         CONCAT(round( sum( CASE WHEN flow_point != 'REFUND' THEN 1 ELSE 0 END ) / count( order_id )*100, 2 ),'%') AS
         'validRadio',
         sum( total_pay_amount )/100 AS 'payAmount',
-        sum( CASE WHEN flow_point != 'REFUND' THEN second_estimated_commission ELSE 0 END ) / 100 AS 'secondEstimatedCommission',
         sum( CASE WHEN flow_point != 'REFUND' THEN total_pay_amount ELSE 0 END )/100 AS 'validPayAmount',
-        sum( CASE WHEN flow_point != 'REFUND' THEN colonel_estimated_commission ELSE 0 END )* 0.9 /100 AS
+        sum(CASE
+        WHEN flow_point != 'REFUND' and colonel_type != 2
+        THEN colonel_estimated_commission
+        WHEN flow_point != 'REFUND' and colonel_type = 2
+        then second_estimated_commission
+        ELSE 0 END) * 0.9 / 100                                                                        AS
         'regimentalPromotionAmount',
+        sum(CASE
+        WHEN flow_point != 'REFUND' and colonel_type != 2
+        THEN second_estimated_commission
+        ELSE 0 END) / 100                                                                                                    AS 'secondEstimatedCommission',
+
         author_bind_user_id,
         IFNULL(author_bind_user_name,'-') AS 'userName'
         FROM
@@ -402,9 +411,17 @@
         CONCAT(round(sum(case when t1.flow_point != 'REFUND' then 1 else 0 end) / count(t1.order_id)*100, 2),'%') as
         'validRadio',
         CONCAT(Round(t1.commission_rate/100,2),'%') AS 'itemCommissionRate',
-        sum( CASE WHEN flow_point != 'REFUND' THEN second_estimated_commission ELSE 0 END ) / 100 AS 'secondEstimatedCommission',
-        sum( CASE WHEN flow_point != 'REFUND' THEN colonel_estimated_commission ELSE 0 END )* 0.9 /100 AS
-        'regimentalPromotionAmount'
+        sum(CASE
+        WHEN flow_point != 'REFUND' and colonel_type != 2
+        THEN colonel_estimated_commission
+        WHEN flow_point != 'REFUND' and colonel_type = 2
+        then second_estimated_commission
+        ELSE 0 END) * 0.9 / 100 AS
+        'regimentalPromotionAmount',
+        sum(CASE
+        WHEN flow_point != 'REFUND' and colonel_type != 2 THEN second_estimated_commission
+        ELSE 0 END) /
+        100 AS 'secondEstimatedCommission'
         FROM bytedance_promoter_order_list t1
         WHERE 1 = 1
         <if test="start != null and start != ''">

+ 12 - 3
ruixuan-live/src/main/resources/mapper/isc/SupplyChainMapper.xml

@@ -1356,10 +1356,19 @@
         COUNT(order_id) as 'allNumber',
         IFNULL(SUM(CASE WHEN flow_point != 'REFUND' THEN 1 ELSE 0 END), 0) AS 'validOrderNUm',
         IFNULL(SUM(total_pay_amount), 0) AS 'orderAmount',
-        IFNULL(SUM(CASE WHEN flow_point != 'REFUND' THEN second_estimated_commission ELSE 0 END), 0)  AS 'secondEstimatedCommission',
         IFNULL(SUM(CASE WHEN flow_point != 'REFUND' THEN total_pay_amount ELSE 0 END), 0) AS 'baseAmount',
-        IFNULL(SUM(CASE WHEN flow_point != 'REFUND' THEN colonel_estimated_commission ELSE 0 END) * 0.9,0) AS
-        'regimentalPromotionAmount'
+        sum(CASE
+        WHEN flow_point != 'REFUND' and colonel_type != 2
+        THEN colonel_estimated_commission
+        WHEN flow_point != 'REFUND' and colonel_type = 2
+        then second_estimated_commission
+        ELSE 0 END) * 0.9 / 100 AS
+        'regimentalPromotionAmount',
+        sum(CASE
+        WHEN flow_point != 'REFUND' and colonel_type != 2
+        THEN second_estimated_commission
+        ELSE 0 END) /
+        100 AS 'secondEstimatedCommission'
         FROM bytedance_order_list
         WHERE pay_success_time >= #{startDate}
         AND pay_success_time &lt;= #{endDate}