package com.ruoyi.tcZz.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.tcZz.domain.TcWljgtj;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.tcZz.mapper.TcYqxxlnumMapper;
import com.ruoyi.tcZz.domain.TcYqxxlnum;
import com.ruoyi.tcZz.service.ITcYqxxlnumService;

/**
 * 舆情信息量统计Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-10-12
 */
@Service
public class TcYqxxlnumServiceImpl implements ITcYqxxlnumService 
{
    @Autowired
    private TcYqxxlnumMapper tcYqxxlnumMapper;

    /**
     * 查询舆情信息量统计
     * 
     * @param id 舆情信息量统计主键
     * @return 舆情信息量统计
     */
    @Override
    public TcYqxxlnum selectTcYqxxlnumById(Long id)
    {
        return tcYqxxlnumMapper.selectTcYqxxlnumById(id);
    }

    /**
     * 查询舆情信息量统计列表
     * 
     * @param tcYqxxlnum 舆情信息量统计
     * @return 舆情信息量统计
     */
    @Override
    public List<TcYqxxlnum> selectTcYqxxlnumList(TcYqxxlnum tcYqxxlnum)
    {
        return tcYqxxlnumMapper.selectTcYqxxlnumList(tcYqxxlnum);
    }

    /**
     * 新增舆情信息量统计
     * 
     * @param tcYqxxlnum 舆情信息量统计
     * @return 结果
     */
    @Override
    public int insertTcYqxxlnum(TcYqxxlnum tcYqxxlnum)
    {
        tcYqxxlnum.setCreateTime(DateUtils.getNowDate());
        return tcYqxxlnumMapper.insertTcYqxxlnum(tcYqxxlnum);
    }

    /**
     * 修改舆情信息量统计
     * 
     * @param tcYqxxlnum 舆情信息量统计
     * @return 结果
     */
    @Override
    public int updateTcYqxxlnum(TcYqxxlnum tcYqxxlnum)
    {
        tcYqxxlnum.setUpdateTime(DateUtils.getNowDate());
        return tcYqxxlnumMapper.updateTcYqxxlnum(tcYqxxlnum);
    }

    /**
     * 批量删除舆情信息量统计
     * 
     * @param ids 需要删除的舆情信息量统计主键
     * @return 结果
     */
    @Override
    public int deleteTcYqxxlnumByIds(Long[] ids)
    {
        return tcYqxxlnumMapper.deleteTcYqxxlnumByIds(ids);
    }

    /**
     * 删除舆情信息量统计信息
     * 
     * @param id 舆情信息量统计主键
     * @return 结果
     */
    @Override
    public int deleteTcYqxxlnumById(Long id)
    {
        return tcYqxxlnumMapper.deleteTcYqxxlnumById(id);
    }

    @Override
    public String importUser(List<TcYqxxlnum> tcYqxxlnumList) {
        StringBuilder successMsg = new StringBuilder();
        if (!tcYqxxlnumList.isEmpty()) {
            for (TcYqxxlnum  tcYqxxlnum : tcYqxxlnumList) {
                tcYqxxlnumMapper.insertTcYqxxlnum(tcYqxxlnum);
            }
            successMsg.append("导入成功");
        }
        return successMsg.toString();
    }

    @Override
    public void updateByisStatus(Integer isStatus,List<String> ids) {
        tcYqxxlnumMapper.updateByisStatus(isStatus,ids);
    }
}
