package com.ruoyi.baseinfo.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.baseinfo.mapper.BaseEmployeeInfoMapper;
import com.ruoyi.baseinfo.domain.BaseEmployeeInfo;
import com.ruoyi.baseinfo.service.IBaseEmployeeInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 职员基础信息Service业务层处理
 * 
 * @author CaesarBao
 * @date 2020-10-21
 */
@Service
public class BaseEmployeeInfoServiceImpl implements IBaseEmployeeInfoService 
{
    @Autowired
    private BaseEmployeeInfoMapper baseEmployeeInfoMapper;

    /**
     * 查询职员基础信息
     * 
     * @param objid 职员基础信息ID
     * @return 职员基础信息
     */
    @Override
    public BaseEmployeeInfo selectBaseEmployeeInfoById(Long objid)
    {
        return baseEmployeeInfoMapper.selectBaseEmployeeInfoById(objid);
    }

    /**
     * 查询职员基础信息列表
     * 
     * @param baseEmployeeInfo 职员基础信息
     * @return 职员基础信息
     */
    @Override
    public List<BaseEmployeeInfo> selectBaseEmployeeInfoList(BaseEmployeeInfo baseEmployeeInfo)
    {
        return baseEmployeeInfoMapper.selectBaseEmployeeInfoList(baseEmployeeInfo);
    }

    /**
     * 新增职员基础信息
     * 
     * @param baseEmployeeInfo 职员基础信息
     * @return 结果
     */
    @Override
    public int insertBaseEmployeeInfo(BaseEmployeeInfo baseEmployeeInfo)
    {
        baseEmployeeInfo.setCreateTime(DateUtils.getNowDate());
        return baseEmployeeInfoMapper.insertBaseEmployeeInfo(baseEmployeeInfo);
    }

    /**
     * 修改职员基础信息
     * 
     * @param baseEmployeeInfo 职员基础信息
     * @return 结果
     */
    @Override
    public int updateBaseEmployeeInfo(BaseEmployeeInfo baseEmployeeInfo)
    {
        baseEmployeeInfo.setUpdateTime(DateUtils.getNowDate());
        return baseEmployeeInfoMapper.updateBaseEmployeeInfo(baseEmployeeInfo);
    }

    /**
     * 删除职员基础信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteBaseEmployeeInfoByIds(String ids)
    {
        return baseEmployeeInfoMapper.deleteBaseEmployeeInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除职员基础信息信息
     * 
     * @param objid 职员基础信息ID
     * @return 结果
     */
    @Override
    public int deleteBaseEmployeeInfoById(Long objid)
    {
        return baseEmployeeInfoMapper.deleteBaseEmployeeInfoById(objid);
    }
}
