package com.ruoyi.model.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.model.mapper.AppletBannerMapper;
import com.ruoyi.model.domain.AppletBanner;
import com.ruoyi.model.service.IAppletBannerService;

/**
 * 轮播图Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-30
 */
@Service
public class AppletBannerServiceImpl implements IAppletBannerService 
{
    @Autowired
    private AppletBannerMapper appletBannerMapper;

    /**
     * 查询轮播图
     * 
     * @param id 轮播图主键
     * @return 轮播图
     */
    @Override
    public AppletBanner selectAppletBannerById(Long id)
    {
        return appletBannerMapper.selectAppletBannerById(id);
    }

    /**
     * 查询轮播图列表
     * 
     * @param appletBanner 轮播图
     * @return 轮播图
     */
    @Override
    public List<AppletBanner> selectAppletBannerList(AppletBanner appletBanner)
    {
        return appletBannerMapper.selectAppletBannerList(appletBanner);
    }

    /**
     * 新增轮播图
     * 
     * @param appletBanner 轮播图
     * @return 结果
     */
    @Override
    public int insertAppletBanner(AppletBanner appletBanner)
    {
        appletBanner.setCreateTime(DateUtils.getNowDate());
        return appletBannerMapper.insertAppletBanner(appletBanner);
    }

    /**
     * 修改轮播图
     * 
     * @param appletBanner 轮播图
     * @return 结果
     */
    @Override
    public int updateAppletBanner(AppletBanner appletBanner)
    {
        appletBanner.setUpdateTime(DateUtils.getNowDate());
        return appletBannerMapper.updateAppletBanner(appletBanner);
    }

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

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