package com.inspur.service.impl;

import java.util.List;
import com.inspur.common.utils.DateUtils;
import com.inspur.domain.ElevatorPersonInfo;
import com.inspur.mapper.ElevatorPersonInfoMapper;
import com.inspur.service.IElevatorPersonInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 人员信息Service业务层处理
 *
 * @author inspur
 * @date 2024-09-30
 */
@Service
public class ElevatorPersonInfoServiceImpl implements IElevatorPersonInfoService
{
    @Autowired
    private ElevatorPersonInfoMapper elevatorPersonInfoMapper;

    /**
     * 查询人员信息
     *
     * @param id 人员信息主键
     * @return 人员信息
     */
    @Override
    public ElevatorPersonInfo selectElevatorPersonInfoById(Long id)
    {
        return elevatorPersonInfoMapper.selectElevatorPersonInfoById(id);
    }

    /**
     * 查询人员信息列表
     *
     * @param elevatorPersonInfo 人员信息
     * @return 人员信息
     */
    @Override
    public List<ElevatorPersonInfo> selectElevatorPersonInfoList(ElevatorPersonInfo elevatorPersonInfo)
    {
        return elevatorPersonInfoMapper.selectElevatorPersonInfoList(elevatorPersonInfo);
    }

    /**
     * 新增人员信息
     *
     * @param elevatorPersonInfo 人员信息
     * @return 结果
     */
    @Override
    public int insertElevatorPersonInfo(ElevatorPersonInfo elevatorPersonInfo)
    {
        elevatorPersonInfo.setCreateTime(DateUtils.getNowDate());
        return elevatorPersonInfoMapper.insertElevatorPersonInfo(elevatorPersonInfo);
    }

    /**
     * 修改人员信息
     *
     * @param elevatorPersonInfo 人员信息
     * @return 结果
     */
    @Override
    public int updateElevatorPersonInfo(ElevatorPersonInfo elevatorPersonInfo)
    {
        elevatorPersonInfo.setUpdateTime(DateUtils.getNowDate());
        return elevatorPersonInfoMapper.updateElevatorPersonInfo(elevatorPersonInfo);
    }

    /**
     * 批量删除人员信息
     *
     * @param ids 需要删除的人员信息主键
     * @return 结果
     */
    @Override
    public int deleteElevatorPersonInfoByIds(Long[] ids)
    {
        return elevatorPersonInfoMapper.deleteElevatorPersonInfoByIds(ids);
    }

    /**
     * 删除人员信息信息
     *
     * @param id 人员信息主键
     * @return 结果
     */
    @Override
    public int deleteElevatorPersonInfoById(Long id)
    {
        return elevatorPersonInfoMapper.deleteElevatorPersonInfoById(id);
    }
}
