All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.zys.mybatis.page.BasePage Maven / Gradle / Ivy

There is a newer version: 0.2.7
Show newest version
package com.zys.mybatis.page;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.zys.mybatis.annotation.Ignore;

/**
 * @author zys
 * @version 1.0
 * @date 2020/8/20 15:39
 */
public class BasePage {

    /**
     * 当前页数.
     */
    @Ignore
    private int page = 1;

    public int getPage(){
        return page;
    }

    public BasePage(){}

    public BasePage(int page,int pageSize){
        this.page = page;
        this.pageSize = pageSize;
    }

    @JsonIgnore
    public int getIndex(){
        if(page == 0){
            return 0;
        }
        return (page - 1) * pageSize;
    }

    /**
     * 每页条数.
     */
    @Ignore
    private int pageSize = 10;

    public void setPage(int page){
        this.page = page;
    }

    public int getPageSize(){
        return pageSize;
    }

    public void setPageSize(int pageSize){
        this.pageSize = pageSize;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy