| | |
| | | <resultMap id="selectUserDetailMap" type="org.springblade.modules.system.vo.UserDetailVO" autoMapping="true"> |
| | | <id property="id" column="id" /> |
| | | <collection property="deptList" javaType="java.util.List" |
| | | ofType="org.springblade.modules.system.entity.Dept" autoMapping="true"> |
| | | ofType="org.springblade.modules.system.vo.DeptDetailVO" autoMapping="true"> |
| | | <id property="id" column="cid"/> |
| | | <id property="level" column="region_level"/> |
| | | </collection> |
| | | </resultMap> |
| | | |
| | |
| | | <select id="getUserInfo" resultMap="selectUserDetailMap"> |
| | | SELECT |
| | | bu.*, |
| | | bd.id as cid,bd.parent_id,bd.ancestors,bd.dept_category,bd.dept_name,bd.full_name,bd.sort,bd.region_code |
| | | bd.id as cid,bd.parent_id,bd.ancestors,bd.dept_category,bd.dept_name,bd.full_name,bd.sort,bd.region_code, |
| | | br.region_level |
| | | FROM blade_user bu |
| | | left join blade_user_dept bud on bud.user_id = bu.id |
| | | left join blade_dept bd on bud.dept_id = bd.id and bd.is_deleted = 0 |
| | | left join blade_region br on br.code = bd.region_code |
| | | where bu.is_deleted = 0 |
| | | and bu.id = #{userId} |
| | | </select> |