package com.ruoyi.ems.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ems.mapper.OpEnergyStrategyMapper;
import com.ruoyi.ems.domain.OpEnergyStrategy;
import com.ruoyi.ems.service.IOpEnergyStrategyService;

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

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

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

    /**
     * 新增能源策略
     * 
     * @param admOpEnergyStrategy 能源策略
     * @return 结果
     */
    @Override
    public int insertOpEnergyStrategy(OpEnergyStrategy admOpEnergyStrategy)
    {
        admOpEnergyStrategy.setCreateTime(DateUtils.getNowDate());
        return opEnergyStrategyMapper.insertOpEnergyStrategy(admOpEnergyStrategy);
    }

    /**
     * 修改能源策略
     * 
     * @param admOpEnergyStrategy 能源策略
     * @return 结果
     */
    @Override
    public int updateOpEnergyStrategy(OpEnergyStrategy admOpEnergyStrategy)
    {
        admOpEnergyStrategy.setUpdateTime(DateUtils.getNowDate());
        return opEnergyStrategyMapper.updateOpEnergyStrategy(admOpEnergyStrategy);
    }

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

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