package com.xzzn.ems.service.impl;

import com.xzzn.common.utils.DateUtils;
import com.xzzn.ems.domain.EmsDailyChargeData;
import com.xzzn.ems.mapper.EmsDailyChargeDataMapper;
import com.xzzn.ems.service.IEmsDailyChargeDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 站点每日充放电数据Service实现
 */
@Service
public class EmsDailyChargeDataServiceImpl implements IEmsDailyChargeDataService {

    @Autowired
    private EmsDailyChargeDataMapper emsDailyChargeDataMapper;

    @Override
    public List<EmsDailyChargeData> selectEmsDailyChargeDataList(EmsDailyChargeData emsDailyChargeData) {
        return emsDailyChargeDataMapper.selectEmsDailyChargeDataList(emsDailyChargeData);
    }

    @Override
    public EmsDailyChargeData selectEmsDailyChargeDataById(Long id) {
        return emsDailyChargeDataMapper.selectEmsDailyChargeDataById(id);
    }

    @Override
    public int insertEmsDailyChargeData(EmsDailyChargeData emsDailyChargeData, String operName) {
        emsDailyChargeData.setCreateBy(operName);
        emsDailyChargeData.setCreateTime(DateUtils.getNowDate());
        return emsDailyChargeDataMapper.insertEmsDailyChargeData(emsDailyChargeData);
    }

    @Override
    public int updateEmsDailyChargeData(EmsDailyChargeData emsDailyChargeData, String operName) {
        emsDailyChargeData.setUpdateBy(operName);
        emsDailyChargeData.setUpdateTime(DateUtils.getNowDate());
        return emsDailyChargeDataMapper.updateEmsDailyChargeData(emsDailyChargeData);
    }

    @Override
    public int deleteEmsDailyChargeDataByIds(Long[] ids) {
        return emsDailyChargeDataMapper.deleteEmsDailyChargeDataByIds(ids);
    }
}
