package com.fs.company.service.impl;

import com.fs.company.domain.CompanyUserPost;
import com.fs.company.mapper.CompanyUserPostMapper;
import com.fs.company.service.ICompanyUserPostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户与岗位关联Service业务层处理
 *
 * @author fs
 * @date 2021-05-25
 */
@Service
public class CompanyUserPostServiceImpl implements ICompanyUserPostService
{
    @Autowired
    private CompanyUserPostMapper companyUserPostMapper;

    /**
     * 查询用户与岗位关联
     *
     * @param userId 用户与岗位关联ID
     * @return 用户与岗位关联
     */
    @Override
    public CompanyUserPost selectCompanyUserPostById(Long userId)
    {
        return companyUserPostMapper.selectCompanyUserPostById(userId);
    }

    /**
     * 查询用户与岗位关联列表
     *
     * @param companyUserPost 用户与岗位关联
     * @return 用户与岗位关联
     */
    @Override
    public List<CompanyUserPost> selectCompanyUserPostList(CompanyUserPost companyUserPost)
    {
        return companyUserPostMapper.selectCompanyUserPostList(companyUserPost);
    }

    /**
     * 新增用户与岗位关联
     *
     * @param companyUserPost 用户与岗位关联
     * @return 结果
     */
    @Override
    public int insertCompanyUserPost(CompanyUserPost companyUserPost)
    {
        return companyUserPostMapper.insertCompanyUserPost(companyUserPost);
    }

    /**
     * 修改用户与岗位关联
     *
     * @param companyUserPost 用户与岗位关联
     * @return 结果
     */
    @Override
    public int updateCompanyUserPost(CompanyUserPost companyUserPost)
    {
        return companyUserPostMapper.updateCompanyUserPost(companyUserPost);
    }

    /**
     * 批量删除用户与岗位关联
     *
     * @param userIds 需要删除的用户与岗位关联ID
     * @return 结果
     */
    @Override
    public int deleteCompanyUserPostByIds(Long[] userIds)
    {
        return companyUserPostMapper.deleteCompanyUserPostByIds(userIds);
    }

    /**
     * 删除用户与岗位关联信息
     *
     * @param userId 用户与岗位关联ID
     * @return 结果
     */
    @Override
    public int deleteCompanyUserPostById(Long userId)
    {
        return companyUserPostMapper.deleteCompanyUserPostById(userId);
    }

    @Override
    public void batchInsertCompanyUserPost(List<CompanyUserPost> companyUserPosts) {
        companyUserPostMapper.batchUserPost(companyUserPosts);
    }
}
