package com.playlet.system.service.impl;

import java.util.List;
import com.playlet.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.playlet.system.mapper.PlayletBannerMapper;
import com.playlet.system.domain.PlayletBanner;
import com.playlet.system.service.IPlayletBannerService;
import com.playlet.common.core.text.Convert;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 短剧广告管理Service业务层处理
 *
 * @author ruoyi
 * @date 2024-03-10
 */
@Service
public class PlayletBannerServiceImpl extends ServiceImpl<PlayletBannerMapper, PlayletBanner> implements IPlayletBannerService
{
    @Autowired
    private PlayletBannerMapper playletBannerMapper;

    /**
     * 查询短剧广告管理
     *
     * @param id 短剧广告管理主键
     * @return 短剧广告管理
     */
    @Override
    public PlayletBanner selectPlayletBannerById(Long id)
    {
        return playletBannerMapper.selectPlayletBannerById(id);
    }

    /**
     * 查询短剧广告管理列表
     *
     * @param playletBanner 短剧广告管理
     * @return 短剧广告管理
     */
    @Override
    public List<PlayletBanner> selectPlayletBannerList(PlayletBanner playletBanner)
    {
        return playletBannerMapper.selectPlayletBannerList(playletBanner);
    }

    /**
     * 新增短剧广告管理
     *
     * @param playletBanner 短剧广告管理
     * @return 结果
     */
    @Override
    public int insertPlayletBanner(PlayletBanner playletBanner)
    {
        playletBanner.setCreateTime(DateUtils.getNowDate());
        return playletBannerMapper.insertPlayletBanner(playletBanner);
    }

    /**
     * 修改短剧广告管理
     *
     * @param playletBanner 短剧广告管理
     * @return 结果
     */
    @Override
    public int updatePlayletBanner(PlayletBanner playletBanner)
    {
        playletBanner.setUpdateTime(DateUtils.getNowDate());
        return playletBannerMapper.updatePlayletBanner(playletBanner);
    }

    /**
     * 批量删除短剧广告管理
     *
     * @param ids 需要删除的短剧广告管理主键
     * @return 结果
     */
    @Override
    public int deletePlayletBannerByIds(String ids)
    {
        return playletBannerMapper.deletePlayletBannerByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除短剧广告管理信息
     *
     * @param id 短剧广告管理主键
     * @return 结果
     */
    @Override
    public int deletePlayletBannerById(Long id)
    {
        return playletBannerMapper.deletePlayletBannerById(id);
    }
}
