package com.ruoyi.system.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.system.mapper.CpsUsrContentRelMapper;
import com.ruoyi.system.domain.CpsUsrContentRel;
import com.ruoyi.system.service.ICpsUsrContentRelService;

/**
 * 用户资讯信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-22
 */
@Service
public class CpsUsrContentRelServiceImpl implements ICpsUsrContentRelService 
{
    @Autowired
    private CpsUsrContentRelMapper cpsUsrContentRelMapper;

    /**
     * 查询用户资讯信息
     * 
     * @param id 用户资讯信息主键
     * @return 用户资讯信息
     */
    @Override
    public CpsUsrContentRel selectCpsUsrContentRelById(Long id)
    {
        return cpsUsrContentRelMapper.selectCpsUsrContentRelById(id);
    }

    /**
     * 查询用户资讯信息列表
     * 
     * @param cpsUsrContentRel 用户资讯信息
     * @return 用户资讯信息
     */
    @Override
    public List<CpsUsrContentRel> selectCpsUsrContentRelList(CpsUsrContentRel cpsUsrContentRel)
    {
        return cpsUsrContentRelMapper.selectCpsUsrContentRelList(cpsUsrContentRel);
    }

    /**
     * 新增用户资讯信息
     * 
     * @param cpsUsrContentRel 用户资讯信息
     * @return 结果
     */
    @Override
    public int insertCpsUsrContentRel(CpsUsrContentRel cpsUsrContentRel)
    {
        cpsUsrContentRel.setCreateTime(DateUtils.getNowDate());
        return cpsUsrContentRelMapper.insertCpsUsrContentRel(cpsUsrContentRel);
    }

    /**
     * 修改用户资讯信息
     * 
     * @param cpsUsrContentRel 用户资讯信息
     * @return 结果
     */
    @Override
    public int updateCpsUsrContentRel(CpsUsrContentRel cpsUsrContentRel)
    {
        cpsUsrContentRel.setUpdateTime(DateUtils.getNowDate());
        return cpsUsrContentRelMapper.updateCpsUsrContentRel(cpsUsrContentRel);
    }

    /**
     * 批量删除用户资讯信息
     * 
     * @param ids 需要删除的用户资讯信息主键
     * @return 结果
     */
    @Override
    public int deleteCpsUsrContentRelByIds(Long[] ids)
    {
        return cpsUsrContentRelMapper.deleteCpsUsrContentRelByIds(ids);
    }

    /**
     * 删除用户资讯信息信息
     * 
     * @param id 用户资讯信息主键
     * @return 结果
     */
    @Override
    public int deleteCpsUsrContentRelById(Long id)
    {
        return cpsUsrContentRelMapper.deleteCpsUsrContentRelById(id);
    }
}
