package com.inspur.service.impl;

import java.util.List;
import com.inspur.common.utils.DateUtils;
import com.inspur.domain.ElevatorPbxInfo;
import com.inspur.mapper.ElevatorPbxInfoMapper;
import com.inspur.service.IElevatorPbxInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * PBXService业务层处理
 *
 * @author inspur
 * @date 2024-09-30
 */
@Service
public class ElevatorPbxInfoServiceImpl implements IElevatorPbxInfoService
{
    @Autowired
    private ElevatorPbxInfoMapper elevatorPbxInfoMapper;

    /**
     * 查询PBX
     *
     * @param id PBX主键
     * @return PBX
     */
    @Override
    public ElevatorPbxInfo selectElevatorPbxInfoById(Long id)
    {
        return elevatorPbxInfoMapper.selectElevatorPbxInfoById(id);
    }

    /**
     * 查询PBX列表
     *
     * @param elevatorPbxInfo PBX
     * @return PBX
     */
    @Override
    public List<ElevatorPbxInfo> selectElevatorPbxInfoList(ElevatorPbxInfo elevatorPbxInfo)
    {
        return elevatorPbxInfoMapper.selectElevatorPbxInfoList(elevatorPbxInfo);
    }

    /**
     * 新增PBX
     *
     * @param elevatorPbxInfo PBX
     * @return 结果
     */
    @Override
    public int insertElevatorPbxInfo(ElevatorPbxInfo elevatorPbxInfo)
    {
        elevatorPbxInfo.setCreateTime(DateUtils.getNowDate());
        return elevatorPbxInfoMapper.insertElevatorPbxInfo(elevatorPbxInfo);
    }

    /**
     * 修改PBX
     *
     * @param elevatorPbxInfo PBX
     * @return 结果
     */
    @Override
    public int updateElevatorPbxInfo(ElevatorPbxInfo elevatorPbxInfo)
    {
        elevatorPbxInfo.setUpdateTime(DateUtils.getNowDate());
        return elevatorPbxInfoMapper.updateElevatorPbxInfo(elevatorPbxInfo);
    }

    /**
     * 批量删除PBX
     *
     * @param ids 需要删除的PBX主键
     * @return 结果
     */
    @Override
    public int deleteElevatorPbxInfoByIds(Long[] ids)
    {
        return elevatorPbxInfoMapper.deleteElevatorPbxInfoByIds(ids);
    }

    /**
     * 删除PBX信息
     *
     * @param id PBX主键
     * @return 结果
     */
    @Override
    public int deleteElevatorPbxInfoById(Long id)
    {
        return elevatorPbxInfoMapper.deleteElevatorPbxInfoById(id);
    }
}
