package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.CensusElements;
import com.ruoyi.system.domain.DailyTrafficRanking;
import com.ruoyi.system.mapper.CensusElementsMapper;
import com.ruoyi.system.mapper.DailyTrafficRankingMapper;
import com.ruoyi.system.service.ICensusElementsService;
import com.ruoyi.system.service.IDailyTrafficRankingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.util.List;


@Service
public class DailyTrafficRankingServiceImpl implements IDailyTrafficRankingService {


    @Autowired
    private DailyTrafficRankingMapper dailyTrafficRankingMapper;


    @Override
    public List<DailyTrafficRanking> selectDailyTrafficRankingList() {
        return dailyTrafficRankingMapper.selectDailyTrafficRankingList();
    }

    @Override
    public void insertBatch(List<DailyTrafficRanking> list) {
        if (!CollectionUtils.isEmpty(list)) {
            dailyTrafficRankingMapper.deleteDailyTrafficRankingAll();
        }
        dailyTrafficRankingMapper.insertBatch(list);
    }
}
