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.TcYqzsMapper;
import com.ruoyi.tcZz.domain.TcYqzs;
import com.ruoyi.tcZz.service.ITcYqzsService;

/**
 * 舆情走势图Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-10-13
 */
@Service
public class TcYqzsServiceImpl implements ITcYqzsService 
{
    @Autowired
    private TcYqzsMapper tcYqzsMapper;

    /**
     * 查询舆情走势图
     * 
     * @param id 舆情走势图主键
     * @return 舆情走势图
     */
    @Override
    public TcYqzs selectTcYqzsById(Long id)
    {
        return tcYqzsMapper.selectTcYqzsById(id);
    }

    /**
     * 查询舆情走势图列表
     * 
     * @param tcYqzs 舆情走势图
     * @return 舆情走势图
     */
    @Override
    public List<TcYqzs> selectTcYqzsList(TcYqzs tcYqzs)
    {
        return tcYqzsMapper.selectTcYqzsList(tcYqzs);
    }

    /**
     * 新增舆情走势图
     * 
     * @param tcYqzs 舆情走势图
     * @return 结果
     */
    @Override
    public int insertTcYqzs(TcYqzs tcYqzs)
    {
        tcYqzs.setCreateTime(DateUtils.getNowDate());
        return tcYqzsMapper.insertTcYqzs(tcYqzs);
    }

    /**
     * 修改舆情走势图
     * 
     * @param tcYqzs 舆情走势图
     * @return 结果
     */
    @Override
    public int updateTcYqzs(TcYqzs tcYqzs)
    {
        tcYqzs.setUpdateTime(DateUtils.getNowDate());
        return tcYqzsMapper.updateTcYqzs(tcYqzs);
    }

    /**
     * 批量删除舆情走势图
     * 
     * @param ids 需要删除的舆情走势图主键
     * @return 结果
     */
    @Override
    public int deleteTcYqzsByIds(Long[] ids)
    {
        return tcYqzsMapper.deleteTcYqzsByIds(ids);
    }

    /**
     * 删除舆情走势图信息
     * 
     * @param id 舆情走势图主键
     * @return 结果
     */
    @Override
    public int deleteTcYqzsById(Long id)
    {
        return tcYqzsMapper.deleteTcYqzsById(id);
    }

    @Override
    public String importUser(List<TcYqzs> tcYqzsList) {
        StringBuilder successMsg = new StringBuilder();
        if (!tcYqzsList.isEmpty()) {
            for (TcYqzs tcYqzs : tcYqzsList) {
                tcYqzsMapper.insertTcYqzs(tcYqzs);
            }
            successMsg.append("导入成功");
        }
        return successMsg.toString();
    }

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


}
