ソースを参照

Merge branch 'dev/wcl' of https://s-20coaj910c.zht2.com/lwh/seo into dev/lwh

lwh 3 週間 前
コミット
c7b920391f
21 ファイル変更186 行追加81 行削除
  1. 5 2
      pig-statistics/pig-statistics-api/src/main/java/com/pig4cloud/pig/statistics/api/entity/ConfigItem.java
  2. 1 1
      pig-statistics/pig-statistics-api/src/main/java/com/pig4cloud/pig/statistics/api/entity/uninstall/MktDeviceAction.java
  3. 1 1
      pig-statistics/pig-statistics-api/src/main/java/com/pig4cloud/pig/statistics/api/entity/uninstall/MktDeviceCount.java
  4. 1 1
      pig-statistics/pig-statistics-api/src/main/java/com/pig4cloud/pig/statistics/api/entity/uninstall/MktDeviceInterfere.java
  5. 1 1
      pig-statistics/pig-statistics-api/src/main/java/com/pig4cloud/pig/statistics/api/entity/uninstall/MktDeviceTime.java
  6. 1 1
      pig-statistics/pig-statistics-api/src/main/java/com/pig4cloud/pig/statistics/api/entity/uninstall/MktInstallUninstallRatio.java
  7. 1 1
      pig-statistics/pig-statistics-api/src/main/java/com/pig4cloud/pig/statistics/api/entity/uninstall/MktPortrait.java
  8. 1 1
      pig-statistics/pig-statistics-api/src/main/java/com/pig4cloud/pig/statistics/api/entity/uninstall/MktPredict.java
  9. 1 1
      pig-statistics/pig-statistics-api/src/main/java/com/pig4cloud/pig/statistics/api/entity/uninstall/MktTrendSummary.java
  10. 71 29
      pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/Util/ConfigUtils.java
  11. 28 0
      pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/StatConfigMapper.java
  12. 6 1
      pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/StatDeviceActionMapper.java
  13. 6 1
      pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/StatDeviceCountMapper.java
  14. 6 1
      pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/StatDeviceInterfereMapper.java
  15. 6 1
      pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/StatDeviceTimeMapper.java
  16. 3 4
      pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/StatInstallRatioMapper.java
  17. 3 4
      pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/StatPortraitMapper.java
  18. 3 4
      pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/StatPredictMapper.java
  19. 6 1
      pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/StatTrendSummaryMapper.java
  20. 1 1
      pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/SysConfigMapper.java
  21. 34 24
      pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/service/impl/UninstallAnalyseServiceImpl.java

+ 5 - 2
pig-statistics/pig-statistics-api/src/main/java/com/pig4cloud/pig/statistics/api/entity/ConfigItem.java

@@ -2,6 +2,7 @@ package com.pig4cloud.pig.statistics.api.entity;
 
 
 import lombok.Data;
+import java.io.Serializable;
 
 /**
  * @author wcl
@@ -9,9 +10,11 @@ import lombok.Data;
  * @description: 配置
  */
 @Data
