package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.CountyDailyTrafficRanking;
import com.ruoyi.system.domain.DailyUpdateRanking;
import com.ruoyi.system.mapper.CountyDailyTrafficRankingMapper;
import com.ruoyi.system.mapper.DailyUpdateRankingMapper;
import com.ruoyi.system.service.ICountyDailyTrafficRankingService;
import com.ruoyi.system.service.IDailyUpdateRankingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.util.List;


@Service
public class CountyDailyTrafficRankingServiceImpl implements ICountyDailyTrafficRankingService {


    @Autowired
    private CountyDailyTrafficRankingMapper countyDailyTrafficRankingMapper;


    @Override
    public List<CountyDailyTrafficRanking> selectCountyDailyTrafficRankingList() {
        return countyDailyTrafficRankingMapper.selectCountyDailyTrafficRankingList();
    }

    @Override
    public void insertBatch(List<CountyDailyTrafficRanking> list) {
        if (!CollectionUtils.isEmpty(list)) {
            countyDailyTrafficRankingMapper.deleteCountyDailyTrafficRankingAll();
        }
        countyDailyTrafficRankingMapper.insertBatch(list);
    }
}
