package com.ruoyi.mall.service.impl;

import java.util.List;

import com.ruoyi.mall.domain.vo.IndexNoticeVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.mapper.MallCmsNoticeMapper;
import com.ruoyi.mall.domain.MallCmsNotice;
import com.ruoyi.mall.service.IMallCmsNoticeService;

/**
 * 公告Service业务层处理
 * 
 * @author chang
 * @date 2021-11-25
 */
@Service
public class MallCmsNoticeServiceImpl implements IMallCmsNoticeService 
{
    @Autowired
    private MallCmsNoticeMapper mallCmsNoticeMapper;

    /**
     * 查询公告
     * 
     * @param id 公告主键
     * @return 公告
     */
    @Override
    public MallCmsNotice selectMallCmsNoticeById(Long id)
    {
        return mallCmsNoticeMapper.selectMallCmsNoticeById(id);
    }

    /**
     * 查询公告列表
     * 
     * @param mallCmsNotice 公告
     * @return 公告
     */
    @Override
    public List<MallCmsNotice> selectMallCmsNoticeList(MallCmsNotice mallCmsNotice)
    {
        return mallCmsNoticeMapper.selectMallCmsNoticeList(mallCmsNotice);
    }

    /**
     * 新增公告
     * 
     * @param mallCmsNotice 公告
     * @return 结果
     */
    @Override
    public int insertMallCmsNotice(MallCmsNotice mallCmsNotice)
    {
        return mallCmsNoticeMapper.insertMallCmsNotice(mallCmsNotice);
    }

    /**
     * 修改公告
     * 
     * @param mallCmsNotice 公告
     * @return 结果
     */
    @Override
    public int updateMallCmsNotice(MallCmsNotice mallCmsNotice)
    {
        return mallCmsNoticeMapper.updateMallCmsNotice(mallCmsNotice);
    }

    /**
     * 批量删除公告
     * 
     * @param ids 需要删除的公告主键
     * @return 结果
     */
    @Override
    public int deleteMallCmsNoticeByIds(Long[] ids)
    {
        return mallCmsNoticeMapper.deleteMallCmsNoticeByIds(ids);
    }

    /**
     * 删除公告信息
     * 
     * @param id 公告主键
     * @return 结果
     */
    @Override
    public int deleteMallCmsNoticeById(Long id)
    {
        return mallCmsNoticeMapper.deleteMallCmsNoticeById(id);
    }

    @Override
    public List<IndexNoticeVO> indexSelectMallCmsNoticeList(MallCmsNotice mallCmsNotice) {

        return mallCmsNoticeMapper.indexSelectMallCmsNoticeList(mallCmsNotice);
    }
}
