|
|
|
@ -156,10 +156,16 @@ public class ProjectServiceImpl implements ProjectService { |
|
|
|
|
|
|
|
private PageUtils searchProjectInfoPage(PlmProjectInfoData inData, boolean flag) { |
|
|
|
int currPage = inData.getPage() > 0 ? inData.getPage() : 1; |
|
|
|
int pageSize = inData.getLimit() > 0 ? inData.getLimit() : 10; |
|
|
|
long offset = (long) (currPage - 1) * pageSize; |
|
|
|
int limit = inData.getLimit(); |
|
|
|
// limit <= 0:导出全部,Mapper 不拼 OFFSET/FETCH;不能回退成 10 |
|
|
|
long size = limit > 0 ? limit : -1L; |
|
|
|
long offset = limit > 0 ? (long) (currPage - 1) * size : 0L; |
|
|
|
if (limit <= 0) { |
|
|
|
currPage = 1; |
|
|
|
} |
|
|
|
long total = this.projectDao.projectInfoSearchCount(inData, flag); |
|
|
|
List<PlmProjectInfoData> records = this.projectDao.projectInfoSearch(offset, pageSize, inData, flag); |
|
|
|
List<PlmProjectInfoData> records = this.projectDao.projectInfoSearch(offset, size, inData, flag); |
|
|
|
int pageSize = limit > 0 ? limit : Math.max((int) total, 1); |
|
|
|
return new PageUtils(records, (int) total, pageSize, currPage); |
|
|
|
} |
|
|
|
|
|
|
|
@ -705,10 +711,16 @@ public class ProjectServiceImpl implements ProjectService { |
|
|
|
params.put("site", data.getSite()); |
|
|
|
params.put("flag", false); |
|
|
|
int currPage = data.getNo() > 0 ? data.getNo() : 1; |
|
|
|
int pageSize = data.getSize() > 0 ? data.getSize() : 10; |
|
|
|
long offset = (long) (currPage - 1) * pageSize; |
|
|
|
int reqSize = data.getSize(); |
|
|
|
// size <= 0:导出全部,Mapper 不拼 OFFSET/FETCH;不能回退成 10 |
|
|
|
long size = reqSize > 0 ? reqSize : -1L; |
|
|
|
long offset = reqSize > 0 ? (long) (currPage - 1) * size : 0L; |
|
|
|
if (reqSize <= 0) { |
|
|
|
currPage = 1; |
|
|
|
} |
|
|
|
long total = this.projectDao.projectInfoSearchByAnyFieldCount(params); |
|
|
|
List<PlmProjectInfoData> records = this.projectDao.projectInfoSearchByAnyField(offset, pageSize, params); |
|
|
|
List<PlmProjectInfoData> records = this.projectDao.projectInfoSearchByAnyField(offset, size, params); |
|
|
|
int pageSize = reqSize > 0 ? reqSize : Math.max((int) total, 1); |
|
|
|
return new PageUtils(records, (int) total, pageSize, currPage); |
|
|
|
} |
|
|
|
|
|
|
|
|