package com.ruoyi.xq.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.xq.domain.UserLogin;
import com.ruoyi.xq.mapper.UserLoginMapper;
import com.ruoyi.xq.service.UserLoginService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 用户登陆Service业务层处理
 *
 * @author 77
 * @date 2024-03-04
 */
@RequiredArgsConstructor
@Service
public class UserLoginServiceImpl extends ServiceImpl<UserLoginMapper,UserLogin> implements UserLoginService {

    @Override
    public UserLogin getByUserId(Long userId) {
        return this.getOne(Wrappers.lambdaQuery(UserLogin.class).eq(UserLogin::getUserId, userId).last("limit 1"));
    }
}
