Browse Source

店铺管理

yumeng 11 tháng trước cách đây
mục cha
commit
80776e96ac

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

@@ -3939,59 +3939,64 @@
         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,
-        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,
+        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(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,
+        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 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
+        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 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
         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=")">
@@ -3999,11 +4004,8 @@
             </foreach>
 
         </if>
+        group by seller_id
         group by t1.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
-        on t1.sellerId = t2.shopId
         order by ${fieId} ${sort}