Kaynağa Gözat

修改内容:游戏总数据查询sql优化

lth 1 yıl önce
ebeveyn
işleme
8faf189e34

+ 22 - 13
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/GameDataServiceImpl.java

@@ -2236,19 +2236,28 @@ public class GameDataServiceImpl implements IGameDataService {
         return """
                 SELECT
                     a.*,
-                	b.*,
-                	IFNULL(new_user_amount_num, 0) new_user_amount_num,
-                	IFNULL(new_user_again_num, 0) new_user_again_num,
-                	IFNULL(amount_num, 0) amount_num,
-                	IFNULL(buy_new_user_amount_num, 0) buy_new_user_amount_num,
-                	IFNULL(buy_new_user_again_num, 0) buy_new_user_again_num,
-                	IFNULL(buy_amount_num, 0) buy_amount_num,
-                	IFNULL(nature_new_user_amount_num, 0) nature_new_user_amount_num,
-                	IFNULL(nature_new_user_again_num, 0) nature_new_user_again_num,
-                	IFNULL(nature_amount_num, 0) nature_amount_num,
-                 	IFNULL(role_num, 0) role_num,
-                 	IFNULL(buy_role_num, 0) buy_role_num,
-                 	IFNULL(nature_role_num, 0) nature_role_num
+                	a.*,
+                 	IFNULL(buy_amount_count, 0) buy_amount_count,
+                    IFNULL(buy_amount, 0) buy_amount,
+                    IFNULL(nature_amount_count, 0) nature_amount_count,
+                    IFNULL(nature_amount, 0) nature_amount,
+                    IFNULL(amount_count, 0) amount_count,
+                    IFNULL(amount, 0) amount,
+                    IFNULL(buy_avg_amount, 0) buy_avg_amount,
+                    IFNULL(nature_avg_amount, 0) nature_avg_amount,
+                    IFNULL(avg_amount, 0) avg_amount,
+                 	IFNULL(new_user_amount_num, 0) new_user_amount_num,
+                 	IFNULL(new_user_again_num, 0) new_user_again_num,
+                 	IFNULL(amount_num, 0) amount_num,
+                 	IFNULL(buy_new_user_amount_num, 0) buy_new_user_amount_num,
+                 	IFNULL(buy_new_user_again_num, 0) buy_new_user_again_num,
+                 	IFNULL(buy_amount_num, 0) buy_amount_num,
+                 	IFNULL(nature_new_user_amount_num, 0) nature_new_user_amount_num,
+                 	IFNULL(nature_new_user_again_num, 0) nature_new_user_again_num,
+                 	IFNULL(nature_amount_num, 0) nature_amount_num,
+                  	IFNULL(role_num, 0) role_num,
+                  	IFNULL(buy_role_num, 0) buy_role_num,
+                  	IFNULL(nature_role_num, 0) nature_role_num
                 FROM(
                 	SELECT
                 		game_id,