package com.ruoyi.project.training.spec.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.training.spec.mapper.TStSuccessorMapper;
import com.ruoyi.project.training.spec.domain.TStSuccessor;
import com.ruoyi.project.training.spec.service.ITStSuccessorService;

/**
 * 继任者清单Service业务层处理
 *
 * @author ruoyi
 * @date 2022-04-11
 */
@Service
public class TStSuccessorServiceImpl implements ITStSuccessorService
{
    @Autowired
    private TStSuccessorMapper tStSuccessorMapper;

     /**
     * 根据导师ID查询学员列表
     *
     * @author 王子文
     * @date 2022年4月18日
     * @param tStSuccessor 继任者清单对象
     * @return 继任者清单
     */
    @Override
    public List<TStSuccessor> listSuccessorsByMentorId(TStSuccessor tStSuccessor)
    {
        return tStSuccessorMapper.selectSuccessorListByMentorId(tStSuccessor);
    }

    /**
     * 查询继任者清单
     *
     * @param id 继任者清单ID
     * @return 继任者清单
     */
    @Override
    public TStSuccessor selectTStSuccessorById(Long id)
    {
        return tStSuccessorMapper.selectTStSuccessorById(id);
    }

    /**
     * 查询继任者清单列表
     *
     * @param tStSuccessor 继任者清单
     * @return 继任者清单
     */
    @Override
    public List<TStSuccessor> selectTStSuccessorList(TStSuccessor tStSuccessor)
    {
        return tStSuccessorMapper.selectTStSuccessorList(tStSuccessor);
    }

    /**
     * 新增继任者清单
     *
     * @param tStSuccessor 继任者清单
     * @return 结果
     */
    @Override
    public int insertTStSuccessor(TStSuccessor tStSuccessor)
    {
        return tStSuccessorMapper.insertTStSuccessor(tStSuccessor);
    }

    /**
     * 修改继任者清单
     *
     * @param tStSuccessor 继任者清单
     * @return 结果
     */
    @Override
    public int updateTStSuccessor(TStSuccessor tStSuccessor)
    {
        return tStSuccessorMapper.updateTStSuccessor(tStSuccessor);
    }

    /**
     * 批量删除继任者清单
     *
     * @param ids 需要删除的继任者清单ID
     * @return 结果
     */
    @Override
    public int deleteTStSuccessorByIds(Long[] ids)
    {
        return tStSuccessorMapper.deleteTStSuccessorByIds(ids);
    }

    /**
     * 删除继任者清单信息
     *
     * @param id 继任者清单ID
     * @return 结果
     */
    @Override
    public int deleteTStSuccessorById(Long id)
    {
        return tStSuccessorMapper.deleteTStSuccessorById(id);
    }

    /**
     * 根据staffId修改“进行中”的继任者计划状态为“因离职中止”
     * @param staffId
     * @return
     */
    @Override
    public int updateStateByStaffId(Long staffId) {
        return tStSuccessorMapper.updateStateByStaffId(staffId);
    }

    /**
     * 根据学员id查询继任者清单详细信息
     */
    @Override
    public TStSuccessor selectTStSuccessorBySuccessorId(Long staffId) {
        return tStSuccessorMapper.selectTStSuccessorBySuccessorId(staffId);
    }
}
