package com.zhangmeng.model.dto.query;

import lombok.Data;
import tk.mybatis.mapper.entity.Condition;

import java.io.Serializable;

@Data
public class QueryParams implements Serializable {

    private Integer pageNum;

    private Integer pageSize;

    private Condition condition;

    private String orderBy;

    public QueryParams(){

    }

    /**
     *
     * @param pageNum 当前页
     * @param pageSize 每页记录数
     * @param orderBy 排序
     */
    public QueryParams(Integer pageNum, Integer pageSize, String orderBy) {
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.orderBy = orderBy;
    }

    public QueryParams(Condition condition) {
        this.condition = condition;
    }

    /**
     *
     * @param pageNum 当前页
     * @param pageSize 每页记录数
     * @param condition 查询条件
     */
    public QueryParams(Integer pageNum, Integer pageSize, Condition condition) {
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.condition = condition;
    }

    /**
     *
     * @param pageNum 当前页
     * @param pageSize 每页记录数
     * @param condition 查询条件
     * @param orderBy 排序
     */
    public QueryParams(Integer pageNum, Integer pageSize, Condition condition, String orderBy) {
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.condition = condition;
        this.orderBy = orderBy;
    }
}
