package cn.ibizlab.core.extensions.service;

import cn.ibizlab.core.analysis.service.impl.DAReportServiceImpl;
import lombok.extern.slf4j.Slf4j;
import cn.ibizlab.core.analysis.domain.DAReport;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Caching;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Primary;
import java.util.*;

/**
 * 实体[报表] 自定义服务对象
 */
@Slf4j
@Primary
@Service("DAReportExService")
public class DAReportExService extends DAReportServiceImpl {

    @Override
    protected Class currentModelClass() {
        return com.baomidou.mybatisplus.core.toolkit.ReflectionKit.getSuperClassGenericType(this.getClass().getSuperclass(), 1);
    }

    /**
     * [Build:build] 行为扩展
     * @param et
     * @return
     */
    @Override
    @Transactional
    public DAReport build(DAReport et) {
        return super.build(et);
    }

    @Caching( evict = {
            @CacheEvict( value="dataAnalyse",allEntries = true)
    })
    @Override
    public boolean update(DAReport et) {
        return super.update(et);
    }

    @Caching( evict = {
            @CacheEvict( value="dataAnalyse",allEntries = true)
    })
    @Override
    public void updateBatch(List<DAReport> list) {
        super.updateBatch(list);
    }

    @Caching( evict = {
            @CacheEvict( value="dataAnalyse",allEntries = true)
    })
    @Override
    public boolean save(DAReport et) {
        return super.save(et);
    }

    @Caching( evict = {
            @CacheEvict( value="dataAnalyse",allEntries = true)
    })
    @Override
    public void saveBatch(List<DAReport> list) {
        super.saveBatch(list);
    }
}

