package com.ruoyi.zongzhi.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zongzhi.mapper.TcNetworkSentimentMapper;
import com.ruoyi.zongzhi.domain.TcNetworkSentiment;
import com.ruoyi.zongzhi.service.ITcNetworkSentimentService;

/**
 * 网络舆情Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-10
 */
@Service
public class TcNetworkSentimentServiceImpl implements ITcNetworkSentimentService 
{
    @Autowired
    private TcNetworkSentimentMapper tcNetworkSentimentMapper;

    /**
     * 查询网络舆情
     * 
     * @param id 网络舆情主键
     * @return 网络舆情
     */
    @Override
    public TcNetworkSentiment selectTcNetworkSentimentById(Long id)
    {
        return tcNetworkSentimentMapper.selectTcNetworkSentimentById(id);
    }

    /**
     * 查询网络舆情列表
     * 
     * @param tcNetworkSentiment 网络舆情
     * @return 网络舆情
     */
    @Override
    public List<TcNetworkSentiment> selectTcNetworkSentimentList(TcNetworkSentiment tcNetworkSentiment)
    {
        return tcNetworkSentimentMapper.selectTcNetworkSentimentList(tcNetworkSentiment);
    }

    /**
     * 新增网络舆情
     * 
     * @param tcNetworkSentiment 网络舆情
     * @return 结果
     */
    @Override
    public int insertTcNetworkSentiment(TcNetworkSentiment tcNetworkSentiment)
    {
        tcNetworkSentiment.setCreateTime(DateUtils.getNowDate());
        return tcNetworkSentimentMapper.insertTcNetworkSentiment(tcNetworkSentiment);
    }

    /**
     * 修改网络舆情
     * 
     * @param tcNetworkSentiment 网络舆情
     * @return 结果
     */
    @Override
    public int updateTcNetworkSentiment(TcNetworkSentiment tcNetworkSentiment)
    {
        tcNetworkSentiment.setUpdateTime(DateUtils.getNowDate());
        return tcNetworkSentimentMapper.updateTcNetworkSentiment(tcNetworkSentiment);
    }

    /**
     * 批量删除网络舆情
     * 
     * @param ids 需要删除的网络舆情主键
     * @return 结果
     */
    @Override
    public int deleteTcNetworkSentimentByIds(Long[] ids)
    {
        return tcNetworkSentimentMapper.deleteTcNetworkSentimentByIds(ids);
    }

    /**
     * 删除网络舆情信息
     * 
     * @param id 网络舆情主键
     * @return 结果
     */
    @Override
    public int deleteTcNetworkSentimentById(Long id)
    {
        return tcNetworkSentimentMapper.deleteTcNetworkSentimentById(id);
    }
}
