//手动进行分页
returnList-总数据
arrayList-本页数据
page-第几页
rows-每页数量
List<AttenceLeaveReturnShow> arrayList = new ArrayList<AttenceLeaveReturnShow>();
if(returnList.size()<=Integer.parseInt(rows)){
page2.setRows(returnList);
page2.setPageNo(Integer.valueOf(page));
page2.setPageSize(Integer.valueOf(rows));
page2.setTotal(returnList.size());
}else{
//起始页码
int start=(Integer.parseInt(page)-1)*(Integer.parseInt(rows));
if(start+Integer.parseInt(rows)-1<returnList.size()-1){
for(int i=start;i<start+Integer.parseInt(rows);i++){
arrayList.add(returnList.get(i));
page2.setRows(arrayList);
page2.setPageNo(Integer.valueOf(page));
page2.setPageSize(Integer.valueOf(rows));
page2.setTotal(returnList.size());
}
}else{
for(int i=start;i<returnList.size();i++){
arrayList.add(returnList.get(i));
page2.setRows(arrayList);
page2.setPageNo(Integer.valueOf(page));
page2.setPageSize(Integer.valueOf(rows));
page2.setTotal(returnList.size());
}
}
}