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.MallMemberBannerMapper;
import com.ruoyi.mall.domain.MallMemberBanner;
import com.ruoyi.mall.service.IMallMemberBannerService;

/**
 * 用户轮播图Service业务层处理
 *
 * @author ruoyi
 * @date 2024-11-15
 */
@Service
public class MallMemberBannerServiceImpl implements IMallMemberBannerService
{
    @Autowired
    private MallMemberBannerMapper mallMemberBannerMapper;

    /**
     * 查询用户轮播图
     *
     * @param id 用户轮播图主键
     * @return 用户轮播图
     */
    @Override
    public MallMemberBanner selectMallMemberBannerById(Long id)
    {
        return mallMemberBannerMapper.selectMallMemberBannerById(id);
    }

    /**
     * 查询用户轮播图列表
     *
     * @param mallMemberBanner 用户轮播图
     * @return 用户轮播图
     */
    @Override
    public List<MallMemberBanner> selectMallMemberBannerList(MallMemberBanner mallMemberBanner)
    {
        return mallMemberBannerMapper.selectMallMemberBannerList(mallMemberBanner);
    }

    /**
     * 新增用户轮播图
     *
     * @param mallMemberBanner 用户轮播图
     * @return 结果
     */
    @Override
    public int insertMallMemberBanner(MallMemberBanner mallMemberBanner)
    {
        mallMemberBanner.setCreateAt(DateUtils.getTime());
        return mallMemberBannerMapper.insertMallMemberBanner(mallMemberBanner);
    }

    /**
     * 修改用户轮播图
     *
     * @param mallMemberBanner 用户轮播图
     * @return 结果
     */
    @Override
    public int updateMallMemberBanner(MallMemberBanner mallMemberBanner)
    {
        mallMemberBanner.setUpdateAt(DateUtils.getTime());
        return mallMemberBannerMapper.updateMallMemberBanner(mallMemberBanner);
    }

    /**
     * 批量删除用户轮播图
     *
     * @param ids 需要删除的用户轮播图主键
     * @return 结果
     */
    @Override
    public int deleteMallMemberBannerByIds(Long[] ids)
    {
        return mallMemberBannerMapper.deleteMallMemberBannerByIds(ids);
    }

    /**
     * 删除用户轮播图信息
     *
     * @param id 用户轮播图主键
     * @return 结果
     */
    @Override
    public int deleteMallMemberBannerById(Long id)
    {
        return mallMemberBannerMapper.deleteMallMemberBannerById(id);
    }
}
