package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.HwDeviceMapper;
import com.ruoyi.business.domain.HwDevice;
import com.ruoyi.business.service.IHwDeviceService;

/**
 * 设备信息Service业务层处理
 * 
 * @author xins
 * @date 2023-08-24
 */
@Service
public class HwDeviceServiceImpl implements IHwDeviceService 
{
    @Autowired
    private HwDeviceMapper hwDeviceMapper;

    /**
     * 查询设备信息
     * 
     * @param deviceId 设备信息主键
     * @return 设备信息
     */
    @Override
    public HwDevice selectHwDeviceByDeviceId(Long deviceId)
    {
        return hwDeviceMapper.selectHwDeviceByDeviceId(deviceId);
    }

    /**
     * 查询设备信息列表
     * 
     * @param hwDevice 设备信息
     * @return 设备信息
     */
    @Override
    public List<HwDevice> selectHwDeviceList(HwDevice hwDevice)
    {
        return hwDeviceMapper.selectHwDeviceList(hwDevice);
    }

    /**
     * 新增设备信息
     * 
     * @param hwDevice 设备信息
     * @return 结果
     */
    @Override
    public int insertHwDevice(HwDevice hwDevice)
    {
        hwDevice.setCreateTime(DateUtils.getNowDate());
        return hwDeviceMapper.insertHwDevice(hwDevice);
    }

    /**
     * 修改设备信息
     * 
     * @param hwDevice 设备信息
     * @return 结果
     */
    @Override
    public int updateHwDevice(HwDevice hwDevice)
    {
        hwDevice.setUpdateTime(DateUtils.getNowDate());
        return hwDeviceMapper.updateHwDevice(hwDevice);
    }

    /**
     * 批量删除设备信息
     * 
     * @param deviceIds 需要删除的设备信息主键
     * @return 结果
     */
    @Override
    public int deleteHwDeviceByDeviceIds(Long[] deviceIds)
    {
        return hwDeviceMapper.deleteHwDeviceByDeviceIds(deviceIds);
    }

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