package com.ruoyi.system.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.system.mapper.BusDeviceMapper;
import com.ruoyi.system.domain.BusDevice;
import com.ruoyi.system.service.IBusDeviceService;

/**
 * 设备Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-05-31
 */
@Service
public class BusDeviceServiceImpl implements IBusDeviceService 
{
    @Autowired
    private BusDeviceMapper busDeviceMapper;

    /**
     * 查询设备
     * 
     * @param id 设备主键
     * @return 设备
     */
    @Override
    public BusDevice selectBusDeviceById(Long id)
    {
        return busDeviceMapper.selectBusDeviceById(id);
    }

    /**
     * 查询设备列表
     * 
     * @param busDevice 设备
     * @return 设备
     */
    @Override
    public List<BusDevice> selectBusDeviceList(BusDevice busDevice)
    {
        return busDeviceMapper.selectBusDeviceList(busDevice);
    }

    /**
     * 新增设备
     * 
     * @param busDevice 设备
     * @return 结果
     */
    @Override
    public int insertBusDevice(BusDevice busDevice)
    {
        busDevice.setCreateTime(DateUtils.getNowDate());
        return busDeviceMapper.insertBusDevice(busDevice);
    }

    /**
     * 修改设备
     * 
     * @param busDevice 设备
     * @return 结果
     */
    @Override
    public int updateBusDevice(BusDevice busDevice)
    {
        busDevice.setUpdateTime(DateUtils.getNowDate());
        return busDeviceMapper.updateBusDevice(busDevice);
    }

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

    /**
     * 删除设备信息
     * 
     * @param id 设备主键
     * @return 结果
     */
    @Override
    public int deleteBusDeviceById(Long id)
    {
        return busDeviceMapper.deleteBusDeviceById(id);
    }
}
