package com.ruoyi.cai.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.cai.domain.UnionUser;
import com.ruoyi.cai.dto.admin.vo.UnionUserAdminVo;
import com.ruoyi.cai.mapper.UnionUserMapper;
import com.ruoyi.cai.service.UnionUserService;
import com.ruoyi.common.core.domain.PageQuery;
import org.springframework.stereotype.Service;

/**
 * 123Service业务层处理
 *
 * @author ruoyi
 * @date 2023-12-22
 */
@Service
public class UnionUserServiceImpl extends ServiceImpl<UnionUserMapper, UnionUser> implements UnionUserService {

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

    @Override
    public Page<UnionUserAdminVo> pageAdmin(PageQuery pageQuery, UnionUserAdminVo bo) {
        return baseMapper.pageAdmin(pageQuery.build(),bo);
    }
}
