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

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.evobms.common.utils.DateUtils;
import com.evobms.project.vehicledata.domain.VehicleData;
import com.evobms.project.vehicledata.mapper.VehicleDataMapper;
import com.evobms.project.vehicledata.service.IVehicleDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.evobms.project.summary.mapper.ChargeDischargeSummaryMapper;
import com.evobms.project.summary.domain.ChargeDischargeSummary;
import com.evobms.project.summary.service.IChargeDischargeSummaryService;

/**
 * 累计充放电量Service业务层处理
 *
 * @author 田志阳
 * @date 2026-01-09
 */
@Service
public class ChargeDischargeSummaryServiceImpl extends ServiceImpl<ChargeDischargeSummaryMapper, ChargeDischargeSummary> implements  IChargeDischargeSummaryService
{

    @Autowired
    private ChargeDischargeSummaryMapper chargeDischargeSummaryMapper;

    /**
     * 查询累计充放电量
     *
     * @param id 累计充放电量主键
     * @return 累计充放电量
     */
    @Override
    public ChargeDischargeSummary selectChargeDischargeSummaryById(Long id)
    {
        return chargeDischargeSummaryMapper.selectChargeDischargeSummaryById(id);
    }

    /**
     * 查询累计充放电量列表
     *
     * @param chargeDischargeSummary 累计充放电量
     * @return 累计充放电量
     */
    @Override
    public List<ChargeDischargeSummary> selectChargeDischargeSummaryList(ChargeDischargeSummary chargeDischargeSummary)
    {
        return chargeDischargeSummaryMapper.selectChargeDischargeSummaryList(chargeDischargeSummary);
    }

    /**
     * 新增累计充放电量
     *
     * @param chargeDischargeSummary 累计充放电量
     * @return 结果
     */
    @Override
    public int insertChargeDischargeSummary(ChargeDischargeSummary chargeDischargeSummary)
    {
        chargeDischargeSummary.setCreateTime(DateUtils.getNowDate());
        return chargeDischargeSummaryMapper.insertChargeDischargeSummary(chargeDischargeSummary);
    }

    /**
     * 修改累计充放电量
     *
     * @param chargeDischargeSummary 累计充放电量
     * @return 结果
     */
    @Override
    public int updateChargeDischargeSummary(ChargeDischargeSummary chargeDischargeSummary)
    {
        chargeDischargeSummary.setUpdateTime(DateUtils.getNowDate());
        return chargeDischargeSummaryMapper.updateChargeDischargeSummary(chargeDischargeSummary);
    }

    /**
     * 批量删除累计充放电量
     *
     * @param ids 需要删除的累计充放电量主键
     * @return 结果
     */
    @Override
    public int deleteChargeDischargeSummaryByIds(Long[] ids)
    {
        return chargeDischargeSummaryMapper.deleteChargeDischargeSummaryByIds(ids);
    }

    /**
     * 删除累计充放电量信息
     *
     * @param id 累计充放电量主键
     * @return 结果
     */
    @Override
    public int deleteChargeDischargeSummaryById(Long id)
    {
        return chargeDischargeSummaryMapper.deleteChargeDischargeSummaryById(id);
    }
}
