package com.ruoyi.project.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.mapper.TrsArticleInfoMapper;
import com.ruoyi.project.domain.TrsArticleInfo;
import com.ruoyi.project.service.ITrsArticleInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 稿件Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-20
 */
@Service
public class TrsArticleInfoServiceImpl implements ITrsArticleInfoService 
{
    @Autowired
    private TrsArticleInfoMapper trsArticleInfoMapper;

    /**
     * 查询稿件
     * 
     * @param id 稿件主键
     * @return 稿件
     */
    @Override
    public TrsArticleInfo selectTrsArticleInfoById(Long id)
    {
        return trsArticleInfoMapper.selectTrsArticleInfoById(id);
    }

    /**
     * 查询稿件列表
     * 
     * @param trsArticleInfo 稿件
     * @return 稿件
     */
    @Override
    public List<TrsArticleInfo> selectTrsArticleInfoList(TrsArticleInfo trsArticleInfo)
    {
        return trsArticleInfoMapper.selectTrsArticleInfoList(trsArticleInfo);
    }

    /**
     * 新增稿件
     * 
     * @param trsArticleInfo 稿件
     * @return 结果
     */
    @Override
    public int insertTrsArticleInfo(TrsArticleInfo trsArticleInfo)
    {
        return trsArticleInfoMapper.insertTrsArticleInfo(trsArticleInfo);
    }

    /**
     * 修改稿件
     * 
     * @param trsArticleInfo 稿件
     * @return 结果
     */
    @Override
    public int updateTrsArticleInfo(TrsArticleInfo trsArticleInfo)
    {
        return trsArticleInfoMapper.updateTrsArticleInfo(trsArticleInfo);
    }

    /**
     * 批量删除稿件
     * 
     * @param ids 需要删除的稿件主键
     * @return 结果
     */
    @Override
    public int deleteTrsArticleInfoByIds(String ids)
    {
        return trsArticleInfoMapper.deleteTrsArticleInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除稿件信息
     * 
     * @param id 稿件主键
     * @return 结果
     */
    @Override
    public int deleteTrsArticleInfoById(Long id)
    {
        return trsArticleInfoMapper.deleteTrsArticleInfoById(id);
    }
}
