package com.jjt.elec.service.impl;

import java.util.List;
import org.springframework.stereotype.Service;
import com.jjt.elec.mapper.ElecPeriodMapper;
import com.jjt.elec.domain.ElecPeriod;
import com.jjt.elec.service.IElecPeriodService;
import javax.annotation.Resource;

/**
 * 电费分时配置Service业务层处理
 *
 * @author wukai
 * @date 2025-03-14
 */
@Service
public class ElecPeriodServiceImpl implements IElecPeriodService {
    @Resource
    private ElecPeriodMapper elecPeriodMapper;

    /**
     * 查询电费分时配置
     *
     * @param periodId 电费分时配置主键
     * @return 电费分时配置
     */
    @Override
    public ElecPeriod selectElecPeriodByPeriodId(Long periodId) {
        return elecPeriodMapper.selectElecPeriodByPeriodId(periodId);
    }

    /**
     * 查询电费分时配置列表
     *
     * @param elecPeriod 电费分时配置
     * @return 电费分时配置
     */
    @Override
    public List<ElecPeriod> selectElecPeriodList(ElecPeriod elecPeriod) {
        return elecPeriodMapper.selectElecPeriodList(elecPeriod);
    }

    /**
     * 新增电费分时配置
     *
     * @param elecPeriod 电费分时配置
     * @return 结果
     */
    @Override
    public int insertElecPeriod(ElecPeriod elecPeriod) {
            return elecPeriodMapper.insertElecPeriod(elecPeriod);
    }

    /**
     * 修改电费分时配置
     *
     * @param elecPeriod 电费分时配置
     * @return 结果
     */
    @Override
    public int updateElecPeriod(ElecPeriod elecPeriod) {
        return elecPeriodMapper.updateElecPeriod(elecPeriod);
    }

    /**
     * 批量删除电费分时配置
     *
     * @param periodIds 需要删除的电费分时配置主键
     * @return 结果
     */
    @Override
    public int deleteElecPeriodByPeriodIds(Long[] periodIds) {
        return elecPeriodMapper.deleteElecPeriodByPeriodIds(periodIds);
    }

    /**
     * 删除电费分时配置信息
     *
     * @param periodId 电费分时配置主键
     * @return 结果
     */
    @Override
    public int deleteElecPeriodByPeriodId(Long periodId) {
        return elecPeriodMapper.deleteElecPeriodByPeriodId(periodId);
    }
}
