package com.engine.organization.wrapper;

import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.organization.entity.TreeData;
import com.engine.organization.entity.scheme.param.LevelSearchParam;
import com.engine.organization.service.LevelService;
import com.engine.organization.service.impl.LevelServiceImpl;
import org.apache.ibatis.annotations.Param;
import weaver.hrm.User;

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

/**
 * @description:
 * @author:dxfeng
 * @createTime: 2022/05/10
 * @version: 1.0
 */
public class LevelWrapper extends Service {
    private LevelService getLevelService(User user) {
        return ServiceUtil.getService(LevelServiceImpl.class, user);
    }

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

    /**
     * 新增职等
     *
     * @param param
     * @return
     */
    public int saveLevel(LevelSearchParam param) {
        return getLevelService(user).saveLevel(param);
    }

    /**
     * 更新职等
     *
     * @param param
     * @return
     */
    public int updateLevel(LevelSearchParam param) {
        return getLevelService(user).updateLevel(param);
    }

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

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

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


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

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

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

    public TreeData getTreeData() {
        return getLevelService(user).getTreeData();
    }
}
