public class History {
// DB 매핑
private final
Etc_SQLMapping mp = new Etc_SQLMapping();
// 목록
private
ArrayList<History_VO> logList;
// 페이징처리
private final int
recordCount=20; //한
화면에 보여질 레코드 갯수
private int currentPage;
//현 페이지 넘버
private int
totalCount;//전체
레코드 갯수
private int
pageCount;//넘버링
되어질 페이지넘버
private int i;
private int CountNum;
private List<Integer>
pageList; // jsp에서
출력된 페이지 번호 목록
private Boolean
historyList() throws SQLException {
String eDate =
this.eDate;
if(eDate != null) {
if(eDate.length() >
0 )
eDate =
DateChange.date2tomorrow(eDate);
}
Map paramMap = new
HashMap();
paramMap.put("hType",
"인사");
paramMap.put("sDate",
"2011-06-01");
paramMap.put("eDate",
"2011-07-01");
paramMap.put("currentPage",
getCurrentPage());
/***전체
레코드 갯수***/
totalCount =
mp.selectLogListCount(paramMap);
/***totalCount나누기(페이지
넘버링 만들기)***/
pageCount =
totalCount/recordCount;
/***만약
이라면 잔여물의 나머지가 있다면..
올림을 해준다***/
if(totalCount%recordCount>0)
pageCount++;
/***기준페이지번호
구하기***/
int start =
(currentPage-1)*recordCount;
mp.selectLogList(paramMap,
start, recordCount);
logList =
log.getLogList();
CountNum=logList.size();
if(CountNum > 0){
pageList = new
ArrayList<Integer>();
for(i=1; i<=pageCount;
i++)
pageList.add(i);
}
return true;
}
}
|