package com.dgtly.system.service.impl;

import java.util.List;
import com.dgtly.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dgtly.system.mapper.SysUserQuitMapper;
import com.dgtly.system.domain.SysUserQuit;
import com.dgtly.system.service.ISysUserQuitService;
import com.dgtly.common.core.text.Convert;

/**
 * 离职人员Service业务层处理
 * 
 * @author dgtly
 * @date 2022-06-16
 */
@Service
public class SysUserQuitServiceImpl implements ISysUserQuitService 
{
    @Autowired
    private SysUserQuitMapper sysUserQuitMapper;

    /**
     * 查询离职人员
     * 
     * @param createBy 离职人员ID
     * @return 离职人员
     */
    @Override
    public SysUserQuit selectSysUserQuitById(String createBy)
    {
        return sysUserQuitMapper.selectSysUserQuitById(createBy);
    }

    /**
     * 查询离职人员列表
     * 
     * @param sysUserQuit 离职人员
     * @return 离职人员
     */
    @Override
    public List<SysUserQuit> selectSysUserQuitList(SysUserQuit sysUserQuit)
    {
        return sysUserQuitMapper.selectSysUserQuitList(sysUserQuit);
    }

    /**
     * 新增离职人员
     * 
     * @param sysUserQuit 离职人员
     * @return 结果
     */
    @Override
    public int insertSysUserQuit(SysUserQuit sysUserQuit)
    {
        sysUserQuit.setCreateTime(DateUtils.getNowDate());
        return sysUserQuitMapper.insertSysUserQuit(sysUserQuit);
    }

    /**
     * 修改离职人员
     * 
     * @param sysUserQuit 离职人员
     * @return 结果
     */
    @Override
    public int updateSysUserQuit(SysUserQuit sysUserQuit)
    {
        sysUserQuit.setUpdateTime(DateUtils.getNowDate());
        return sysUserQuitMapper.updateSysUserQuit(sysUserQuit);
    }

    /**
     * 删除离职人员对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSysUserQuitByIds(String ids)
    {
        return sysUserQuitMapper.deleteSysUserQuitByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除离职人员信息
     * 
     * @param createBy 离职人员ID
     * @return 结果
     */
    @Override
    public int deleteSysUserQuitById(String createBy)
    {
        return sysUserQuitMapper.deleteSysUserQuitById(createBy);
    }
}
