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

/**
 * 用户登录记录Service业务层处理
 *
 * @author ruoyi
 * @date 2024-05-05
 */
@Service
public class PlayletUserLoginServiceImpl extends ServiceImpl<PlayletUserLoginMapper, PlayletUserLogin> implements IPlayletUserLoginService
{
    @Autowired
    private PlayletUserLoginMapper playletUserLoginMapper;

    /**
     * 查询用户登录记录
     *
     * @param id 用户登录记录主键
     * @return 用户登录记录
     */
    @Override
    public PlayletUserLogin selectPlayletUserLoginById(Long id)
    {
        return playletUserLoginMapper.selectPlayletUserLoginById(id);
    }

    /**
     * 查询用户登录记录列表
     *
     * @param playletUserLogin 用户登录记录
     * @return 用户登录记录
     */
    @Override
    public List<PlayletUserLogin> selectPlayletUserLoginList(PlayletUserLogin playletUserLogin)
    {
        return playletUserLoginMapper.selectPlayletUserLoginList(playletUserLogin);
    }

    /**
     * 新增用户登录记录
     *
     * @param playletUserLogin 用户登录记录
     * @return 结果
     */
    @Override
    public int insertPlayletUserLogin(PlayletUserLogin playletUserLogin)
    {
        playletUserLogin.setCreateTime(DateUtils.getNowDate());
        return playletUserLoginMapper.insertPlayletUserLogin(playletUserLogin);
    }

    /**
     * 修改用户登录记录
     *
     * @param playletUserLogin 用户登录记录
     * @return 结果
     */
    @Override
    public int updatePlayletUserLogin(PlayletUserLogin playletUserLogin)
    {
        playletUserLogin.setUpdateTime(DateUtils.getNowDate());
        return playletUserLoginMapper.updatePlayletUserLogin(playletUserLogin);
    }

    /**
     * 批量删除用户登录记录
     *
     * @param ids 需要删除的用户登录记录主键
     * @return 结果
     */
    @Override
    public int deletePlayletUserLoginByIds(String ids)
    {
        return playletUserLoginMapper.deletePlayletUserLoginByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户登录记录信息
     *
     * @param id 用户登录记录主键
     * @return 结果
     */
    @Override
    public int deletePlayletUserLoginById(Long id)
    {
        return playletUserLoginMapper.deletePlayletUserLoginById(id);
    }
}
