package com.ruoyi.benyun.utils.statistics;

import com.ruoyi.benyun.entity.BrandEvolve;
import com.ruoyi.benyun.mapper.BrandEvolveDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.UUID;

@Component
public class BrandEvolveStat {
    @Autowired
    BrandEvolveDao brandEvolveDao;

    public void insertAll(){
        List<BrandEvolve> evolves = brandEvolveDao.selectAllByStatistics();
        int total = evolves.size();
        int i = 0;
        for (BrandEvolve evolve : evolves){
            evolve.setStatId(UUID.randomUUID().toString().replace("-",""));
            i += brandEvolveDao.insert(evolve);
            System.out.println(i+"/"+total);
        }
    }
}
