<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.github.wxiaoqi.security.admin.mapper.AppUserPositionMapper">

	<!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.github.wxiaoqi.security.admin.entity.AppUserPosition" id="appUserPositionMap">
        <result property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="level" column="level"/>
        <result property="number" column="number"/>
        <result property="extract" column="extract"/>
        <result property="status" column="status"/>
        <result property="crtTime" column="crt_time"/>
        <result property="updTime" column="upd_time"/>
        <result property="isDel" column="is_del"/>
    </resultMap>

    <select id="getExtractByUserId" resultMap="appUserPositionMap">
       SELECT p.* FROM app_user_detail d LEFT JOIN app_user_position p
       ON d.position_id=p.id
       WHERE d.userid=#{userId} LIMIT 1
    </select>
</mapper>