查询一个list,看sql打印自动加上了limit,其实是不需要分页的,怎么回事儿?
- 原因是你在查询
lis
t前,设置了PageHelper
,你可能是为了其他分页查询设置的,但mybatis
会自动拦截,把查询都加上,所以需要把PageHelper
放在你的list
后面
List<String> flowIdList = evaDeptPeriodBaseReadMapper.selectEvaLastFlowIdByTime(query.getStartTime(),query.getEnd2Time());
if (flowIdList != null && flowIdList.size() > 0){
query.setFlowIdList(flowIdList);
}
PageHelper.startPage(query.getPage(), query.getRows());
page = evaDeptPeriodBaseReadMapper.findDeptEfficiencyByColumn(query);
if (null != page && null != page.getResult() && !page.getResult().isEmpty()){
page.getResult().forEach(a -> a.setCurTacheName(
getCurTacheName(a.getEvtId())
));
}