package com.ruoyi.cai.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.cai.domain.UserInfo;
import com.ruoyi.cai.mapper.UserInfoMapper;
import com.ruoyi.cai.service.UserInfoService;
import org.springframework.stereotype.Service;

@Service
public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> implements UserInfoService {

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