package com.ruoyi.demo.utils.statistics;

import com.ruoyi.demo.entity.BrandBusiness;
import com.ruoyi.demo.mapper.BrandBusinessDao;
import com.ruoyi.demo.mapper.BrandZoneDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class BrandBusinessStat {
    @Autowired
    BrandBusinessDao brandBusinessDao;
    @Autowired
    BrandZoneDao zoneDao;

    public void continueInsert(){
//        List<String> ins = brandBusinessDao.selectIns();
//        System.out.println("已经处理：" + ins.size() + "个");
        List<String> ins = zoneDao.selectIns();
        List<BrandBusiness> brandBusinesses = brandBusinessDao.selectByStatistics(ins);
        int i = 0;
        int total = brandBusinesses.size();
        for (BrandBusiness business : brandBusinesses){
            i += brandBusinessDao.insert(business);
            System.out.println(i + "/" + total);
        }
    }
}
