package com.zehong.system.service.impl;

import java.util.List;
import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.form.DeviceReportDataForm;
import com.zehong.system.domain.vo.DeviceReportDataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TDeviceReportDataMapper;
import com.zehong.system.domain.TDeviceReportData;
import com.zehong.system.service.ITDeviceReportDataService;

/**
 * 设备监控Service业务层处理
 * 
 * @author zehong
 * @date 2021-08-09
 */
@Service
public class TDeviceReportDataServiceImpl implements ITDeviceReportDataService 
{
    @Autowired
    private TDeviceReportDataMapper tDeviceReportDataMapper;

    /**
     * 查询设备监控
     * 
     * @param deviceReportDataId 设备监控ID
     * @return 设备监控
     */
    @Override
    public DeviceReportDataVo selectTDeviceReportDataById(Long deviceReportDataId)
    {
        return tDeviceReportDataMapper.selectTDeviceReportDataById(deviceReportDataId);
    }

    /**
     * 查询设备监控列表
     * 
     * @param deviceReportDataForm 设备监控
     * @return 设备监控
     */
    @Override
    public List<DeviceReportDataVo> selectTDeviceReportDataList(DeviceReportDataForm deviceReportDataForm)
    {
        return tDeviceReportDataMapper.selectTDeviceReportDataList(deviceReportDataForm);
    }

    /**
     * 查询设备监控实时数据
     *
     * @param deviceReportDataForm 设备监控
     * @return 设备监控
     */
    @Override
    public List<DeviceReportDataVo> selectRealtimeDataList(DeviceReportDataForm deviceReportDataForm)
    {
        return tDeviceReportDataMapper.selectRealtimeDataList(deviceReportDataForm);
    }

    /**
     * 新增设备监控
     * 
     * @param tDeviceReportData 设备监控
     * @return 结果
     */
    @Override
    public int insertTDeviceReportData(TDeviceReportData tDeviceReportData)
    {
        tDeviceReportData.setCreateTime(DateUtils.getNowDate());
        return tDeviceReportDataMapper.insertTDeviceReportData(tDeviceReportData);
    }

    /**
     * 修改设备监控
     * 
     * @param tDeviceReportData 设备监控
     * @return 结果
     */
    @Override
    public int updateTDeviceReportData(TDeviceReportData tDeviceReportData)
    {
        tDeviceReportData.setUpdateTime(DateUtils.getNowDate());
        return tDeviceReportDataMapper.updateTDeviceReportData(tDeviceReportData);
    }

    /**
     * 批量删除设备监控
     * 
     * @param deviceReportDataIds 需要删除的设备监控ID
     * @return 结果
     */
    @Override
    public int deleteTDeviceReportDataByIds(Long[] deviceReportDataIds)
    {
        return tDeviceReportDataMapper.deleteTDeviceReportDataByIds(deviceReportDataIds);
    }

    /**
     * 删除设备监控信息
     * 
     * @param deviceReportDataId 设备监控ID
     * @return 结果
     */
    @Override
    public int deleteTDeviceReportDataById(Long deviceReportDataId)
    {
        return tDeviceReportDataMapper.deleteTDeviceReportDataById(deviceReportDataId);
    }
}
