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.PlayletUserItemMapper;
import com.playlet.system.domain.PlayletUserItem;
import com.playlet.system.service.IPlayletUserItemService;
import com.playlet.common.core.text.Convert;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 用户推广短剧Service业务层处理
 *
 * @author ruoyi
 * @date 2024-04-15
 */
@Service
public class PlayletUserItemServiceImpl extends ServiceImpl<PlayletUserItemMapper, PlayletUserItem> implements IPlayletUserItemService
{
    @Autowired
    private PlayletUserItemMapper playletUserItemMapper;

    /**
     * 查询用户推广短剧
     *
     * @param id 用户推广短剧主键
     * @return 用户推广短剧
     */
    @Override
    public PlayletUserItem selectPlayletUserItemById(Long id)
    {
        return playletUserItemMapper.selectPlayletUserItemById(id);
    }

    /**
     * 查询用户推广短剧列表
     *
     * @param playletUserItem 用户推广短剧
     * @return 用户推广短剧
     */
    @Override
    public List<PlayletUserItem> selectPlayletUserItemList(PlayletUserItem playletUserItem)
    {
        return playletUserItemMapper.selectPlayletUserItemList(playletUserItem);
    }

    /**
     * 新增用户推广短剧
     *
     * @param playletUserItem 用户推广短剧
     * @return 结果
     */
    @Override
    public int insertPlayletUserItem(PlayletUserItem playletUserItem)
    {
        playletUserItem.setCreateTime(DateUtils.getNowDate());
        return playletUserItemMapper.insertPlayletUserItem(playletUserItem);
    }

    /**
     * 修改用户推广短剧
     *
     * @param playletUserItem 用户推广短剧
     * @return 结果
     */
    @Override
    public int updatePlayletUserItem(PlayletUserItem playletUserItem)
    {
        playletUserItem.setUpdateTime(DateUtils.getNowDate());
        return playletUserItemMapper.updatePlayletUserItem(playletUserItem);
    }

    /**
     * 批量删除用户推广短剧
     *
     * @param ids 需要删除的用户推广短剧主键
     * @return 结果
     */
    @Override
    public int deletePlayletUserItemByIds(String ids)
    {
        return playletUserItemMapper.deletePlayletUserItemByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户推广短剧信息
     *
     * @param id 用户推广短剧主键
     * @return 结果
     */
    @Override
    public int deletePlayletUserItemById(Long id)
    {
        return playletUserItemMapper.deletePlayletUserItemById(id);
    }
}
