package com.ruoyi.ems.service.impl;

import com.ruoyi.ems.domain.ElecPriceStrategyHour;
import com.ruoyi.ems.mapper.ElecPriceStrategyHourMapper;
import com.ruoyi.ems.service.IElecPriceStrategyHourService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 电价策略小时Service业务层处理
 *
 * @author ruoyi
 * @date 2024-08-23
 */
@Service
public class ElecPriceStrategyHourServiceImpl implements IElecPriceStrategyHourService {
    @Autowired
    private ElecPriceStrategyHourMapper elecPriceStrategyHourMapper;

    /**
     * 查询电价策略小时
     *
     * @param id 电价策略小时主键
     * @return 电价策略小时
     */
    @Override
    public ElecPriceStrategyHour selectById(Long id) {
        return elecPriceStrategyHourMapper.selectById(id);
    }

    /**
     * 查询电价策略小时列表
     *
     * @param elecPriceStrategyHour 电价策略小时
     * @return 电价策略小时
     */
    @Override
    public List<ElecPriceStrategyHour> selectList(ElecPriceStrategyHour elecPriceStrategyHour) {
        return elecPriceStrategyHourMapper.selectList(elecPriceStrategyHour);
    }

    @Override
    public List<ElecPriceStrategyHour> selectListByStrategyCode(String strategyCode) {
        return elecPriceStrategyHourMapper.selectByStrategyCode(strategyCode);
    }

    /**
     * 新增电价策略小时
     *
     * @param elecPriceStrategyHour 电价策略小时
     * @return 结果
     */
    @Override
    public int insert(ElecPriceStrategyHour elecPriceStrategyHour) {
        return elecPriceStrategyHourMapper.insert(elecPriceStrategyHour);
    }

    @Override
    public int insertBatch(List<ElecPriceStrategyHour> list) {
        return elecPriceStrategyHourMapper.insertBatch(list);
    }

    /**
     * 修改电价策略小时
     *
     * @param elecPriceStrategyHour 电价策略小时
     * @return 结果
     */
    @Override
    public int update(ElecPriceStrategyHour elecPriceStrategyHour) {
        return elecPriceStrategyHourMapper.update(elecPriceStrategyHour);
    }

    /**
     * 批量删除电价策略小时
     *
     * @param ids 需要删除的电价策略小时主键
     * @return 结果
     */
    @Override
    public int deleteByIds(Long[] ids) {
        return elecPriceStrategyHourMapper.deleteByIds(ids);
    }

    /**
     * 删除电价策略小时信息
     *
     * @param id 电价策略小时主键
     * @return 结果
     */
    @Override
    public int deleteById(Long id) {
        return elecPriceStrategyHourMapper.deleteById(id);
    }

    @Override
    public int deleteByStrategyCode(String strategyCode) {
        return elecPriceStrategyHourMapper.deleteByStrategyCode(strategyCode);
    }
}
