package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.CensusElements;
import com.ruoyi.system.domain.CountyDailyUpdateRanking;
import com.ruoyi.system.mapper.CensusElementsMapper;
import com.ruoyi.system.mapper.CountyDailyUpdateRankingMapper;
import com.ruoyi.system.service.ICensusElementsService;
import com.ruoyi.system.service.ICountyDailyUpdateRankingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.util.List;


@Service
public class CountyDailyUpdateRankingServiceImpl implements ICountyDailyUpdateRankingService {


    @Autowired
    private CountyDailyUpdateRankingMapper countyDailyUpdateRankingMapper;


    @Override
    public List<CountyDailyUpdateRanking> selectCountyDailyUpdateRankingList() {
        return countyDailyUpdateRankingMapper.selectCountyDailyUpdateRankingList();
    }

    @Override
    public void insertBatch(List<CountyDailyUpdateRanking> list) {
        if (!CollectionUtils.isEmpty(list)) {
            countyDailyUpdateRankingMapper.deleteCountyDailyUpdateRankingAll();
        }
        countyDailyUpdateRankingMapper.insertBatch(list);
    }
}
