fix: 优化到数统计
This commit is contained in:
parent
006b544b04
commit
b7d47f2268
@ -34,14 +34,18 @@ public class FishStatisticsServiceImpl implements IFishStatisticsService {
|
|||||||
// List<String> basinNames = parseFilterList(basinNamesStr);
|
// List<String> basinNames = parseFilterList(basinNamesStr);
|
||||||
// List<String> stationNames = parseFilterList(stationNamesStr);
|
// List<String> stationNames = parseFilterList(stationNamesStr);
|
||||||
|
|
||||||
int take = dataSourceRequest.getTake();
|
int currentPage = dataSourceRequest.getSkip();
|
||||||
int skip = dataSourceRequest.getSkip();
|
int pageSize = dataSourceRequest.getTake();
|
||||||
if (take <= 0) {
|
|
||||||
take = 20;
|
if (currentPage <= 0) {
|
||||||
|
currentPage = 1;
|
||||||
|
}
|
||||||
|
if (pageSize <= 0) {
|
||||||
|
pageSize = 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
int startRow = skip;
|
int startRow = (currentPage - 1) * pageSize;
|
||||||
int endRow = skip + take;
|
int endRow = startRow + pageSize;
|
||||||
|
|
||||||
List<FishStatisticsVO> records = fishStatisticsMapper.queryStatistics(
|
List<FishStatisticsVO> records = fishStatisticsMapper.queryStatistics(
|
||||||
basinNamesStr, stationNamesStr, startRow, endRow);
|
basinNamesStr, stationNamesStr, startRow, endRow);
|
||||||
@ -51,8 +55,8 @@ public class FishStatisticsServiceImpl implements IFishStatisticsService {
|
|||||||
Page<FishStatisticsVO> page = new Page<>();
|
Page<FishStatisticsVO> page = new Page<>();
|
||||||
page.setRecords(records);
|
page.setRecords(records);
|
||||||
page.setTotal(total);
|
page.setTotal(total);
|
||||||
page.setSize(take);
|
page.setSize(pageSize);
|
||||||
page.setCurrent(skip / take + 1L);
|
page.setCurrent(currentPage);
|
||||||
|
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: prod
|
active: devtw
|
||||||
|
|
||||||
jasypt:
|
jasypt:
|
||||||
encryptor:
|
encryptor:
|
||||||
|
|||||||
@ -178,7 +178,7 @@
|
|||||||
SELECT * FROM (
|
SELECT * FROM (
|
||||||
SELECT
|
SELECT
|
||||||
t.*,
|
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 (
|
FROM (
|
||||||
<include refid="statisticsQuery"/>
|
<include refid="statisticsQuery"/>
|
||||||
) t ORDER BY t.MIN_BASIN_CODE,t.MIN_STATION_CODE,t.REPORT_MONTH,t.MIN_STRDT
|
) t ORDER BY t.MIN_BASIN_CODE,t.MIN_STATION_CODE,t.REPORT_MONTH,t.MIN_STRDT
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user