package com.mosty.base.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mosty.base.service.UserInfoService;
import com.mosty.common.core.business.entity.SysUser;
import com.mosty.common.core.business.mapper.SysUserMapper;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;



@Service
@AllArgsConstructor
public class UserInfoServiceImpl extends ServiceImpl<SysUserMapper, SysUser>
        implements UserInfoService {
    @Override
    public SysUser getUserInfo(String userId) {
        return this.baseMapper.selectById(userId);
    }

    @Override
    public SysUser getUserInfoBySfzh(String sfzh) {
        return this.baseMapper.selectOne(
                new LambdaQueryWrapper<SysUser>()
                        .eq(SysUser::getIdEntityCard, sfzh)
                        .last(" limit 1")
        );
    }

}
