Mybatis自动分页

import com.github.pagehelper.Page;


@Controller

@RequestMapping(value="findArticles",method=RequestMethod.POST)
@ResponseBody
    public List

findArticles(@RequestParam(value="columnId")Long columnId,@RequestParam(value = "page", defaultValue = "1") int pageNumber,

    @RequestParam(value = "page.size", defaultValue = "5") int pageSize, @RequestParam(value = "text", defaultValue = "")String title){

Page page = new Page();

page.setPageNum(pageNumber);

page.setPageSize(pageSize);

}



import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

@Service

if(page!=null){
PageHelper.startPage(page.getPageNum(), page.getPageSize());
}



你可能感兴趣的:(java,mybaits)