Commit b19bb116 by 吴佳

dbReadset 单表查询 分页总条数调整

parent d2e08146
...@@ -354,9 +354,7 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession ...@@ -354,9 +354,7 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
for (IModuleList iModule : lists) { for (IModuleList iModule : lists) {
List<T> result = this.dyncRead(iModule.getDataClass(), adapter); List<T> result = this.dyncRead(iModule.getDataClass(), adapter);
iModule.addAll(result); iModule.addAll(result);
PageInfo<T> pageInfo = new PageInfo<T>(result);
long total = pageInfo.getTotal();
baseVO.setTotal(total);
} }
} }
if (cacheOption != null) { if (cacheOption != null) {
...@@ -583,9 +581,13 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession ...@@ -583,9 +581,13 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
} }
private <T> List<T> dyncRead(Class<T> clazz, MybatisArgumentAdapter adapter) { private <T> List<T> dyncRead(Class<T> clazz, MybatisArgumentAdapter adapter) {
IContext ctx = MdaEnv.getContext();
BaseVO baseVO = ctx.getVo();
String sqlId = getSqlId(clazz, SQLID_DYNCREAD); String sqlId = getSqlId(clazz, SQLID_DYNCREAD);
List<T> list = sqlSessionTemplate.selectList(sqlId, adapter.getSqlParams()); List<T> list = sqlSessionTemplate.selectList(sqlId, adapter.getSqlParams());
PageInfo<T> pageInfo = new PageInfo<T>(list);
long total = pageInfo.getTotal();
baseVO.setTotal(total);
if (list == null || list.size() == 0) { if (list == null || list.size() == 0) {
setNoMoreRow(); setNoMoreRow();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment