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.AdmOpEnergyStrategyMapper;
import com.ruoyi.ems.domain.AdmOpEnergyStrategy;
import com.ruoyi.ems.service.IAdmOpEnergyStrategyService;

/**
 * 能源策略Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-08
 */
@Service
public class AdmOpEnergyStrategyServiceImpl implements IAdmOpEnergyStrategyService 
{
    @Autowired
    private AdmOpEnergyStrategyMapper admOpEnergyStrategyMapper;

    /**
     * 查询能源策略
     * 
     * @param id 能源策略主键
     * @return 能源策略
     */
    @Override
    public AdmOpEnergyStrategy selectAdmOpEnergyStrategyById(Long id)
    {
        return admOpEnergyStrategyMapper.selectAdmOpEnergyStrategyById(id);
    }

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

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

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

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

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