Skip to content

Commit f383e63

Browse files
committed
数量为0,不再查询列表
1 parent 729d61e commit f383e63

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

hsweb-web-service/hsweb-web-service-simple/src/main/java/org/hsweb/web/service/impl/AbstractServiceImpl.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,13 @@ public PagerResult<Po> selectPager(QueryParam param) {
3737
param.setPaging(false);
3838
int total = getMapper().total(param);
3939
pagerResult.setTotal(total);
40-
//根据实际记录数量重新指定分页参数
41-
param.rePaging(total);
42-
pagerResult.setData(getMapper().select(param));
40+
if (total == 0) {
41+
pagerResult.setData(new ArrayList<>());
42+
} else {
43+
//根据实际记录数量重新指定分页参数
44+
param.rePaging(total);
45+
pagerResult.setData(getMapper().select(param));
46+
}
4347
return pagerResult;
4448
}
4549

hsweb-web-service/hsweb-web-service-simple/src/main/java/org/hsweb/web/service/impl/form/DynamicFormServiceImpl.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,13 @@ public <T> PagerResult<T> selectPager(String name, QueryParam param) throws SQLE
165165
query.setParam(param);
166166
int total = query.total();
167167
result.setTotal(total);
168-
param.rePaging(total);
169-
result.setData(query.list(param.getPageIndex(), param.getPageSize()));
168+
if (total == 0) {
169+
result.setData(new ArrayList<>());
170+
} else {
171+
//根据实际记录数量重新指定分页参数
172+
param.rePaging(total);
173+
result.setData(query.list(param.getPageIndex(), param.getPageSize()));
174+
}
170175
return result;
171176
}
172177

0 commit comments

Comments
 (0)