package com.ruoyi.mall.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.mall.mapper.MallPurchaseNotesMapper;
import com.ruoyi.mall.domain.MallPurchaseNotes;
import com.ruoyi.mall.service.IMallPurchaseNotesService;

/**
 * 购买须知Service业务层处理
 *
 * @author ruoyi
 * @date 2022-07-06
 */
@Service
public class MallPurchaseNotesServiceImpl implements IMallPurchaseNotesService
{
    @Autowired
    private MallPurchaseNotesMapper mallPurchaseNotesMapper;

    /**
     * 查询购买须知
     *
     * @param id 购买须知主键
     * @return 购买须知
     */
    @Override
    public MallPurchaseNotes selectMallPurchaseNotesById(Integer id)
    {
        return mallPurchaseNotesMapper.selectMallPurchaseNotesById(id);
    }

    /**
     * 查询购买须知列表
     *
     * @param mallPurchaseNotes 购买须知
     * @return 购买须知
     */
    @Override
    public List<MallPurchaseNotes> selectMallPurchaseNotesList(MallPurchaseNotes mallPurchaseNotes)
    {
        return mallPurchaseNotesMapper.selectMallPurchaseNotesList(mallPurchaseNotes);
    }

    /**
     * 新增购买须知
     *
     * @param mallPurchaseNotes 购买须知
     * @return 结果
     */
    @Override
    public int insertMallPurchaseNotes(MallPurchaseNotes mallPurchaseNotes)
    {
        mallPurchaseNotes.setCreateAt(DateUtils.getTime());
        return mallPurchaseNotesMapper.insertMallPurchaseNotes(mallPurchaseNotes);
    }

    /**
     * 修改购买须知
     *
     * @param mallPurchaseNotes 购买须知
     * @return 结果
     */
    @Override
    public int updateMallPurchaseNotes(MallPurchaseNotes mallPurchaseNotes)
    {
        mallPurchaseNotes.setUpdateAt(DateUtils.getTime());
        return mallPurchaseNotesMapper.updateMallPurchaseNotes(mallPurchaseNotes);
    }

    /**
     * 批量删除购买须知
     *
     * @param ids 需要删除的购买须知主键
     * @return 结果
     */
    @Override
    public int deleteMallPurchaseNotesByIds(Integer[] ids)
    {
        return mallPurchaseNotesMapper.deleteMallPurchaseNotesByIds(ids);
    }

    /**
     * 删除购买须知信息
     *
     * @param id 购买须知主键
     * @return 结果
     */
    @Override
    public int deleteMallPurchaseNotesById(Integer id)
    {
        return mallPurchaseNotesMapper.deleteMallPurchaseNotesById(id);
    }
}
