分页插件IPage

控制层Controller

@ApiOperation("分页查询gps设备历史上传记录信息")
@ApiImplicitParams({
            @ApiImplicitParam(name="pageNo",value="当前页",dataType="int", paramType = "query"),
            @ApiImplicitParam(name="pageSize",value="分页大小",dataType="int", paramType = "query"),
            @ApiImplicitParam(name="placeName",value="工棚名称",dataType="String", paramType = "query")})
    @PostMapping("/findGpsRecordPage")
    public RestResponceBody findGpsRecordPage(@RequestParam(defaultValue = "1") int pageNo, @RequestParam(defaultValue = "15")  int pageSize, @RequestParam(required = false) String placeName){
        // 结论就是当你的参数中加了  new Page 之后,他会自动对你这个方法分页很强大的呀
        IPage gpsEntityIPage = gpsRecordService.findPage(new Page(pageNo, pageSize).addOrder(OrderItem.desc("a.create_time")),placeName);
        return new RestResponceBody(gpsEntityIPage) ;
    }

接口层IService

IPage findPage(Page page, String placeName);

服务层Service

 @Override
 public IPage findPage(Page page, String placeName) {
        return gpsRecordMapper.findPage(page,placeName);
    }

数据持久层Dao层

IPage findPage(Page page, @Param("placeName") String placeName);

XML文件

    
    

你可能感兴趣的:(分页插件IPage)