package com.ruoyi.ems.service.impl;

import com.ruoyi.ems.domain.OpEnergyStrategy;
import com.ruoyi.ems.mapper.OpEnergyStrategyMapper;
import com.ruoyi.ems.service.IOpEnergyStrategyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 能源策略Service业务层处理
 *
 * @author ruoyi
 * @date 2024-08-08
 */
@Service
public class OpEnergyStrategyServiceImpl implements IOpEnergyStrategyService {
    @Autowired
    private OpEnergyStrategyMapper strategyMapper;

    /**
     * 查询能源策略
     *
     * @param id 能源策略主键
     * @return 能源策略
     */
    @Override
    public OpEnergyStrategy selectStrategyById(Long id) {
        return strategyMapper.selectStrategyById(id);
    }

    /**
     * 查询能源策略列表
     *
     * @param admOpEnergyStrategy 能源策略
     * @return 能源策略
     */
    @Override
    public List<OpEnergyStrategy> selectStrategyList(OpEnergyStrategy admOpEnergyStrategy) {
        return strategyMapper.selectStrategyList(admOpEnergyStrategy);
    }

    /**
     * 新增能源策略
     *
     * @param admOpEnergyStrategy 能源策略
     * @return 结果
     */
    @Override
    public int insertStrategy(OpEnergyStrategy admOpEnergyStrategy) {
        return strategyMapper.insertStrategy(admOpEnergyStrategy);
    }

    /**
     * 修改能源策略
     *
     * @param admOpEnergyStrategy 能源策略
     * @return 结果
     */
    @Override
    public int updateStrategy(OpEnergyStrategy admOpEnergyStrategy) {
        return strategyMapper.updateStrategy(admOpEnergyStrategy);
    }

    /**
     * 批量删除能源策略
     *
     * @param ids 需要删除的能源策略主键
     * @return 结果
     */
    @Override
    public int deleteStrategyByIds(Long[] ids) {
        return strategyMapper.deleteStrategyByIds(ids);
    }

    /**
     * 删除能源策略信息
     *
     * @param id 能源策略主键
     * @return 结果
     */
    @Override
    public int deleteStrategyById(Long id) {
        return strategyMapper.deleteStrategyById(id);
    }
}
