package com.fastbee.iot.service.impl;

import java.util.List;
import com.fastbee.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fastbee.iot.mapper.NgDeviceOperationRecordsMapper;
import com.fastbee.iot.domain.NgDeviceOperationRecords;
import com.fastbee.iot.service.INgDeviceOperationRecordsService;

/**
 * 设备操作记录Service业务层处理
 *
 * @author kerwincui
 * @date 2024-12-30
 */
@Service
public class NgDeviceOperationRecordsServiceImpl implements INgDeviceOperationRecordsService
{
    @Autowired
    private NgDeviceOperationRecordsMapper ngDeviceOperationRecordsMapper;

    /**
     * 查询设备操作记录
     *
     * @param id 设备操作记录主键
     * @return 设备操作记录
     */
    @Override
    public NgDeviceOperationRecords selectNgDeviceOperationRecordsById(Long id)
    {
        return ngDeviceOperationRecordsMapper.selectNgDeviceOperationRecordsById(id);
    }

    /**
     * 查询设备操作记录列表
     *
     * @param ngDeviceOperationRecords 设备操作记录
     * @return 设备操作记录
     */
    @Override
    public List<NgDeviceOperationRecords> selectNgDeviceOperationRecordsList(NgDeviceOperationRecords ngDeviceOperationRecords)
    {
        return ngDeviceOperationRecordsMapper.selectNgDeviceOperationRecordsList(ngDeviceOperationRecords);
    }

    /**
     * 新增设备操作记录
     *
     * @param ngDeviceOperationRecords 设备操作记录
     * @return 结果
     */
    @Override
    public int insertNgDeviceOperationRecords(NgDeviceOperationRecords ngDeviceOperationRecords)
    {
        ngDeviceOperationRecords.setCreateTime(DateUtils.getNowDate());
        return ngDeviceOperationRecordsMapper.insertNgDeviceOperationRecords(ngDeviceOperationRecords);
    }

    /**
     * 修改设备操作记录
     *
     * @param ngDeviceOperationRecords 设备操作记录
     * @return 结果
     */
    @Override
    public int updateNgDeviceOperationRecords(NgDeviceOperationRecords ngDeviceOperationRecords)
    {
        ngDeviceOperationRecords.setUpdateTime(DateUtils.getNowDate());
        return ngDeviceOperationRecordsMapper.updateNgDeviceOperationRecords(ngDeviceOperationRecords);
    }

    /**
     * 批量删除设备操作记录
     *
     * @param ids 需要删除的设备操作记录主键
     * @return 结果
     */
    @Override
    public int deleteNgDeviceOperationRecordsByIds(Long[] ids)
    {
        return ngDeviceOperationRecordsMapper.deleteNgDeviceOperationRecordsByIds(ids);
    }

    /**
     * 删除设备操作记录信息
     *
     * @param id 设备操作记录主键
     * @return 结果
     */
    @Override
    public int deleteNgDeviceOperationRecordsById(Long id)
    {
        return ngDeviceOperationRecordsMapper.deleteNgDeviceOperationRecordsById(id);
    }
}
