package com.engine.organization.wrapper;

import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.organization.entity.sequence.param.SequenceSearchParam;
import com.engine.organization.service.SequenceService;
import com.engine.organization.service.impl.SequenceServiceImpl;
import org.apache.ibatis.annotations.Param;
import weaver.hrm.User;

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

/**
 * @description:
 * @author:dxfeng
 * @createTime: 2022/05/12
 * @version: 1.0
 */
public class SequenceWrapper extends Service {
    private SequenceService getSequenceService(User user) {
        return ServiceUtil.getService(SequenceServiceImpl.class, user);
    }

    /**
     * 岗位列表
     *
     * @param params
     * @return
     */
    public Map<String, Object> listPage(Map<String, Object> params) {
        return getSequenceService(user).listPage(params);
    }

    /**
     * 新增岗位
     *
     * @param param
     * @return
     */
    public int saveSequence(SequenceSearchParam param) {
        return getSequenceService(user).saveSequence(param);
    }

    /**
     * 更新岗位
     *
     * @param param
     * @return
     */
    public int updateSequence(SequenceSearchParam param) {
        return getSequenceService(user).updateSequence(param);
    }

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

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

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


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

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

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