package com.engine.organization.wrapper;

import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.organization.entity.postion.param.PostInfoSearchParam;
import com.engine.organization.service.PostInfoService;
import com.engine.organization.service.impl.PostInfoServiceImpl;
import org.apache.ibatis.annotations.Param;
import weaver.hrm.User;

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

/**
 * @description:
 * @author:dxfeng
 * @createTime: 2022/05/13
 * @version: 1.0
 */
public class PostInfoWrapper extends Service {
    private PostInfoService getPostInfoService(User user) {
        return ServiceUtil.getService(PostInfoServiceImpl.class, user);
    }

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

    /**
     * 新增职务信息
     *
     * @param param
     * @return
     */
    public int savePostInfo(PostInfoSearchParam param) {
        return getPostInfoService(user).savePostInfo(param);
    }

    /**
     * 更新职务信息
     *
     * @param param
     * @return
     */
    public int updatePostInfo(PostInfoSearchParam param) {
        return getPostInfoService(user).updatePostInfo(param);
    }

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

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

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


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

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

}
