package com.nokia.hb.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nokia.hb.dao.entity.UserArea;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 用户地区关联表 Mapper 接口
 * </p>
 *
 * @author baomidou
 * @since 2023-02-27
 */
@Mapper
public interface UserAreaMapper extends BaseMapper<UserArea> {
    /**
     * 根据用户名查询拥有的地区权限
     *
     * @param username 用户名
     * @return {@link List}<{@link String}>
     */
    @Select("select distinct area from pm_parse.user_area where username = #{username} order by area")
    List<String> listByUsername(String username);
}
