fix: 优化到数统计

This commit is contained in:
tangwei 2026-05-14 08:41:47 +08:00
parent 006b544b04
commit b7d47f2268
3 changed files with 14 additions and 10 deletions

View File

@ -34,14 +34,18 @@ public class FishStatisticsServiceImpl implements IFishStatisticsService {
// List<String> basinNames = parseFilterList(basinNamesStr);
// List<String> stationNames = parseFilterList(stationNamesStr);
int take = dataSourceRequest.getTake();
int skip = dataSourceRequest.getSkip();
if (take <= 0) {
take = 20;
int currentPage = dataSourceRequest.getSkip();
int pageSize = dataSourceRequest.getTake();
if (currentPage <= 0) {
currentPage = 1;
}
if (pageSize <= 0) {
pageSize = 20;
}
int startRow = skip;
int endRow = skip + take;
int startRow = (currentPage - 1) * pageSize;
int endRow = startRow + pageSize;
List<FishStatisticsVO> records = fishStatisticsMapper.queryStatistics(
basinNamesStr, stationNamesStr, startRow, endRow);
@ -51,8 +55,8 @@ public class FishStatisticsServiceImpl implements IFishStatisticsService {
Page<FishStatisticsVO> page = new Page<>();
page.setRecords(records);
page.setTotal(total);
page.setSize(take);
page.setCurrent(skip / take + 1L);
page.setSize(pageSize);
page.setCurrent(currentPage);
return page;
}

View File

@ -1,6 +1,6 @@
spring:
profiles:
active: prod
active: devtw
jasypt:
encryptor:

View File

@ -178,7 +178,7 @@
SELECT * FROM (
SELECT
t.*,
ROW_NUMBER() OVER (ORDER BY t.REPORT_MONTH, t.USER_ID) AS rn
ROW_NUMBER() OVER (ORDER BY t.MIN_BASIN_CODE,t.MIN_STATION_CODE,t.REPORT_MONTH,t.MIN_STRDT) AS rn
FROM (
<include refid="statisticsQuery"/>
) t ORDER BY t.MIN_BASIN_CODE,t.MIN_STATION_CODE,t.REPORT_MONTH,t.MIN_STRDT