Bladeren bron

店铺管理

yumeng 11 maanden geleden
bovenliggende
commit
0740e6b1bd
1 gewijzigde bestanden met toevoegingen van 24 en 1 verwijderingen
  1. 24 1
      ruixuan-live/src/main/resources/mapper/isc/SupplyChainMapper.xml

+ 24 - 1
ruixuan-live/src/main/resources/mapper/isc/SupplyChainMapper.xml

@@ -3939,24 +3939,40 @@
         ORDER BY tag_oid_num DESC limit 5
     </select>
     <select id="shopList" resultType="com.alibaba.fastjson.JSONObject">
+        select t1.seller_id as 'sellerId',
+        MAX(t2.shop_title) as 'sellerName',
+        sum(case when t1.order_status = 60 then 1 else 0 end) as 'settledOrderNUm',
+        round(sum(case when t1.order_status = 60 then 1 else 0 end) / count(t1.oid) * 100,
         SELECT t2.shopTitle as 'sellerName',t1.* from (
         select seller_id as 'sellerId',
         sum(case when order_status = 60 then 1 else 0 end) as 'settledOrderNUm',
         round(sum(case when order_status = 60 then 1 else 0 end) / count(oid) * 100,
         2) as 'settledOrderRate',
+        count(t1.oid) as 'orderNum',
+        round(sum(case when t1.order_status != 80 then t1.pay_amount else 0 end) / 100,
         count(oid) as 'orderNum',
         round(sum(case when order_status != 80 then pay_amount else 0 end) / 100,
         2) as 'payAmount',
+        round(t1.regimental_promotion_rate / 10, 2) as 'regimentalPromotionRate',
+        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) * 100,
         round(regimental_promotion_rate / 10, 2) 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) * 100,
         2) as 'validRadio',
+        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
         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) * 100,
         2) 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.send_status = 1
         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
@@ -3964,18 +3980,23 @@
         then 1
         else 0 end) * 100,
         2) as 'deliveryRadio'
-        from kuaishou_supply_chain
+        from kuaishou_supply_chain t1 LEFT JOIN kuaishou_activity_open_item_list t2 on t1.item_id = t2.item_id
+        from kuaishou_supply_chain t1 LEFT JOIN  kuaishou_activity_open_item_list t2 on t1.item_id = t2.item_id
         where 1 = 1
         <if test="start != null and start != ''">
+            and t1.stat_date &gt;= #{start}
             and stat_date &gt;= #{start}
         </if>
         <if test="end != null and end != ''">
+            and t1.stat_date &lt;= #{end}
             and stat_date &lt;= #{end}
         </if>
         <if test="sellerId != null and sellerId != ''">
+            and t1.seller_id = #{sellerId}
             and seller_id = #{sellerId}
         </if>
         <if test='itemIds != null and itemIds.size() > 0'>
+            and t1.item_id in
             and item_id in
             <foreach collection="itemIds" item="item" separator=","
                      open="(" close=")">
@@ -3983,6 +4004,7 @@
             </foreach>
 
         </if>
+        group by t1.seller_id
         group by seller_id ) t1
         left join(select shop_id as 'shopId', shop_title as 'shopTitle' from kuaishou_activity_open_item_list GROUP BY
         shop_id)t2
@@ -3990,6 +4012,7 @@
         order by ${fieId} ${sort}
 
 
+
     </select>
     <select id="shopDetail" resultType="com.alibaba.fastjson.JSONObject">
         SELECT t1.*,