package com.nantian.cloud.dbcapp.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nantian.cloud.dbcapp.entity.ConfigureDataCollectEnableApply;
import com.nantian.cloud.dbcapp.mapper.record.ConfigureDataCollectEnableApplyMapper;
import com.nantian.cloud.dbcapp.service.ConfigureDataCollectEnableApplyService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("ConfigureDataCollectEnableApplyService")
public class ConfigureDataCollectEnableApplyImpl extends ServiceImpl<ConfigureDataCollectEnableApplyMapper, ConfigureDataCollectEnableApply> implements ConfigureDataCollectEnableApplyService {

    @Override
    public IPage<ConfigureDataCollectEnableApply> getApplyPage(Page page, ConfigureDataCollectEnableApply enableApply) {
        return baseMapper.getApplyPage(page, enableApply);
    }

    @Override
    public boolean delApply(Integer id) {
        return baseMapper.delApply(id);
    }

    @Override
    public boolean addEnableByApply(List<ConfigureDataCollectEnableApply> applyList) {
        if(applyList!=null && applyList.size()>0){
            return baseMapper.addEnableByApply(applyList);
        }else{
            return true;
        }
    }

    @Override
    public ConfigureDataCollectEnableApply getOldByApply(ConfigureDataCollectEnableApply enableApply) {
        return baseMapper.getOldByApply(enableApply);
    }

    @Override
    public boolean updateEnergyExceptionDataInfoByApplyStartTime(String enterpriseCode, String dataCode, String startTime) {
        return baseMapper.updateEnergyExceptionDataInfoByApplyStartTime(enterpriseCode,dataCode,startTime);
    }


}
