fo bo 머지작업
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
package com.wb.domainserver.common.ui;
|
||||
package com.wb.domainserver.common.mvc.tags.ui;
|
||||
|
||||
import com.wb.domainserver.common.ui.pagination.*;
|
||||
import com.wb.domainserver.common.ui.pagination.DefaultPaginationManager;
|
||||
import com.wb.domainserver.common.ui.pagination.DefaultPaginationRenderer;
|
||||
import com.wb.domainserver.common.ui.pagination.PaginationManager;
|
||||
import com.wb.domainserver.common.ui.pagination.PaginationRenderer;
|
||||
import com.wb.domainserver.common.mvc.tags.ui.pagination.*;
|
||||
import com.wb.domainserver.common.mvc.tags.ui.pagination.DefaultPaginationManager;
|
||||
import com.wb.domainserver.common.mvc.tags.ui.pagination.DefaultPaginationRenderer;
|
||||
import com.wb.domainserver.common.mvc.tags.ui.pagination.PaginationManager;
|
||||
import com.wb.domainserver.common.mvc.tags.ui.pagination.PaginationRenderer;
|
||||
import com.wb.domainserver.util.string.StringUtil;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.jsp.JspException;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.wb.domainserver.common.ui.pagination;
|
||||
package com.wb.domainserver.common.mvc.tags.ui.pagination;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.wb.domainserver.common.ui.pagination;
|
||||
package com.wb.domainserver.common.mvc.tags.ui.pagination;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.wb.domainserver.common.ui.pagination;
|
||||
package com.wb.domainserver.common.mvc.tags.ui.pagination;
|
||||
|
||||
/**
|
||||
* 페이징 리스트의 기본적인 포맷을 제공한다.
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.wb.domainserver.common.ui.pagination;
|
||||
package com.wb.domainserver.common.mvc.tags.ui.pagination;
|
||||
|
||||
import jakarta.servlet.ServletContext;
|
||||
import org.springframework.web.context.ServletContextAware;
|
||||
@@ -1,12 +1,10 @@
|
||||
package com.wb.domainserver.common.mvc.tags.ui.pagination;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 페이징 처리를 위한 데이터 처리용 Bean
|
||||
*
|
||||
*
|
||||
* @author 박철민
|
||||
* @since 2023-11-22
|
||||
* @version 1.0
|
||||
@@ -21,8 +19,7 @@ import java.math.RoundingMode;
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class PaginationInfo implements Serializable{
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class PaginationInfo {
|
||||
/** 현재 페이지 번호. */
|
||||
private int currentPageNo;
|
||||
/** 한 페이지당 게시되는 게시물 건 수 */
|
||||
@@ -32,6 +29,8 @@ public class PaginationInfo implements Serializable{
|
||||
/** 페이지 리스트에 게시되는 페이지 건수 */
|
||||
private int totalRecordCount;
|
||||
|
||||
private Integer[] pageUnitArr = {10, 50, 100, 200};
|
||||
|
||||
public int getRecordCountPerPage() {
|
||||
return recordCountPerPage;
|
||||
}
|
||||
@@ -76,11 +75,8 @@ public class PaginationInfo implements Serializable{
|
||||
private int lastRecordIndex;
|
||||
|
||||
public int getTotalPageCount() {
|
||||
BigDecimal totalRecordCount = new BigDecimal(getTotalRecordCount());
|
||||
BigDecimal recordCountPerPage = new BigDecimal(getRecordCountPerPage());
|
||||
|
||||
BigDecimal totalPageCount = totalRecordCount.divide(recordCountPerPage, RoundingMode.CEILING);
|
||||
return totalPageCount.intValue();
|
||||
totalPageCount = ((getTotalRecordCount() - 1) / getRecordCountPerPage()) + 1;
|
||||
return totalPageCount;
|
||||
}
|
||||
|
||||
public int getFirstPageNo() {
|
||||
@@ -113,4 +109,12 @@ public class PaginationInfo implements Serializable{
|
||||
lastRecordIndex = getCurrentPageNo() * getRecordCountPerPage();
|
||||
return lastRecordIndex;
|
||||
}
|
||||
|
||||
public Integer[] getPageUnitArr() {
|
||||
return pageUnitArr.clone();
|
||||
}
|
||||
|
||||
public void setPageUnitArr(Integer[] pageUnitArr) {
|
||||
this.pageUnitArr = Arrays.copyOf(pageUnitArr, pageUnitArr.length);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.wb.domainserver.common.ui.pagination;
|
||||
package com.wb.domainserver.common.mvc.tags.ui.pagination;
|
||||
|
||||
/**
|
||||
* PaginationRenderer의 구현체를 빈설정 파일을 참조하여 반환한다.
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.wb.domainserver.common.ui.pagination;
|
||||
package com.wb.domainserver.common.mvc.tags.ui.pagination;
|
||||
|
||||
/**
|
||||
* PaginationRenderer의 interface
|
||||
@@ -1,120 +0,0 @@
|
||||
package com.wb.domainserver.common.ui.pagination;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 페이징 처리를 위한 데이터 처리용 Bean
|
||||
*
|
||||
* @author 박철민
|
||||
* @since 2023-11-22
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* == (Modification Information) == 개정이력
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2023-11-22 박철민 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class PaginationInfo {
|
||||
/** 현재 페이지 번호. */
|
||||
private int currentPageNo;
|
||||
/** 한 페이지당 게시되는 게시물 건 수 */
|
||||
private int recordCountPerPage;
|
||||
/** 한 페이지당 게시되는 게시물 건 수 */
|
||||
private int pageSize;
|
||||
/** 페이지 리스트에 게시되는 페이지 건수 */
|
||||
private int totalRecordCount;
|
||||
|
||||
private Integer[] pageUnitArr = {10, 50, 100, 200};
|
||||
|
||||
public int getRecordCountPerPage() {
|
||||
return recordCountPerPage;
|
||||
}
|
||||
|
||||
public void setRecordCountPerPage(int recordCountPerPage) {
|
||||
this.recordCountPerPage = recordCountPerPage;
|
||||
}
|
||||
|
||||
public int getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(int pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public int getCurrentPageNo() {
|
||||
return currentPageNo;
|
||||
}
|
||||
|
||||
public void setCurrentPageNo(int currentPageNo) {
|
||||
this.currentPageNo = currentPageNo;
|
||||
}
|
||||
|
||||
public void setTotalRecordCount(int totalRecordCount) {
|
||||
this.totalRecordCount = totalRecordCount;
|
||||
}
|
||||
|
||||
public int getTotalRecordCount() {
|
||||
return totalRecordCount;
|
||||
}
|
||||
|
||||
/** 페이지 개수 */
|
||||
private int totalPageCount;
|
||||
/** 페이지 리스트의 첫 페이지 번호 */
|
||||
private int firstPageNoOnPageList;
|
||||
/** 페이지 리스트의 마지막 페이지 번호 */
|
||||
private int lastPageNoOnPageList;
|
||||
/** 페이징 SQL의 조건절에 사용되는 시작 rownum */
|
||||
private int firstRecordIndex;
|
||||
/** 페이징 SQL의 조건절에 사용되는 마지막 rownum */
|
||||
private int lastRecordIndex;
|
||||
|
||||
public int getTotalPageCount() {
|
||||
totalPageCount = ((getTotalRecordCount() - 1) / getRecordCountPerPage()) + 1;
|
||||
return totalPageCount;
|
||||
}
|
||||
|
||||
public int getFirstPageNo() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public int getLastPageNo() {
|
||||
return getTotalPageCount();
|
||||
}
|
||||
|
||||
public int getFirstPageNoOnPageList() {
|
||||
firstPageNoOnPageList = ((getCurrentPageNo() - 1) / getPageSize()) * getPageSize() + 1;
|
||||
return firstPageNoOnPageList;
|
||||
}
|
||||
|
||||
public int getLastPageNoOnPageList() {
|
||||
lastPageNoOnPageList = getFirstPageNoOnPageList() + getPageSize() - 1;
|
||||
if (lastPageNoOnPageList > getTotalPageCount()) {
|
||||
lastPageNoOnPageList = getTotalPageCount();
|
||||
}
|
||||
return lastPageNoOnPageList;
|
||||
}
|
||||
|
||||
public int getFirstRecordIndex() {
|
||||
firstRecordIndex = (getCurrentPageNo() - 1) * getRecordCountPerPage();
|
||||
return firstRecordIndex;
|
||||
}
|
||||
|
||||
public int getLastRecordIndex() {
|
||||
lastRecordIndex = getCurrentPageNo() * getRecordCountPerPage();
|
||||
return lastRecordIndex;
|
||||
}
|
||||
|
||||
public Integer[] getPageUnitArr() {
|
||||
return pageUnitArr.clone();
|
||||
}
|
||||
|
||||
public void setPageUnitArr(Integer[] pageUnitArr) {
|
||||
this.pageUnitArr = Arrays.copyOf(pageUnitArr, pageUnitArr.length);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user