yumeng 11 kuukautta sitten
vanhempi
commit
f7675e3b0d
1 muutettua tiedostoa jossa 23 lisäystä ja 22 poistoa
  1. 23 22
      ruixuan-live/src/main/resources/mapper/isc/SupplyChainMapper.xml

+ 23 - 22
ruixuan-live/src/main/resources/mapper/isc/SupplyChainMapper.xml

@@ -3927,53 +3927,54 @@
         ORDER BY tag_oid_num DESC limit 5
     </select>
     <select id="shopList" resultType="com.alibaba.fastjson.JSONObject">
-        select seller_id as 'sellerId',
-        seller_nick_name as 'sellerName',
-        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,
+        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,
         2) as 'settledOrderRate',
-        count(oid) as 'orderNum',
-        round(sum(case when order_status != 80 then pay_amount else 0 end) / 100,
+        count(t1.oid) as 'orderNum',
+        round(sum(case when t1.order_status != 80 then t1.pay_amount else 0 end) / 100,
         2) as 'payAmount',
-        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,
+        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,
         2) as 'validRadio',
-        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
+        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
         then 1
         else 0 end) * 100,
         2) as 'shippingGreen',
-        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
-        when send_status = 1
+        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
         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
         where 1 = 1
         <if test="start != null and start != ''">
-            and stat_date &gt;= #{start}
+            and t1.stat_date &gt;= #{start}
         </if>
         <if test="end != null and end != ''">
-            and stat_date &lt;= #{end}
+            and t1.stat_date &lt;= #{end}
         </if>
         <if test="sellerId != null and sellerId != ''">
-            and seller_id = #{sellerId}
+            and t1.seller_id = #{sellerId}
         </if>
         <if test='itemIds != null and itemIds.size() > 0'>
-            and item_id in
+            and t1.item_id in
             <foreach collection="itemIds" item="item" separator=","
                      open="(" close=")">
                 #{item}
             </foreach>
 
         </if>
-        group by seller_id
+        group by t1.seller_id
         order by ${fieId} ${sort}
 
+
     </select>
     <select id="shopDetail" resultType="com.alibaba.fastjson.JSONObject">
         SELECT t1.*,