时间:2021-07-01 10:21:17 帮助过:122人阅读
@Override public List<Loc> findAllLoc(Loc loc) { try { HashMap<String,Object> map = new HashMap<String,Object>(); List<String> schemas = this.locMapper.findAllSchema(loc);//查询所有的schema map.put("schemas", schemas); map.put("loc", loc); return this.locMapper.findAllLoc(map); } catch (Exception e) { e.printStackTrace(); return new ArrayList<>(); } }
//分页异常的代码的LocController中代码
@RequestMapping("loc/list")
@ResponseBody
public Map<String, Object> locList(QueryRequest request, Loc loc) {
PageHelper.startPage(request.getPageNum(), request.getPageSize());
List<Loc> list = this.locService.findAllLoc(loc);//具体实现在第一段代码。系统认为findAllSchema(loc)是第一条语句。PageHelper只对紧跟着的第一条SQL起作用
// HashMap<String,Object> map = new HashMap<String,Object>();
// List<String> schemas = this.locMapper.findAllSchema(loc);// map.put("schemas", schemas);
// map.put("loc", loc);
//
// PageHelper.startPage(request.getPageNum(), request.getPageSize());
// List<Loc> list = this.locMapper.findAllLoc(map);
PageInfo<Loc> pageInfo = new PageInfo<>(list);
return getDataTable(pageInfo);
}
//yml配置
#pagehelper
pagehelper:
helperDialect: oracle
reasonable: false//这个熟悉需要改成false
supportMethodsArguments: true
params: count=countSql
//分页正常的LocController中代码,拆分开,然后把PageHelper放在需要分页的SQL之前,就正常了。
@RequestMapping("loc/list")
@ResponseBody
public Map<String, Object> locList(QueryRequest request, Loc loc) {
// PageHelper.startPage(request.getPageNum(), request.getPageSize());
// List<Loc> list = this.locService.findAllLoc(loc);
HashMap<String,Object> map = new HashMap<String,Object>();
List<String> schemas = this.locMapper.findAllSchema(loc);
map.put("schemas", schemas);
map.put("loc", loc);
PageHelper.startPage(request.getPageNum(), request.getPageSize());//PageHelper只对紧跟着的第一条SQL起作用
List<Loc> list = this.locMapper.findAllLoc(map);//这条语句被视为紧跟着的第一条语句
PageInfo<Loc> pageInfo = new PageInfo<>(list);
return getDataTable(pageInfo);
}
PageHelper只对紧跟着的第一条SQL起作用
标签:schema 作用 ice 结果 union all dial str cse rtm