package com.xzzn.ems.service.impl;

import com.xzzn.common.utils.DateUtils;
import com.xzzn.ems.domain.EmsDailyEnergyData;
import com.xzzn.ems.mapper.EmsDailyEnergyDataMapper;
import com.xzzn.ems.service.IEmsDailyEnergyDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 站点每日收益数据Service实现
 */
@Service
public class EmsDailyEnergyDataServiceImpl implements IEmsDailyEnergyDataService {

    @Autowired
    private EmsDailyEnergyDataMapper emsDailyEnergyDataMapper;

    @Override
    public List<EmsDailyEnergyData> selectEmsDailyEnergyDataList(EmsDailyEnergyData emsDailyEnergyData) {
        return emsDailyEnergyDataMapper.selectEmsDailyEnergyDataList(emsDailyEnergyData);
    }

    @Override
    public EmsDailyEnergyData selectEmsDailyEnergyDataById(Long id) {
        return emsDailyEnergyDataMapper.selectEmsDailyEnergyDataById(id);
    }

    @Override
    public int insertEmsDailyEnergyData(EmsDailyEnergyData emsDailyEnergyData, String operName) {
        emsDailyEnergyData.setCreateBy(operName);
        emsDailyEnergyData.setCreateTime(DateUtils.getNowDate());
        return emsDailyEnergyDataMapper.insertEmsDailyEnergyData(emsDailyEnergyData);
    }

    @Override
    public int updateEmsDailyEnergyData(EmsDailyEnergyData emsDailyEnergyData, String operName) {
        emsDailyEnergyData.setUpdateBy(operName);
        emsDailyEnergyData.setUpdateTime(DateUtils.getNowDate());
        return emsDailyEnergyDataMapper.updateEmsDailyEnergyData(emsDailyEnergyData);
    }

    @Override
    public int deleteEmsDailyEnergyDataByIds(Long[] ids) {
        return emsDailyEnergyDataMapper.deleteEmsDailyEnergyDataByIds(ids);
    }
}
