package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.DailyUpdateRanking;
import com.ruoyi.system.mapper.DailyUpdateRankingMapper;
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 DailyUpdateRankingServiceImpl implements IDailyUpdateRankingService {


    @Autowired
    private DailyUpdateRankingMapper dailyUpdateRankingMapper;


    @Override
    public List<DailyUpdateRanking> selectDailyUpdateRankingList() {
        return dailyUpdateRankingMapper.selectDailyUpdateRankingList();
    }

    @Override
    public void insertBatch(List<DailyUpdateRanking> list) {
        if (!CollectionUtils.isEmpty(list)) {
            dailyUpdateRankingMapper.deleteDailyUpdateRankingAll();
        }
        dailyUpdateRankingMapper.insertBatch(list);
    }
}
