package com.ruoyi.ems.base.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ems.base.mapper.EmsBaseSharePriceMapper;
import com.ruoyi.ems.base.domain.EmsBaseSharePrice;
import com.ruoyi.ems.base.service.IEmsBaseSharePriceService;

/**
 * 分时电价维护Service业务层处理
 *
 * @author Yinq
 * @date 2024-06-11
 */
@Service
public class EmsBaseSharePriceServiceImpl implements IEmsBaseSharePriceService {
    @Autowired
    private EmsBaseSharePriceMapper emsBaseSharePriceMapper;

    /**
     * 查询分时电价维护
     *
     * @param objId 分时电价维护主键
     * @return 分时电价维护
     */
    @Override
    public EmsBaseSharePrice selectEmsBaseSharePriceByObjId(Long objId) {
        return emsBaseSharePriceMapper.selectEmsBaseSharePriceByObjId(objId);
    }

    /**
     * 查询分时电价维护列表
     *
     * @param emsBaseSharePrice 分时电价维护
     * @return 分时电价维护
     */
    @Override
    public List<EmsBaseSharePrice> selectEmsBaseSharePriceList(EmsBaseSharePrice emsBaseSharePrice) {
        return emsBaseSharePriceMapper.selectEmsBaseSharePriceList(emsBaseSharePrice);
    }

    /**
     * 新增分时电价维护
     *
     * @param emsBaseSharePrice 分时电价维护
     * @return 结果
     */
    @Override
    public int insertEmsBaseSharePrice(EmsBaseSharePrice emsBaseSharePrice) {
        emsBaseSharePrice.setCreateTime(DateUtils.getNowDate());
        return emsBaseSharePriceMapper.insertEmsBaseSharePrice(emsBaseSharePrice);
    }

    /**
     * 修改分时电价维护
     *
     * @param emsBaseSharePrice 分时电价维护
     * @return 结果
     */
    @Override
    public int updateEmsBaseSharePrice(EmsBaseSharePrice emsBaseSharePrice) {
        emsBaseSharePrice.setUpdateTime(DateUtils.getNowDate());
        return emsBaseSharePriceMapper.updateEmsBaseSharePrice(emsBaseSharePrice);
    }

    /**
     * 批量删除分时电价维护
     *
     * @param objIds 需要删除的分时电价维护主键
     * @return 结果
     */
    @Override
    public int deleteEmsBaseSharePriceByObjIds(Long[] objIds) {
        return emsBaseSharePriceMapper.deleteEmsBaseSharePriceByObjIds(objIds);
    }

    /**
     * 删除分时电价维护信息
     *
     * @param objId 分时电价维护主键
     * @return 结果
     */
    @Override
    public int deleteEmsBaseSharePriceByObjId(Long objId) {
        return emsBaseSharePriceMapper.deleteEmsBaseSharePriceByObjId(objId);
    }
}
