package org.springblade.thirdparty.mk.pojo.dto.approval;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.springblade.thirdparty.mk.pojo.dto.sort.ISort;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 *  mk审批中心查询参数
 * @author bfhuange
 * @since 2025/4/2
 */
@Data
public class MKApprovalDTO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    /**
     *  查询条件
     */
    private MKApprovalConditionDTO conditions;
    /**
     *  登录名
     */
    private String loginName;
    /**
     *  获取内容
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Boolean content;
    /**
     *  获取条目数
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Boolean count;
    /**
     *  获取总数时最大条目数
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Integer maxCount;
    /**
     *  从第?条开始查询，起始值为0
     */
    private Integer offset;
    /**
     *  第？页
     */
    private Integer pageNo;
    /**
     *  每页?条
     */
    private Integer pageSize;
    /**
     *  排序列
     */
    private ISort sorts;
    /**
     *  返回列
     */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<String> columns;

    public void setPage(Integer pageNo, Integer pageSize) {
        this.pageNo = pageNo;
        this.pageSize = pageSize;
        this.offset = (this.pageNo -1) * this.pageSize;
    }
}
