package com.ruoyi.cs.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.cs.mapper.CsMemberNoticeMapper;
import com.ruoyi.cs.domain.CsMemberNotice;
import com.ruoyi.cs.service.ICsMemberNoticeService;

import javax.annotation.Resource;

/**
 * 用户弹窗公告记录Service业务层处理
 *
 * @author ruoyi
 * @date 2024-08-15
 */
@Service
public class CsMemberNoticeServiceImpl implements ICsMemberNoticeService
{
    @Resource
    private CsMemberNoticeMapper csMemberNoticeMapper;

    /**
     * 查询用户弹窗公告记录
     *
     * @param memberNoticeId 用户弹窗公告记录主键
     * @return 用户弹窗公告记录
     */
    @Override
    public CsMemberNotice selectCsMemberNoticeByMemberNoticeId(Integer memberNoticeId)
    {
        return csMemberNoticeMapper.selectCsMemberNoticeByMemberNoticeId(memberNoticeId);
    }

    /**
     * 查询用户弹窗公告记录列表
     *
     * @param csMemberNotice 用户弹窗公告记录
     * @return 用户弹窗公告记录
     */
    @Override
    public List<CsMemberNotice> selectCsMemberNoticeList(CsMemberNotice csMemberNotice)
    {
        return csMemberNoticeMapper.selectCsMemberNoticeList(csMemberNotice);
    }

    /**
     * 新增用户弹窗公告记录
     *
     * @param csMemberNotice 用户弹窗公告记录
     * @return 结果
     */
    @Override
    public int insertCsMemberNotice(CsMemberNotice csMemberNotice)
    {
        csMemberNotice.setCreateTime(DateUtils.getNowDate());
        csMemberNotice.setCreateTime(DateUtils.getNowDate());
        return csMemberNoticeMapper.insertCsMemberNotice(csMemberNotice);
    }

    /**
     * 修改用户弹窗公告记录
     *
     * @param csMemberNotice 用户弹窗公告记录
     * @return 结果
     */
    @Override
    public int updateCsMemberNotice(CsMemberNotice csMemberNotice)
    {
        csMemberNotice.setUpdateTime(DateUtils.getNowDate());
        return csMemberNoticeMapper.updateCsMemberNotice(csMemberNotice);
    }

    /**
     * 批量删除用户弹窗公告记录
     *
     * @param memberNoticeIds 需要删除的用户弹窗公告记录主键
     * @return 结果
     */
    @Override
    public int deleteCsMemberNoticeByMemberNoticeIds(Integer[] memberNoticeIds)
    {
        return csMemberNoticeMapper.deleteCsMemberNoticeByMemberNoticeIds(memberNoticeIds);
    }

    /**
     * 删除用户弹窗公告记录信息
     *
     * @param memberNoticeId 用户弹窗公告记录主键
     * @return 结果
     */
    @Override
    public int deleteCsMemberNoticeByMemberNoticeId(Integer memberNoticeId)
    {
        return csMemberNoticeMapper.deleteCsMemberNoticeByMemberNoticeId(memberNoticeId);
    }
}
