package com.purui.prims.dscheduler.utils;

import java.util.HashMap;
import java.util.Map;

public class ParamUtil {

    /**
     * 封装分页查询
     *
     * @return {@link Map}
     */
    public static Map<String, Object> getPageParams() {
        return getPageParams(1, Integer.MAX_VALUE);
    }

    public static Map<String, Object> getPageParams(int page, int size) {
        Map<String, Object> params = new HashMap<>();
        params.put("pageNo", page);
        params.put("pageSize", size);
        return params;
    }

    /**
     * 封装分页查询
     *
     * @param name 查询条件
     * @return {@link Map}
     */
    public static Map<String, Object> getPageParams(String name) {
        Map<String, Object> params = getPageParams();
        params.put("searchVal", name);
        return params;
    }

    public static Map<String, Object> getPageParams(String name, int page, int size) {
        Map<String, Object> params = getPageParams(page, size);
        params.put("searchVal", name);
        return params;
    }
}
