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.TcNetworkArticleMapper;
import com.ruoyi.zongzhi.domain.TcNetworkArticle;
import com.ruoyi.zongzhi.service.ITcNetworkArticleService;

/**
 * 网络文章Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-10
 */
@Service
public class TcNetworkArticleServiceImpl implements ITcNetworkArticleService 
{
    @Autowired
    private TcNetworkArticleMapper tcNetworkArticleMapper;

    /**
     * 查询网络文章
     * 
     * @param id 网络文章主键
     * @return 网络文章
     */
    @Override
    public TcNetworkArticle selectTcNetworkArticleById(Long id)
    {
        return tcNetworkArticleMapper.selectTcNetworkArticleById(id);
    }

    /**
     * 查询网络文章列表
     * 
     * @param tcNetworkArticle 网络文章
     * @return 网络文章
     */
    @Override
    public List<TcNetworkArticle> selectTcNetworkArticleList(TcNetworkArticle tcNetworkArticle)
    {
        return tcNetworkArticleMapper.selectTcNetworkArticleList(tcNetworkArticle);
    }

    /**
     * 新增网络文章
     * 
     * @param tcNetworkArticle 网络文章
     * @return 结果
     */
    @Override
    public int insertTcNetworkArticle(TcNetworkArticle tcNetworkArticle)
    {
        tcNetworkArticle.setCreateTime(DateUtils.getNowDate());
        return tcNetworkArticleMapper.insertTcNetworkArticle(tcNetworkArticle);
    }

    /**
     * 修改网络文章
     * 
     * @param tcNetworkArticle 网络文章
     * @return 结果
     */
    @Override
    public int updateTcNetworkArticle(TcNetworkArticle tcNetworkArticle)
    {
        tcNetworkArticle.setUpdateTime(DateUtils.getNowDate());
        return tcNetworkArticleMapper.updateTcNetworkArticle(tcNetworkArticle);
    }

    /**
     * 批量删除网络文章
     * 
     * @param ids 需要删除的网络文章主键
     * @return 结果
     */
    @Override
    public int deleteTcNetworkArticleByIds(Long[] ids)
    {
        return tcNetworkArticleMapper.deleteTcNetworkArticleByIds(ids);
    }

    /**
     * 删除网络文章信息
     * 
     * @param id 网络文章主键
     * @return 结果
     */
    @Override
    public int deleteTcNetworkArticleById(Long id)
    {
        return tcNetworkArticleMapper.deleteTcNetworkArticleById(id);
    }
}
