yudao-module-bi/src/main/java/cn/iocoder/yudao/module/bi/dal/mysql/decision/BiForecastDataMapper.java
@@ -19,4 +19,14 @@ .between(BiForecastDataDO::getPointTime, beginTime, endTime) .orderByAsc(BiForecastDataDO::getPointTime)); } /** * 查询指定预测编码下最近 n 条预测数据(按时间倒序,用于移动平均) */ default List<BiForecastDataDO> selectRecentByCode(String forecastCode, int limit) { return selectList(new LambdaQueryWrapper<BiForecastDataDO>() .eq(BiForecastDataDO::getForecastCode, forecastCode) .orderByDesc(BiForecastDataDO::getPointTime) .last("LIMIT " + limit)); } }