package com.ruoyi.tcZz.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.tcZz.domain.TcXtjc;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.tcZz.mapper.TcYqxxltjMapper;
import com.ruoyi.tcZz.domain.TcYqxxltj;
import com.ruoyi.tcZz.service.ITcYqxxltjService;

/**
 * 舆情信息量统计明細Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-10-12
 */
@Service
public class TcYqxxltjServiceImpl implements ITcYqxxltjService 
{
    @Autowired
    private TcYqxxltjMapper tcYqxxltjMapper;

    /**
     * 查询舆情信息量统计明細
     * 
     * @param id 舆情信息量统计明細主键
     * @return 舆情信息量统计明細
     */
    @Override
    public TcYqxxltj selectTcYqxxltjById(Long id)
    {
        return tcYqxxltjMapper.selectTcYqxxltjById(id);
    }

    /**
     * 查询舆情信息量统计明細列表
     * 
     * @param tcYqxxltj 舆情信息量统计明細
     * @return 舆情信息量统计明細
     */
    @Override
    public List<TcYqxxltj> selectTcYqxxltjList(TcYqxxltj tcYqxxltj)
    {
        return tcYqxxltjMapper.selectTcYqxxltjList(tcYqxxltj);
    }

    /**
     * 新增舆情信息量统计明細
     * 
     * @param tcYqxxltj 舆情信息量统计明細
     * @return 结果
     */
    @Override
    public int insertTcYqxxltj(TcYqxxltj tcYqxxltj)
    {
        tcYqxxltj.setCreateTime(DateUtils.getNowDate());
        return tcYqxxltjMapper.insertTcYqxxltj(tcYqxxltj);
    }

    /**
     * 修改舆情信息量统计明細
     * 
     * @param tcYqxxltj 舆情信息量统计明細
     * @return 结果
     */
    @Override
    public int updateTcYqxxltj(TcYqxxltj tcYqxxltj)
    {
        tcYqxxltj.setUpdateTime(DateUtils.getNowDate());
        return tcYqxxltjMapper.updateTcYqxxltj(tcYqxxltj);
    }

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

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

    @Override
    public String importUser(List<TcYqxxltj> tcJgdwList) {
        StringBuilder successMsg = new StringBuilder();
        if (!tcJgdwList.isEmpty()) {
            for (TcYqxxltj tcYqxxltj : tcJgdwList) {
                tcYqxxltjMapper.insertTcYqxxltj(tcYqxxltj);
            }
            successMsg.append("导入成功");
        }

        return successMsg.toString();

    }

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