-public class ConfigItem {
+public class ConfigItem implements Serializable {
 
-	private String key; // config_key
+	private static final long serialVersionUID = 1L;
+	
+	private String name; // config_key
 	private String value; // config_value
 	private String label; // config_label
 }

+ 1 - 1
pig-statistics/pig-statistics-api/src/main/java/com/pig4cloud/pig/statistics/api/entity/uninstall/MktDeviceAction.java

@@ -11,7 +11,7 @@ import java.util.Date;
  * @description: 卸载前后操作行为分布表实体
  */
 @Data
-@TableName("uninstall_device_action")
+@TableName("stat_device_action")
 public class MktDeviceAction {
     @TableId
     private Long id;

+ 1 - 1
pig-statistics/pig-statistics-api/src/main/java/com/pig4cloud/pig/statistics/api/entity/uninstall/MktDeviceCount.java

@@ -11,7 +11,7 @@ import java.util.Date;
  * @description: 卸载相关次数分布表实体
  */
 @Data
-@TableName("uninstall_device_count")
+@TableName("stat_device_count")
 public class MktDeviceCount {
     @TableId
     private Long id;

+ 1 - 1
pig-statistics/pig-statistics-api/src/main/java/com/pig4cloud/pig/statistics/api/entity/uninstall/MktDeviceInterfere.java

@@ -11,7 +11,7 @@ import java.util.Date;
  * @description: 卸载前干预类型分布表实体
  */
 @Data
-@TableName("uninstall_device_interfere")
+@TableName("stat_device_interfere")
 public class MktDeviceInterfere {
     @TableId
     private Long id;

+ 1 - 1
pig-statistics/pig-statistics-api/src/main/java/com/pig4cloud/pig/statistics/api/entity/uninstall/MktDeviceTime.java

@@ -11,7 +11,7 @@ import java.util.Date;
  * @description: 卸载相关时长分布表实体
  */
 @Data
-@TableName("uninstall_device_time")
+@TableName("stat_device_time")
 public class MktDeviceTime {
     @TableId
     private Long id; // 主键

+ 1 - 1
pig-statistics/pig-statistics-api/src/main/java/com/pig4cloud/pig/statistics/api/entity/uninstall/MktInstallUninstallRatio.java

@@ -11,7 +11,7 @@ import java.util.Date;
  * @description: 安装卸载比统计表实体
  */
 @Data
-@TableName("install_uninstall_ratio")
+@TableName("stat_install_ratio")
 public class MktInstallUninstallRatio {
     /** 主键 */
     @TableId

+ 1 - 1
pig-statistics/pig-statistics-api/src/main/java/com/pig4cloud/pig/statistics/api/entity/uninstall/MktPortrait.java

@@ -11,7 +11,7 @@ import java.util.Date;
  * @description: 卸载画像统计表实体
  */
 @Data
-@TableName("uninstall_portrait")
+@TableName("stat_portrait")
 public class MktPortrait {
     /** 主键 */
     @TableId

+ 1 - 1
pig-statistics/pig-statistics-api/src/main/java/com/pig4cloud/pig/statistics/api/entity/uninstall/MktPredict.java

@@ -11,7 +11,7 @@ import java.util.Date;
  * @description: 卸载预测统计表实体
  */
 @Data
-@TableName("uninstall_predict")
+@TableName("stat_predict")
 public class MktPredict {
     /** 主键 */
     @TableId

+ 1 - 1
pig-statistics/pig-statistics-api/src/main/java/com/pig4cloud/pig/statistics/api/entity/uninstall/MktTrendSummary.java

@@ -11,7 +11,7 @@ import java.util.Date;
  * @description: 卸载趋势汇总表实体
  */
 @Data
-@TableName("uninstall_trend_summary")
+@TableName("stat_trend_summary")
 public class MktTrendSummary {
     /** 主键 */
     @TableId

+ 71 - 29
pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/Util/ConfigUtils.java

@@ -2,12 +2,13 @@ package com.pig4cloud.pig.statistics.Util;
 
 
 import com.pig4cloud.pig.statistics.api.entity.ConfigItem;
-import com.pig4cloud.pig.statistics.mapper.SysConfigMapper;
+import com.pig4cloud.pig.statistics.mapper.StatConfigMapper;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Component;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
 
@@ -20,13 +21,13 @@ import java.util.concurrent.TimeUnit;
 @Slf4j
 public class ConfigUtils {
 
-	private static SysConfigMapper sysConfigMapper;
+	private static StatConfigMapper statConfigMapper;
 	private static RedisTemplate<String, Object> redisTemplate;
 	private static final String CONFIG_CACHE_PREFIX = "sys_config:";
 
 	@Autowired
-	public ConfigUtils(SysConfigMapper sysConfigMapper, RedisTemplate<String, Object> redisTemplate) {
-		ConfigUtils.sysConfigMapper = sysConfigMapper;
+	public ConfigUtils(StatConfigMapper statConfigMapper, RedisTemplate<String, Object> redisTemplate) {
+		ConfigUtils.statConfigMapper = statConfigMapper;
 		ConfigUtils.redisTemplate = redisTemplate;
 	}
 
@@ -36,41 +37,82 @@ public class ConfigUtils {
 	 * @return 配置项
 	 */
 	public static List<ConfigItem> getConfigValues(String configKey) {
-		String cacheKey = CONFIG_CACHE_PREFIX + configKey;
-		List<ConfigItem> cached = (List<ConfigItem>) redisTemplate.opsForValue().get(cacheKey);
-		if (cached != null) {
-			return cached;
+		try {
+			String cacheKey = CONFIG_CACHE_PREFIX + configKey;
+			
+			// 尝试从缓存获取
+			List<ConfigItem> cached = (List<ConfigItem>) redisTemplate.opsForValue().get(cacheKey);
+			if (cached != null) {
+				log.debug("从缓存获取配置: {}", configKey);
+				return cached;
+			}
+			
+			// 从数据库查询
+			List<ConfigItem> list = statConfigMapper.selectByConfigKey(configKey);
+			if (list != null && !list.isEmpty()) {
+				try {
+					// 尝试存入缓存
+					redisTemplate.opsForValue().set(cacheKey, list, 24, TimeUnit.HOURS);
+					log.debug("配置已存入缓存: {}", configKey);
+				} catch (Exception e) {
+					log.warn("配置缓存失败,但不影响业务: {}", configKey, e);
+				}
+			}
+			
+			return list != null ? list : new ArrayList<>();
+		} catch (Exception e) {
+			log.error("获取配置失败: {}", configKey, e);
+			// 降级处理:直接查询数据库
+			try {
+				return statConfigMapper.selectByConfigKey(configKey);
+			} catch (Exception dbEx) {
+				log.error("数据库查询也失败: {}", configKey, dbEx);
+				return new ArrayList<>();
+			}
 		}
-		List<ConfigItem> list = sysConfigMapper.selectByConfigKey(configKey);
-		// 日志
-		log.info("---存入redis~~~~~~");
-		redisTemplate.opsForValue().set(cacheKey, list, 1, TimeUnit.HOURS);
-		log.info("---已存redis~~~~~~");
-		return list;
 	}
 
 	public static void clearConfigCache(String configKey) {
-		redisTemplate.delete(CONFIG_CACHE_PREFIX + configKey);
+		try {
+			redisTemplate.delete(CONFIG_CACHE_PREFIX + configKey);
+			log.debug("配置缓存已清除: {}", configKey);
+		} catch (Exception e) {
+			log.warn("清除配置缓存失败: {}", configKey, e);
+		}
 	}
 
 	/**
 	 * 获取一条配置
-	 * @param configKey
-	 * @param configValue
-	 * @return
+	 * @param configKey 配置键
+	 * @param configValue 配置值
+	 * @return 配置项
 	 */
-	public static ConfigItem getConfigValue(String configKey , String configValue) {
-
-		ConfigItem configItem = new ConfigItem();
-		List<ConfigItem> configValues = getConfigValues(configKey);
-
-		for (ConfigItem item : configValues) {
-			if (item.getValue().equals(configValue)) {
-				configItem = item;
-				break;
+	public static ConfigItem getConfigValue(String configKey, String configValue) {
+		try {
+			List<ConfigItem> configValues = getConfigValues(configKey);
+			
+			if (configValues != null && !configValues.isEmpty()) {
+				for (ConfigItem item : configValues) {
+					if (item.getValue() != null && item.getValue().equals(configValue)) {
+						return item;
+					}
+				}
 			}
+			
+			// 如果没有找到匹配的配置,返回默认值
+			ConfigItem defaultItem = new ConfigItem();
+			defaultItem.setName(configKey);
+			defaultItem.setValue(configValue);
+			defaultItem.setLabel("未知配置");
+			return defaultItem;
+		} catch (Exception e) {
+			log.error("获取配置值失败: key={}, value={}", configKey, configValue, e);
+			// 返回默认值
+			ConfigItem defaultItem = new ConfigItem();
+			defaultItem.setName(configKey);
+			defaultItem.setValue(configValue);
+			defaultItem.setLabel("配置获取失败");
+			return defaultItem;
 		}
-
-		return configItem;
 	}
 }

+ 28 - 0
pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/StatConfigMapper.java

@@ -0,0 +1,28 @@
+package com.pig4cloud.pig.statistics.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.pig4cloud.pig.statistics.api.entity.ConfigItem;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+
+/**
+ * @author wcl
+ * @date 2025/8/20 17:00
+ * @description: 统计配置表Mapper
+ */
+@Mapper
+public interface StatConfigMapper extends BaseMapper<ConfigItem> {
+    
+    /**
+     * 根据配置键查询配置项
+     * @param configKey 配置键
+     * @return 配置项列表
+     */
+    @Select("SELECT config_key as name, config_value as value, config_label as label " +
+            "FROM stat_config " +
+            "WHERE config_key = #{configKey} AND enable = 1 " +
+            "ORDER BY sort ASC")
+    List<ConfigItem> selectByConfigKey(String configKey);
+}

+ 6 - 1
pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/MktDeviceActionMapper.java → pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/StatDeviceActionMapper.java

@@ -4,5 +4,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.pig4cloud.pig.statistics.api.entity.uninstall.MktDeviceAction;
 import org.apache.ibatis.annotations.Mapper;
 
+/**
+ * @author wcl
+ * @date 2025/8/20 17:00
+ * @description: 统计设备行为分布表Mapper
+ */
 @Mapper
-public interface MktDeviceActionMapper extends BaseMapper<MktDeviceAction> {}
+public interface StatDeviceActionMapper extends BaseMapper<MktDeviceAction> {}

+ 6 - 1
pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/MktDeviceCountMapper.java → pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/StatDeviceCountMapper.java

@@ -4,5 +4,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.pig4cloud.pig.statistics.api.entity.uninstall.MktDeviceCount;
 import org.apache.ibatis.annotations.Mapper;
 
+/**
+ * @author wcl
+ * @date 2025/8/20 17:00
+ * @description: 统计设备次数分布表Mapper
+ */
 @Mapper
-public interface MktDeviceCountMapper extends BaseMapper<MktDeviceCount> {}
+public interface StatDeviceCountMapper extends BaseMapper<MktDeviceCount> {}

+ 6 - 1
pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/MktDeviceInterfereMapper.java → pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/StatDeviceInterfereMapper.java

@@ -4,5 +4,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.pig4cloud.pig.statistics.api.entity.uninstall.MktDeviceInterfere;
 import org.apache.ibatis.annotations.Mapper;
 
+/**
+ * @author wcl
+ * @date 2025/8/20 17:00
+ * @description: 统计设备干预分布表Mapper
+ */
 @Mapper
-public interface MktDeviceInterfereMapper extends BaseMapper<MktDeviceInterfere> {}
+public interface StatDeviceInterfereMapper extends BaseMapper<MktDeviceInterfere> {}

+ 6 - 1
pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/MktDeviceTimeMapper.java → pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/StatDeviceTimeMapper.java

@@ -4,5 +4,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.pig4cloud.pig.statistics.api.entity.uninstall.MktDeviceTime;
 import org.apache.ibatis.annotations.Mapper;
 
+/**
+ * @author wcl
+ * @date 2025/8/20 17:00
+ * @description: 统计设备时长分布表Mapper
+ */
 @Mapper
-public interface MktDeviceTimeMapper extends BaseMapper<MktDeviceTime> {}
+public interface StatDeviceTimeMapper extends BaseMapper<MktDeviceTime> {}

+ 3 - 4
pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/MktInstallUninstallRatioMapper.java → pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/StatInstallRatioMapper.java

@@ -6,9 +6,8 @@ import org.apache.ibatis.annotations.Mapper;
 
 /**
  * @author wcl
- * @date 2025/8/20 16:00
- * @description: 安装卸载比统计表Mapper
+ * @date 2025/8/20 17:00
+ * @description: 统计安装比例表Mapper
  */
 @Mapper
-public interface MktInstallUninstallRatioMapper extends BaseMapper<MktInstallUninstallRatio> {
-}
+public interface StatInstallRatioMapper extends BaseMapper<MktInstallUninstallRatio> {}

+ 3 - 4
pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/MktPortraitMapper.java → pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/StatPortraitMapper.java

@@ -6,9 +6,8 @@ import org.apache.ibatis.annotations.Mapper;
 
 /**
  * @author wcl
- * @date 2025/8/20 15:30
- * @description: 卸载画像统计表Mapper
+ * @date 2025/8/20 17:00
+ * @description: 统计画像表Mapper
  */
 @Mapper
-public interface MktPortraitMapper extends BaseMapper<MktPortrait> {
-}
+public interface StatPortraitMapper extends BaseMapper<MktPortrait> {}

+ 3 - 4
pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/MktPredictMapper.java → pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/StatPredictMapper.java

@@ -6,9 +6,8 @@ import org.apache.ibatis.annotations.Mapper;
 
 /**
  * @author wcl
- * @date 2025/8/20 16:30
- * @description: 卸载预测统计表Mapper
+ * @date 2025/8/20 17:00
+ * @description: 统计预测表Mapper
  */
 @Mapper
-public interface MktPredictMapper extends BaseMapper<MktPredict> {
-}
+public interface StatPredictMapper extends BaseMapper<MktPredict> {}

+ 6 - 1
pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/MktTrendSummaryMapper.java → pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/StatTrendSummaryMapper.java

@@ -4,7 +4,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.pig4cloud.pig.statistics.api.entity.uninstall.MktTrendSummary;
 import org.apache.ibatis.annotations.Mapper;
 
+/**
+ * @author wcl
+ * @date 2025/8/20 17:00
+ * @description: 统计趋势汇总表Mapper
+ */
 @Mapper
-public interface MktTrendSummaryMapper extends BaseMapper<MktTrendSummary> {
+public interface StatTrendSummaryMapper extends BaseMapper<MktTrendSummary> {
     // 可扩展自定义方法
 }

+ 1 - 1
pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/mapper/SysConfigMapper.java

@@ -16,6 +16,6 @@ import java.util.List;
 @Mapper
 public interface SysConfigMapper {
 
-	@Select("SELECT config_key as key , config_value as value, config_label as label FROM sys_config WHERE config_key = #{configKey} AND enable = 1 ORDER BY sort ASC")
+	@Select("SELECT config_key as name, config_value as value, config_label as label FROM sys_config WHERE config_key = #{configKey} AND enable = 1 ORDER BY sort ASC")
 	List<ConfigItem> selectByConfigKey(@Param("configKey") String configKey);
 }

+ 34 - 24
pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/service/impl/UninstallAnalyseServiceImpl.java

@@ -8,7 +8,14 @@ import com.pig4cloud.pig.statistics.api.dto.uninstall.*;
 import com.pig4cloud.pig.statistics.api.entity.ConfigItem;
 import com.pig4cloud.pig.statistics.api.entity.uninstall.*;
 import com.pig4cloud.pig.statistics.api.vo.uninstall.*;
-import com.pig4cloud.pig.statistics.mapper.*;
+import com.pig4cloud.pig.statistics.mapper.StatTrendSummaryMapper;
+import com.pig4cloud.pig.statistics.mapper.StatDeviceTimeMapper;
+import com.pig4cloud.pig.statistics.mapper.StatDeviceCountMapper;
+import com.pig4cloud.pig.statistics.mapper.StatDeviceInterfereMapper;
+import com.pig4cloud.pig.statistics.mapper.StatDeviceActionMapper;
+import com.pig4cloud.pig.statistics.mapper.StatPortraitMapper;
+import com.pig4cloud.pig.statistics.mapper.StatPredictMapper;
+import com.pig4cloud.pig.statistics.mapper.StatInstallRatioMapper;
 import com.pig4cloud.pig.statistics.service.UninstallAnalyseService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -34,21 +41,21 @@ public class UninstallAnalyseServiceImpl implements UninstallAnalyseService {
 	private static final Random random = new Random();
 
 	@Autowired
-	private MktTrendSummaryMapper mktTrendSummaryMapper;
+	private StatTrendSummaryMapper statTrendSummaryMapper;
 	@Autowired
-	private MktDeviceTimeMapper mktDeviceTimeMapper;
+	private StatDeviceTimeMapper statDeviceTimeMapper;
 	@Autowired
-	private MktDeviceCountMapper mktDeviceCountMapper;
+	private StatDeviceCountMapper statDeviceCountMapper;
 	@Autowired
-	private MktDeviceInterfereMapper mktDeviceInterfereMapper;
+	private StatDeviceInterfereMapper statDeviceInterfereMapper;
 	@Autowired
-	private MktDeviceActionMapper mktDeviceActionMapper;
+	private StatDeviceActionMapper statDeviceActionMapper;
 	@Autowired
-	private MktPortraitMapper mktPortraitMapper;
+	private StatPortraitMapper statPortraitMapper;
 	@Autowired
-	private MktInstallUninstallRatioMapper mktInstallUninstallRatioMapper;
+	private StatInstallRatioMapper statInstallRatioMapper;
 	@Autowired
-	private MktPredictMapper mktPredictMapper;
+	private StatPredictMapper statPredictMapper;
 
 	@Override
 	public UninstallTrendVO getUninstallTrend(GetUninstallTrendDTO dto) {
@@ -96,7 +103,7 @@ public class UninstallAnalyseServiceImpl implements UninstallAnalyseService {
 			wrapper.eq("app_version", dto.getVersion());
 		}
 		wrapper.eq("stat_cycle", timeUnit);
-		List<MktTrendSummary> list = mktTrendSummaryMapper.selectList(wrapper);
+		List<MktTrendSummary> list = statTrendSummaryMapper.selectList(wrapper);
 
 		UninstallTrendVO vo = new UninstallTrendVO();
 
@@ -152,7 +159,7 @@ public class UninstallAnalyseServiceImpl implements UninstallAnalyseService {
 			wrapper.between("stat_date", dto.getStartDate(), dto.getEndDate());
 		}
 
-		List<MktTrendSummary> list = mktTrendSummaryMapper.selectList(wrapper);
+		List<MktTrendSummary> list = statTrendSummaryMapper.selectList(wrapper);
 		log.info("查询结果数量: {}", list.size());
 
 		// 使用Stream API优化分组和统计逻辑
@@ -231,7 +238,10 @@ public class UninstallAnalyseServiceImpl implements UninstallAnalyseService {
 
 		Map<String, LocalDate> timeRangeMap = getTimeRangeMap(StringUtils.isEmpty(dto.getType()) ? "week" : dto.getType());
 		QueryWrapper<MktDeviceTime> wrapper = new QueryWrapper<>();
-		wrapper.eq("type", dto.getType());
+		if (!StringUtils.isEmpty(dto.getType())) {
+			wrapper.eq("type", dto.getType());
+		}
+
 		// 添加时间范围查询
 		wrapper.between("stat_date", timeRangeMap.get("startDate"), timeRangeMap.get("endDate"));
 		// 动态添加其他查询条件
@@ -239,7 +249,7 @@ public class UninstallAnalyseServiceImpl implements UninstallAnalyseService {
 		if (!StringUtils.isEmpty(dto.getChannel())) wrapper.eq("channel", dto.getChannel());
 		if (!StringUtils.isEmpty(dto.getVersion())) wrapper.eq("app_version", dto.getVersion());
 
-		List<MktDeviceTime> list = mktDeviceTimeMapper.selectList(wrapper);
+		List<MktDeviceTime> list = statDeviceTimeMapper.selectList(wrapper);
 		List<InstallStockVO> voList = new ArrayList<>();
 		for (MktDeviceTime entity : list) {
 			InstallStockVO vo = new InstallStockVO();
@@ -313,7 +323,7 @@ public class UninstallAnalyseServiceImpl implements UninstallAnalyseService {
 		if (!StringUtils.isEmpty(dto.getAppId())) timeWrapper.eq("app_id", dto.getAppId());
 		if (!StringUtils.isEmpty(dto.getChannel())) timeWrapper.eq("channel", dto.getChannel());
 		if (!StringUtils.isEmpty(dto.getVersion())) timeWrapper.eq("app_version", dto.getVersion());
-		List<MktDeviceTime> timeList = mktDeviceTimeMapper.selectList(timeWrapper);
+		List<MktDeviceTime> timeList = statDeviceTimeMapper.selectList(timeWrapper);
 		List<UninstallTimeDiffVO> timeDiffs = new ArrayList<>();
 		for (MktDeviceTime entity : timeList) {
 			UninstallTimeDiffVO vo = new UninstallTimeDiffVO();
@@ -330,7 +340,7 @@ public class UninstallAnalyseServiceImpl implements UninstallAnalyseService {
 		if (!StringUtils.isEmpty(dto.getAppId())) countWrapper.eq("app_id", dto.getAppId());
 		if (!StringUtils.isEmpty(dto.getChannel())) countWrapper.eq("channel", dto.getChannel());
 		if (!StringUtils.isEmpty(dto.getVersion())) countWrapper.eq("app_version", dto.getVersion());
-		List<MktDeviceCount> countList = mktDeviceCountMapper.selectList(countWrapper);
+		List<MktDeviceCount> countList = statDeviceCountMapper.selectList(countWrapper);
 		List<UninstallBeforeSevenVO> beforeSevens = new ArrayList<>();
 		for (MktDeviceCount entity : countList) {
 			UninstallBeforeSevenVO vo = new UninstallBeforeSevenVO();
@@ -375,7 +385,7 @@ public class UninstallAnalyseServiceImpl implements UninstallAnalyseService {
 		if (!StringUtils.isEmpty(dto.getAppId())) interfereWrapper.eq("app_id", dto.getAppId());
 		if (!StringUtils.isEmpty(dto.getChannel())) interfereWrapper.eq("channel", dto.getChannel());
 		if (!StringUtils.isEmpty(dto.getVersion())) interfereWrapper.eq("app_version", dto.getVersion());
-		List<MktDeviceInterfere> interfereList = mktDeviceInterfereMapper.selectList(interfereWrapper);
+		List<MktDeviceInterfere> interfereList = statDeviceInterfereMapper.selectList(interfereWrapper);
 		Map<String, Map<String, Integer>> interfereMap = new LinkedHashMap<>();
 		for (MktDeviceInterfere entity : interfereList) {
 			Map<String, Integer> map = new HashMap<>();
@@ -418,7 +428,7 @@ public class UninstallAnalyseServiceImpl implements UninstallAnalyseService {
 		if (!StringUtils.isEmpty(dto.getAppId())) actionWrapper.eq("app_id", dto.getAppId());
 		if (!StringUtils.isEmpty(dto.getChannel())) actionWrapper.eq("channel", dto.getChannel());
 		if (!StringUtils.isEmpty(dto.getVersion())) actionWrapper.eq("app_version", dto.getVersion());
-		List<MktDeviceAction> actionList = mktDeviceActionMapper.selectList(actionWrapper);
+		List<MktDeviceAction> actionList = statDeviceActionMapper.selectList(actionWrapper);
 		List<Map<String, Integer>> list = new ArrayList<>();
 		for (MktDeviceAction entity : actionList) {
 			Map<String, Integer> map = new HashMap<>();
@@ -440,10 +450,10 @@ public class UninstallAnalyseServiceImpl implements UninstallAnalyseService {
 
 	@Override
 	public List<UninstallOfterAPPOV> uninstallAfter(GetUninstallInsightDTO dto) {
-		// 这里只做演示,实际可查mkt_device_time或相关表
+		// 这里只做演示,实际可查stat_device_time或相关表
 		QueryWrapper<MktDeviceTime> wrapper = new QueryWrapper<>();
 		wrapper.eq("type", "after");
-		List<MktDeviceTime> list = mktDeviceTimeMapper.selectList(wrapper);
+		List<MktDeviceTime> list = statDeviceTimeMapper.selectList(wrapper);
 		List<UninstallOfterAPPOV> result = new ArrayList<>();
 		for (MktDeviceTime entity : list) {
 			UninstallOfterAPPOV vo = new UninstallOfterAPPOV();
@@ -459,7 +469,7 @@ public class UninstallAnalyseServiceImpl implements UninstallAnalyseService {
 	public List<UninstallSYSOV> uninstallSys(GetUninstallInsightDTO dto) {
 		QueryWrapper<MktDeviceTime> wrapper = new QueryWrapper<>();
 		wrapper.eq("type", "sys");
-		List<MktDeviceTime> list = mktDeviceTimeMapper.selectList(wrapper);
+		List<MktDeviceTime> list = statDeviceTimeMapper.selectList(wrapper);
 		Map<String, List<Map<String, Integer>>> sysMap = new LinkedHashMap<>();
 		for (MktDeviceTime entity : list) {
 			sysMap.computeIfAbsent(entity.getTimeRange(), k -> new ArrayList<>())
@@ -514,7 +524,7 @@ public class UninstallAnalyseServiceImpl implements UninstallAnalyseService {
 		
 		wrapper.between("stat_date", startDate, endDate);
 		
-		List<MktPortrait> portraitList = mktPortraitMapper.selectList(wrapper);
+		List<MktPortrait> portraitList = statPortraitMapper.selectList(wrapper);
 		
 		// 1. 卸载数量统计
 		UninstallPortraitSumOV sum = new UninstallPortraitSumOV();
@@ -618,7 +628,7 @@ public class UninstallAnalyseServiceImpl implements UninstallAnalyseService {
 			wrapper.between("stat_date", dto.getStartDate(), dto.getEndDate());
 		}
 		
-		List<MktPredict> predictList = mktPredictMapper.selectList(wrapper);
+		List<MktPredict> predictList = statPredictMapper.selectList(wrapper);
 		
 		List<UninstallPredictVO> result = new ArrayList<>();
 		
@@ -672,7 +682,7 @@ public class UninstallAnalyseServiceImpl implements UninstallAnalyseService {
 			wrapper.between("stat_date", dto.getStartDate(), dto.getEndDate());
 		}
 		
-		List<MktInstallUninstallRatio> ratioList = mktInstallUninstallRatioMapper.selectList(wrapper);
+		List<MktInstallUninstallRatio> ratioList = statInstallRatioMapper.selectList(wrapper);
 		
 		// 按日期分组,每个日期对应多个行业-占比
 		Map<Date, List<MktInstallUninstallRatio>> dateGroups = ratioList.stream()
@@ -722,4 +732,4 @@ public class UninstallAnalyseServiceImpl implements UninstallAnalyseService {
 		// 使用PageUtils工具类处理分页
 		return PageUtils.buildPage(allData, pageNum, pageSize);
 	}
-}
+}