fix : 수정 중

main
이범준 2 years ago
parent 614e2d67b4
commit 82ff3d23a5

@ -14,8 +14,8 @@ public class MybatisUtils{
if(Checks.isEmpty(map)){ if(Checks.isEmpty(map)){
return new PageBounds(1, 10); return new PageBounds(1, 10);
} }
int page = Checks.isEmpty(map.get("page")) || Integer.parseInt(String.valueOf(map.get("page"))) < 0? 1: Integer.parseInt(String.valueOf(map.get("page"))); int page = Checks.isEmpty(map.get("pageNum")) || Integer.parseInt(String.valueOf(map.get("pageNum"))) < 0? 1: Integer.parseInt(String.valueOf(map.get("pageNum")));
int limit = Checks.isEmpty(map.get("perPage")) || Integer.parseInt(String.valueOf(map.get("perPage"))) < 0? 20: Integer.parseInt(String.valueOf(map.get("perPage"))); int limit = Checks.isEmpty(map.get("fetchSize")) || Integer.parseInt(String.valueOf(map.get("fetchSize"))) < 0? 20: Integer.parseInt(String.valueOf(map.get("fetchSize")));
// 정렬필드명.direction,정렬필드명.direction,... 형태(정렬필드,정렬필드.desc) // 정렬필드명.direction,정렬필드명.direction,... 형태(정렬필드,정렬필드.desc)
String sort = Checks.isEmpty(map.get("sidx"))? "": String.valueOf(map.get("sidx")); String sort = Checks.isEmpty(map.get("sidx"))? "": String.valueOf(map.get("sidx"));
return new PageBounds(page, limit , Order.formString(sort)); return new PageBounds(page, limit , Order.formString(sort));
@ -53,25 +53,9 @@ public class MybatisUtils{
return new PageBounds(pageNum, limit); return new PageBounds(pageNum, limit);
} }
// public static RowBounds getPagingInfo(PagableVo bean){
// if(bean == null){
// return new PageBounds(1, 10 , Order.formString(""));
// }
// int page = Checks.isEmpty(bean.getPage()) ? 1: Integer.parseInt(bean.getPage());
// int limit = Checks.isEmpty(bean.getPerPage())? 20: Integer.parseInt(String.valueOf(bean.getPerPage()));
// String sort = Checks.isEmpty(bean.getSidx())? "": String.valueOf(bean.getSidx());
// return new PageBounds(page, limit , Order.formString(sort));
// }
public static RowBounds getPagingInfo(int pageNum, int row, String sort){ public static RowBounds getPagingInfo(int pageNum, int row, String sort){
return new PageBounds(pageNum, row, Order.formString(sort)); return new PageBounds(pageNum, row, Order.formString(sort));
} }
// public static interface PagableVo {
// public String getPage();
// public String getPerPage();
// public String getSidx();
// }
} }

Loading…
Cancel
Save