package com.dgtis.dorm.manager.db.param;


import org.springframework.util.StringUtils;

import java.util.List;

/**
 * 办理事项查询参数
 *
 * @author huanghaoqi
 * @version 1.0
 * @date 2018年09月27日 14:53:49
 * @since JDK1.8
 */
public class ItemsQueryParam {
    /**
     * 事项名称
     */
    private String name;
    /**
     * 父级ID
     */
    private Integer parentId;
    /**
     * 等级
     */
    private Integer level;

    /**
     * 页码
     */
    private Integer page;
    /**
     * 每页显示个数
     */
    private Integer limit;
    /**
     * 排序字段
     */
    private String sort;
    /**
     * 升序或降序
     */
    private String order;
    /**
     * 登录人ID
     */
    private Integer adminId;

    /**
     * 开始的索引
     */
    private Integer offset;
    /**
     * id
     */
    private Integer id;

    private List<String> fileIds;
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public Integer getPage() {
        return page;
    }

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

    public Integer getLimit() {
        return limit;
    }

    public void setLimit(Integer limit) {
        this.limit = limit;
    }

    public String getSort() {
        return sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }

    public String getOrder() {
        return order;
    }

    public void setOrder(String order) {
        this.order = order;
    }

    public Integer getAdminId() {
        return adminId;
    }

    public void setAdminId(Integer adminId) {
        this.adminId = adminId;
    }

    public Integer getOffset() {
        if (page != null && limit != null) {
            return (page - 1) * limit;
        }
        return offset;
    }

    public void setOffset(Integer offset) {
        this.offset = offset;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public List<String> getFileIds() {
        return fileIds;
    }

    public void setFileIds(List<String> fileIds) {
        this.fileIds = fileIds;
    }
}
