Browse Source

数据大屏折现图修改

zhangchen 1 month ago
parent
commit
d5b3ac8733
1 changed files with 13 additions and 36 deletions
  1. 13 36
      alien-entity/src/main/resources/mapper/ManagementInfoMapper.xml

+ 13 - 36
alien-entity/src/main/resources/mapper/ManagementInfoMapper.xml

@@ -295,48 +295,25 @@
         </if>
     </select>
     <select id="getOrderQuantity" resultType="shop.alien.entity.store.vo.ManagementInfoVo">
-        select count(*) count from (
-        SELECT
-            IFNULL(COUNT( 1 ) ,0) AS count
-        FROM
-            life_user_order `order`
-        left join order_coupon_middle ocm on ocm.order_id  = `order`.id
-        WHERE
-            ( `order`.`status` = 1
-            <if test="dataTime != null and dataTime != ''">
-                AND
-                `order`.pay_time > #{dataTime}
-            </if>
-             ) or
-        ( `order`.`status` = 2
+        select count(*) count
+        from life_user_order luo
+        where luo.status in (1, 7)
         <if test="dataTime != null and dataTime != ''">
-            AND
-            ocm.used_time > #{dataTime}
+            and luo.pay_time > #{dataTime}
         </if>
-        )
-        GROUP BY
-        `order`.id ) all_data
     </select>
     <select id="getTradingVolume" resultType="shop.alien.entity.store.vo.ManagementInfoVo">
-       select  IFNULL(ROUND(sum(all_data.profit_a), 2 ),0) profit from (
+       select IFNULL(ROUND(sum(all_data.profit_a), 2 ),0) profit from (
         SELECT
-            IFNULL(ROUND( `order`.final_price , 2 ),0) AS profit_a
+            IFNULL(ROUND(luo.final_price , 2 ),0) AS profit_a
         FROM
-            life_user_order `order`
-        left join order_coupon_middle ocm on ocm.order_id  = `order`.id
+            life_user_order luo
         WHERE
-            ( `order`.`status` = 2
-                <if test="dataTime != null and dataTime != ''">
-                    AND
-                    ocm.used_time > #{dataTime}
-                </if>
-            )
-           OR ( `order`.`status` = 1
+            luo.status in (1, 7)
             <if test="dataTime != null and dataTime != ''">
-                AND
-                `order`.pay_time > #{dataTime}
+                and luo.pay_time > #{dataTime}
             </if>
-            ) ) all_data
+        ) all_data
     </select>
     <select id="getQueryNetProfitDay" resultType="shop.alien.entity.store.vo.ManagementInfoVo">
         -- 使用递归 CTE 生成 1 到 23 的小时序列
@@ -868,9 +845,9 @@
         FROM
             life_user_order `order`
         WHERE
-            delete_flag = 0
+            1=1
                 <if test="dataTime != null and dataTime != ''">
-                         AND buy_time > #{dataTime}
+                         AND created_time > #{dataTime}
                 </if>
     </select>
     <select id="getStorePlatformOrderVolume" resultType="shop.alien.entity.store.vo.ManagementInfoVo">
@@ -941,7 +918,7 @@
         FROM
             life_user_order `order`
         WHERE
-            `status` = 4
+            `status` = 5
         <if test="dataTime != null and dataTime != ''" >
             AND `order`.refund_time > #{dataTime}
         </if>