package com.evobms.project.Battery.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.evobms.project.Battery.mapper.ChargeDischargeSummaryMapper;
import com.evobms.project.Battery.domain.ChargeDischargeSummary;
import com.evobms.project.Battery.service.IChargeDischargeSummaryService;
import com.evobms.common.utils.DateUtils;

@Service
public class ChargeDischargeSummaryServiceImpl implements IChargeDischargeSummaryService {
    @Autowired
    private ChargeDischargeSummaryMapper chargeDischargeSummaryMapper;

    @Override
    public ChargeDischargeSummary selectChargeDischargeSummaryById(Long id) {
        return chargeDischargeSummaryMapper.selectChargeDischargeSummaryById(id);
    }

    @Override
    public List<ChargeDischargeSummary> selectChargeDischargeSummaryList(ChargeDischargeSummary summary) {
        return chargeDischargeSummaryMapper.selectChargeDischargeSummaryList(summary);
    }

    @Override
    public int insertChargeDischargeSummary(ChargeDischargeSummary summary) {
        summary.setCreateTime(DateUtils.getNowDate());
        return chargeDischargeSummaryMapper.insertChargeDischargeSummary(summary);
    }

    @Override
    public int updateChargeDischargeSummary(ChargeDischargeSummary summary) {
        summary.setUpdateTime(DateUtils.getNowDate());
        return chargeDischargeSummaryMapper.updateChargeDischargeSummary(summary);
    }

    @Override
    public int deleteChargeDischargeSummaryByIds(Long[] ids) {
        return chargeDischargeSummaryMapper.deleteChargeDischargeSummaryByIds(ids);
    }

    @Override
    public int deleteChargeDischargeSummaryById(Long id) {
        return chargeDischargeSummaryMapper.deleteChargeDischargeSummaryById(id);
    }
}