packagecom.paic.bics.core.mybatis.page;importjava.util.List;
@SuppressWarnings("serial")public class Pagination extends SimplePage implementsjava.io.Serializable,
Paginable {/*** 当前页的数据*/
private Listlist;publicPagination() {
}public Pagination(int pageNo, int pageSize, inttotalCount) {super(pageNo, pageSize, totalCount);
}
@SuppressWarnings("unchecked")public Pagination(int pageNo, int pageSize, inttotalCount, List list) {super(pageNo, pageSize, totalCount);this.list =list;
}public intgetFirstResult() {return (pageNo - 1) *pageSize;
}public ListgetList() {returnlist;
}public void setList(Listlist) {this.list =list;
}/**paic.bics SEO 翻页版本*/
publicString getWebPage(String page){
StringBuffer pageHtml= new StringBuffer("
- ");if(this.getPageNo()>1){if(this.getPageNo()>5){
pageHtml.append("
首页");}
pageHtml.append("
上一页");}for (int i = (this.getPageNo()-2<=0?1:this.getPageNo()-2),no = 1; i <= this.getTotalPage()&& no <6 ; i++,no++) {if (this.getPageNo() ==i) {
pageHtml.append("
"+i+"");}else{
pageHtml.append("
"+i+"");}
}if(this.getPageNo() < this.getTotalPage()){
pageHtml.append("
下一页");}
pageHtml.append("
");returnpageHtml.toString();}/**Ajxa翻页*/
publicString getSiAjaxPageHtml(){
StringBuffer pageHtml= new StringBuffer("
- ");if(this.getPageNo()>1){if(this.getPageNo()>5){
pageHtml.append("
首页");}
pageHtml.append("
上一页");}for (int i = (this.getPageNo()-2<=0?1:this.getPageNo()-2),no = 1; i <= this.getTotalPage()&& no <6 ; i++,no++) {if (this.getPageNo() ==i) {
pageHtml.append("
"+i+"");}else{
pageHtml.append("
"+i+"");}
}if(this.getPageNo() < this.getTotalPage()){
pageHtml.append("
下一页");}
pageHtml.append("
");returnpageHtml.toString();}/**普通翻页*/
publicString getPageHtml(){
StringBuffer pageHtml= new StringBuffer("
- ");if(this.getPageNo()>1){if(this.getPageNo()>5){
pageHtml.append("
首页");}
pageHtml.append("
上一页");}for (int i = (this.getPageNo()-2<=0?1:this.getPageNo()-2),no = 1; i <= this.getTotalPage()&& no <6 ; i++,no++) {if (this.getPageNo() ==i) {
pageHtml.append("
"+i+"");}else{
pageHtml.append("
"+i+"");}
}if(this.getPageNo() < this.getTotalPage()){
pageHtml.append("
下一页");}
pageHtml.append("
");pageHtml.append("
pageHtml.append(" function _submitform(pageNo){");
pageHtml.append(" $(\"#formId\").append($(\"\")).submit();");
pageHtml.append(" }");
pageHtml.append("");returnpageHtml.toString();
}
}