package com.ruoyi.sy.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sy.mapper.SyVocationalPostMapper;
import com.ruoyi.sy.domain.SyVocationalPost;
import com.ruoyi.sy.service.ISyVocationalPostService;

/**
 * 就业岗位Service业务层处理
 * 
 * @author mingxue
 * @date 2022-03-30
 */
@Service
public class SyVocationalPostServiceImpl implements ISyVocationalPostService 
{
    @Autowired
    private SyVocationalPostMapper syVocationalPostMapper;

    /**
     * 查询就业岗位
     * 
     * @param id 就业岗位ID
     * @return 就业岗位
     */
    @Override
    public SyVocationalPost selectSyVocationalPostById(Long id)
    {
        return syVocationalPostMapper.selectSyVocationalPostById(id);
    }

    /**
     * 查询就业岗位列表
     * 
     * @param syVocationalPost 就业岗位
     * @return 就业岗位
     */
    @Override
    public List<SyVocationalPost> selectSyVocationalPostList(SyVocationalPost syVocationalPost)
    {
        return syVocationalPostMapper.selectSyVocationalPostList(syVocationalPost);
    }

    @Override
    public List<SyVocationalPost> selectSyVocationalPostByVocationalCode(String code) {
        return syVocationalPostMapper.selectSyVocationalPostByVocationalCode(code);
    }

    /**
     * 新增就业岗位
     * 
     * @param syVocationalPost 就业岗位
     * @return 结果
     */
    @Override
    public int insertSyVocationalPost(SyVocationalPost syVocationalPost)
    {
        syVocationalPost.setCreateTime(DateUtils.getNowDate());
        return syVocationalPostMapper.insertSyVocationalPost(syVocationalPost);
    }

    /**
     * 修改就业岗位
     * 
     * @param syVocationalPost 就业岗位
     * @return 结果
     */
    @Override
    public int updateSyVocationalPost(SyVocationalPost syVocationalPost)
    {
        return syVocationalPostMapper.updateSyVocationalPost(syVocationalPost);
    }

    /**
     * 批量删除就业岗位
     * 
     * @param ids 需要删除的就业岗位ID
     * @return 结果
     */
    @Override
    public int deleteSyVocationalPostByIds(Long[] ids)
    {
        return syVocationalPostMapper.deleteSyVocationalPostByIds(ids);
    }

    /**
     * 删除就业岗位信息
     * 
     * @param id 就业岗位ID
     * @return 结果
     */
    @Override
    public int deleteSyVocationalPostById(Long id)
    {
        return syVocationalPostMapper.deleteSyVocationalPostById(id);
    }
}
