package com.qnfhq.modules.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qnfhq.common.service.impl.BaseServiceImpl;
import com.qnfhq.modules.user.dao.AppUserDetailDao;
import com.qnfhq.modules.user.entity.AppUserDetailEntity;
import com.qnfhq.modules.user.entity.AppUserEntity;
import com.qnfhq.modules.user.service.AppUserDetailService;
import cn.hutool.core.util.StrUtil;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 用户详细信息
 *
 * @author yelz 30262728@qq.com
 * @since 1.0.0 2025-11-13
 */
@Service
public class AppUserDetailServiceImpl extends BaseServiceImpl<AppUserDetailDao, AppUserDetailEntity> implements AppUserDetailService {


//    public QueryWrapper<AppUserDetailEntity> getWrapper(Map<String, Object> params){
//        String id = (String)params.get("id");
//
//        QueryWrapper<AppUserDetailEntity> wrapper = new QueryWrapper<>();
//        wrapper.eq(StrUtil.isNotBlank(id), "id", id);
//
//        return wrapper;
//    }

    @Override
    public AppUserDetailEntity selectAppUserDetailByUserId(long userId) {
        return baseDao.selectOne(new LambdaQueryWrapper<AppUserDetailEntity>()
                .eq(AppUserDetailEntity::getUserId, userId)
                .last(" limit 1")
        );
    }


}