package com.engine.organization.wrapper;

import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.organization.entity.scheme.param.GradeSearchParam;
import com.engine.organization.service.GradeService;
import com.engine.organization.service.impl.GradeServiceImpl;
import org.apache.ibatis.annotations.Param;
import weaver.hrm.User;

import java.util.Collection;
import java.util.Map;

/**
 * @description:
 * @author:dxfeng
 * @createTime: 2022/05/11
 * @version: 1.0
 */
public class GradeWrapper extends Service {
    private GradeService getGradeService(User user) {
        return ServiceUtil.getService(GradeServiceImpl.class, user);
    }

    /**
     * 职级列表
     *
     * @param params
     * @return
     */
    public Map<String, Object> listPage(Map<String, Object> params) {
        return getGradeService(user).listPage(params);
    }

    /**
     * 新增职级
     *
     * @param param
     * @return
     */
    public int saveGrade(GradeSearchParam param) {
        return getGradeService(user).saveGrade(param);
    }

    /**
     * 更新职级
     *
     * @param param
     * @return
     */
    public int updateGrade(GradeSearchParam param) {
        return getGradeService(user).updateGrade(param);
    }

    /**
     * 更新禁用标记
     *
     * @param params
     */
    public int updateForbiddenTagById(GradeSearchParam params) {
        return getGradeService(user).updateForbiddenTagById(params);
    }

    /**
     * 根据ID批量删除
     *
     * @param ids
     */
    public int deleteByIds(@Param("ids") Collection<Long> ids) {
        return getGradeService(user).deleteByIds(ids);
    }

    /**
     * 获取搜索条件
     *
     * @param params
     * @return
     */
    public Map<String, Object> getSearchCondition(Map<String, Object> params) {
        return getGradeService(user).getSearchCondition(params);
    }


    /**
     * 获取新增表单
     *
     * @param params
     * @return
     */
    public Map<String, Object> getGradeForm(Map<String, Object> params) {
        return getGradeService(user).getGradeForm(params);
    }

    /**
     * 获取列表页面按钮信息
     *
     * @return
     */
    public Map<String, Object> getHasRight() {
        return getGradeService(user).getHasRight();
    }

    /**
     * 获取列表tabs
     *
     * @return
     */
    public Map<String, Object> getTabInfo() {
        return getGradeService(user).getTabInfo();
    }
}
