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.TcCommentatorMapper;
import com.ruoyi.zongzhi.domain.TcCommentator;
import com.ruoyi.zongzhi.service.ITcCommentatorService;

/**
 * 网评员Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-10
 */
@Service
public class TcCommentatorServiceImpl implements ITcCommentatorService 
{
    @Autowired
    private TcCommentatorMapper tcCommentatorMapper;

    /**
     * 查询网评员
     * 
     * @param id 网评员主键
     * @return 网评员
     */
    @Override
    public TcCommentator selectTcCommentatorById(Long id)
    {
        return tcCommentatorMapper.selectTcCommentatorById(id);
    }

    /**
     * 查询网评员列表
     * 
     * @param tcCommentator 网评员
     * @return 网评员
     */
    @Override
    public List<TcCommentator> selectTcCommentatorList(TcCommentator tcCommentator)
    {
        return tcCommentatorMapper.selectTcCommentatorList(tcCommentator);
    }

    /**
     * 新增网评员
     * 
     * @param tcCommentator 网评员
     * @return 结果
     */
    @Override
    public int insertTcCommentator(TcCommentator tcCommentator)
    {
        tcCommentator.setCreateTime(DateUtils.getNowDate());
        return tcCommentatorMapper.insertTcCommentator(tcCommentator);
    }

    /**
     * 修改网评员
     * 
     * @param tcCommentator 网评员
     * @return 结果
     */
    @Override
    public int updateTcCommentator(TcCommentator tcCommentator)
    {
        tcCommentator.setUpdateTime(DateUtils.getNowDate());
        return tcCommentatorMapper.updateTcCommentator(tcCommentator);
    }

    /**
     * 批量删除网评员
     * 
     * @param ids 需要删除的网评员主键
     * @return 结果
     */
    @Override
    public int deleteTcCommentatorByIds(Long[] ids)
    {
        return tcCommentatorMapper.deleteTcCommentatorByIds(ids);
    }

    /**
     * 删除网评员信息
     * 
     * @param id 网评员主键
     * @return 结果
     */
    @Override
    public int deleteTcCommentatorById(Long id)
    {
        return tcCommentatorMapper.deleteTcCommentatorById(id);
    }
}
