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.PlayletUserMapper;
import com.playlet.system.domain.PlayletUser;
import com.playlet.system.service.IPlayletUserService;
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 PlayletUserServiceImpl extends ServiceImpl<PlayletUserMapper, PlayletUser> implements IPlayletUserService
{
    @Autowired
    private PlayletUserMapper playletUserMapper;

    /**
     * 查询短剧用户
     *
     * @param ID 短剧用户主键
     * @return 短剧用户
     */
    @Override
    public PlayletUser selectPlayletUserByID(Long ID)
    {
        return playletUserMapper.selectPlayletUserByID(ID);
    }

    /**
     * 查询短剧用户列表
     *
     * @param playletUser 短剧用户
     * @return 短剧用户
     */
    @Override
    public List<PlayletUser> selectPlayletUserList(PlayletUser playletUser)
    {
        return playletUserMapper.selectPlayletUserList(playletUser);
    }

    /**
     * 新增短剧用户
     *
     * @param playletUser 短剧用户
     * @return 结果
     */
    @Override
    public int insertPlayletUser(PlayletUser playletUser)
    {
        playletUser.setCreateTime(DateUtils.getNowDate());
        return playletUserMapper.insertPlayletUser(playletUser);
    }

    /**
     * 修改短剧用户
     *
     * @param playletUser 短剧用户
     * @return 结果
     */
    @Override
    public int updatePlayletUser(PlayletUser playletUser)
    {
        playletUser.setUpdateTime(DateUtils.getNowDate());
        return playletUserMapper.updatePlayletUser(playletUser);
    }

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

    /**
     * 删除短剧用户信息
     *
     * @param ID 短剧用户主键
     * @return 结果
     */
    @Override
    public int deletePlayletUserByID(Long ID)
    {
        return playletUserMapper.deletePlayletUserByID(ID);
    }
}
