package com.fastbee.deviceData.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.deviceData.mapper.DeviceRealtimedataPhotovoltaicMapper;
import com.fastbee.deviceData.domain.DeviceRealtimedataPhotovoltaic;
import com.fastbee.deviceData.service.IDeviceRealtimedataPhotovoltaicService;

/**
 * 光伏设备实时数据Service业务层处理
 * 
 * @author kerwincui
 * @date 2024-11-14
 */
@Service
public class DeviceRealtimedataPhotovoltaicServiceImpl implements IDeviceRealtimedataPhotovoltaicService 
{
    @Autowired
    private DeviceRealtimedataPhotovoltaicMapper deviceRealtimedataPhotovoltaicMapper;

    /**
     * 查询光伏设备实时数据
     * 
     * @param id 光伏设备实时数据主键
     * @return 光伏设备实时数据
     */
    @Override
    public DeviceRealtimedataPhotovoltaic selectDeviceRealtimedataPhotovoltaicById(Long id)
    {
        return deviceRealtimedataPhotovoltaicMapper.selectDeviceRealtimedataPhotovoltaicById(id);
    }

    /**
     * 查询光伏设备实时数据列表
     * 
     * @param deviceRealtimedataPhotovoltaic 光伏设备实时数据
     * @return 光伏设备实时数据
     */
    @Override
    public List<DeviceRealtimedataPhotovoltaic> selectDeviceRealtimedataPhotovoltaicList(DeviceRealtimedataPhotovoltaic deviceRealtimedataPhotovoltaic)
    {
        return deviceRealtimedataPhotovoltaicMapper.selectDeviceRealtimedataPhotovoltaicList(deviceRealtimedataPhotovoltaic);
    }

    /**
     * 新增光伏设备实时数据
     * 
     * @param deviceRealtimedataPhotovoltaic 光伏设备实时数据
     * @return 结果
     */
    @Override
    public int insertDeviceRealtimedataPhotovoltaic(DeviceRealtimedataPhotovoltaic deviceRealtimedataPhotovoltaic)
    {
        deviceRealtimedataPhotovoltaic.setCreateTime(DateUtils.getNowDate());
        return deviceRealtimedataPhotovoltaicMapper.insertDeviceRealtimedataPhotovoltaic(deviceRealtimedataPhotovoltaic);
    }

    /**
     * 修改光伏设备实时数据
     * 
     * @param deviceRealtimedataPhotovoltaic 光伏设备实时数据
     * @return 结果
     */
    @Override
    public int updateDeviceRealtimedataPhotovoltaic(DeviceRealtimedataPhotovoltaic deviceRealtimedataPhotovoltaic)
    {
        return deviceRealtimedataPhotovoltaicMapper.updateDeviceRealtimedataPhotovoltaic(deviceRealtimedataPhotovoltaic);
    }

    /**
     * 批量删除光伏设备实时数据
     * 
     * @param ids 需要删除的光伏设备实时数据主键
     * @return 结果
     */
    @Override
    public int deleteDeviceRealtimedataPhotovoltaicByIds(Long[] ids)
    {
        return deviceRealtimedataPhotovoltaicMapper.deleteDeviceRealtimedataPhotovoltaicByIds(ids);
    }

    /**
     * 删除光伏设备实时数据信息
     * 
     * @param id 光伏设备实时数据主键
     * @return 结果
     */
    @Override
    public int deleteDeviceRealtimedataPhotovoltaicById(Long id)
    {
        return deviceRealtimedataPhotovoltaicMapper.deleteDeviceRealtimedataPhotovoltaicById(id);
    }
}
