package org.wcs.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.wcs.model.po.app.AppBaseUser;
import org.wcs.model.po.app.JoinUserInfoWithGroupInfo;

import java.util.List;

@Mapper
public interface AppBaseUserMapper extends BaseMapper<AppBaseUser> {

    @Select("SELECT u.*, g.group_name, g.group_level FROM t_app_base_user u LEFT JOIN t_app_base_user_group g ON u.user_group = g.user_group WHERE g.group_status = 1 AND u.user_id = #{userId}")
    List<JoinUserInfoWithGroupInfo> queryUserInfoAndGroupInfo(String userId);

}
