package com.ruoyi.ems.service.impl;

import com.ruoyi.ems.domain.ElecConsumeForecast;
import com.ruoyi.ems.mapper.ElecConsumeForecastMapper;
import com.ruoyi.ems.service.IElecConsumeForecastService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 电力消耗预测Service业务层处理
 *
 * @author ruoyi
 * @date 2024-08-12
 */
@Service
public class ElecConsumeForecastServiceImpl implements IElecConsumeForecastService {
    @Autowired
    private ElecConsumeForecastMapper forecastMapper;

    /**
     * 查询电力消耗预测
     *
     * @param id 电力消耗预测主键
     * @return 电力消耗预测
     */
    @Override
    public ElecConsumeForecast selectForecastById(Long id) {
        return forecastMapper.selectForecastById(id);
    }

    /**
     * 查询电力消耗预测列表
     *
     * @param forecast 电力消耗预测
     * @return 电力消耗预测
     */
    @Override
    public List<ElecConsumeForecast> selectForecastList(ElecConsumeForecast forecast) {
        return forecastMapper.selectForecastList(forecast);
    }

    /**
     * 新增电力消耗预测
     *
     * @param forecast 电力消耗预测
     * @return 结果
     */
    @Override
    public int insertForecast(ElecConsumeForecast forecast) {
        return forecastMapper.insertForecast(forecast);
    }

    /**
     * 修改电力消耗预测
     *
     * @param forecast 电力消耗预测
     * @return 结果
     */
    @Override
    public int updateForecast(ElecConsumeForecast forecast) {
        return forecastMapper.updateForecast(forecast);
    }

    /**
     * 批量删除电力消耗预测
     *
     * @param ids 需要删除的电力消耗预测主键
     * @return 结果
     */
    @Override
    public int deleteForecastByIds(Long[] ids) {
        return forecastMapper.deleteForecastByIds(ids);
    }

    /**
     * 删除电力消耗预测信息
     *
     * @param id 电力消耗预测主键
     * @return 结果
     */
    @Override
    public int deleteForecastById(Long id) {
        return forecastMapper.deleteForecastById(id);
    }

    @Override
    public List<ElecConsumeForecast> calcForecastDateRange(ElecConsumeForecast forecast) {
        return forecastMapper.calcForecastDateRange(forecast);
    }
}
