package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.MunicipalMisprint;
import com.ruoyi.system.domain.PopularInformation;
import com.ruoyi.system.mapper.MunicipalMisprintMapper;
import com.ruoyi.system.mapper.PopularInformationMapper;
import com.ruoyi.system.service.IMunicipalMisprintService;
import com.ruoyi.system.service.IPopularInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.util.List;


@Service
public class PopularInformationServiceImpl implements IPopularInformationService {


    @Autowired
    private PopularInformationMapper popularInformationMapper;


    @Override
    public List<PopularInformation> selectPopularInformationList() {
        return popularInformationMapper.selectPopularInformationList();
    }

    @Override
    public void insertBatch(List<PopularInformation> list) {
        if (!CollectionUtils.isEmpty(list)) {
            popularInformationMapper.deletePopularInformationAll();
        }
        popularInformationMapper.insertBatch(list);
    }
}
