|
@@ -1,23 +1,95 @@
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<?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">
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.simuwang.base.mapper.SysUserMapper">
|
|
<mapper namespace="com.simuwang.base.mapper.SysUserMapper">
|
|
- <select id=""></select>
|
|
|
|
-
|
|
|
|
<select id="selectRoleByUserId" resultType="com.simuwang.base.pojo.dos.SysRoleDO">
|
|
<select id="selectRoleByUserId" resultType="com.simuwang.base.pojo.dos.SysRoleDO">
|
|
- select t.role_id as roleId,
|
|
|
|
- t.role_name as roleName,
|
|
|
|
- t.role_key as roleKey,
|
|
|
|
- t.role_sort as roleSort,
|
|
|
|
- t.status as status,
|
|
|
|
|
|
+ select t.role_id as roleId,
|
|
|
|
+ t.role_name as roleName,
|
|
|
|
+ t.role_key as roleKey,
|
|
|
|
+ t.role_sort as roleSort,
|
|
|
|
+ t.status as status,
|
|
|
|
+ t.data_scope as dataScope,
|
|
|
|
+ t.remark,
|
|
|
|
+ t.creatorid as creatorId,
|
|
|
|
+ t.createtime as createTime,
|
|
|
|
+ t.updaterid as updaterId,
|
|
|
|
+ t.updatetime as updateTime
|
|
|
|
+ from sys_role t
|
|
|
|
+ join sys_user_role t1 on t.role_id = t1.role_id
|
|
|
|
+ join sys_user t2 on t1.user_id = t2.user_id and t2.isvalid = 1
|
|
|
|
+ where t2.user_id = #{userId}
|
|
|
|
+ and t.isvalid = 1
|
|
|
|
+ order by t.role_id
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectAllRole" resultType="com.simuwang.base.pojo.dos.SysRoleDO">
|
|
|
|
+ select t.role_id as roleId,
|
|
|
|
+ t.role_name as roleName,
|
|
|
|
+ t.role_key as roleKey,
|
|
|
|
+ t.role_sort as roleSort,
|
|
|
|
+ t.status as status,
|
|
t.data_scope as dataScope,
|
|
t.data_scope as dataScope,
|
|
t.remark,
|
|
t.remark,
|
|
- t.creatorid as creatorId,
|
|
|
|
|
|
+ t.creatorid as creatorId,
|
|
t.createtime as createTime,
|
|
t.createtime as createTime,
|
|
- t.updaterid as updaterId,
|
|
|
|
|
|
+ t.updaterid as updaterId,
|
|
t.updatetime as updateTime
|
|
t.updatetime as updateTime
|
|
from sys_role t
|
|
from sys_role t
|
|
- join sys_user_role t1 on t.role_id = t1.role_id
|
|
|
|
- join sys_user t2 on t1.user_id = t2.user_id and t2.isvalid = 1
|
|
|
|
- where t2.user_id = #{userId} and t.isvalid = 1
|
|
|
|
|
|
+ where t.isvalid = 1
|
|
|
|
+ order by t.role_id
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectMenuByUserId" resultType="com.simuwang.base.pojo.dos.SysMenuDO">
|
|
|
|
+ select sm.menu_id as menuId,
|
|
|
|
+ sm.menu_name as menuName,
|
|
|
|
+ sm.parent_id as parentId,
|
|
|
|
+ sm.perms as perms,
|
|
|
|
+ sm.icon as icon,
|
|
|
|
+ sm.order_num as orderNum,
|
|
|
|
+ sm.path as path,
|
|
|
|
+ sm.component as component,
|
|
|
|
+ sm.query as query,
|
|
|
|
+ sm.is_frame as isFrame,
|
|
|
|
+ sm.is_cache as isCache,
|
|
|
|
+ sm.menu_type as menuType,
|
|
|
|
+ sm.visible as visible,
|
|
|
|
+ sm.status as status,
|
|
|
|
+ sm.remark,
|
|
|
|
+ sm.creatorid as creatorId,
|
|
|
|
+ sm.createtime as createTime,
|
|
|
|
+ sm.updaterid as updaterId,
|
|
|
|
+ sm.updatetime as updateTime
|
|
|
|
+ from sys_menu sm
|
|
|
|
+ join sys_role_menu srm on sm.menu_id = srm.menu_id
|
|
|
|
+ join sys_role sr on sr.role_id = srm.role_id and sr.isvalid = 1
|
|
|
|
+ join sys_user_role t1 on sr.role_id = t1.role_id
|
|
|
|
+ join sys_user t2 on t1.user_id = t2.user_id and t2.isvalid = 1
|
|
|
|
+ where t2.user_id = #{userId}
|
|
|
|
+ and sm.isvalid = 1
|
|
|
|
+ order by sm.menu_id
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectAllMenu" resultType="com.simuwang.base.pojo.dos.SysMenuDO">
|
|
|
|
+ select sm.menu_id as menuId,
|
|
|
|
+ sm.menu_name as menuName,
|
|
|
|
+ sm.parent_id as parentId,
|
|
|
|
+ sm.perms as perms,
|
|
|
|
+ sm.icon as icon,
|
|
|
|
+ sm.order_num as orderNum,
|
|
|
|
+ sm.path as path,
|
|
|
|
+ sm.component as component,
|
|
|
|
+ sm.query as query,
|
|
|
|
+ sm.is_frame as isFrame,
|
|
|
|
+ sm.is_cache as isCache,
|
|
|
|
+ sm.menu_type as menuType,
|
|
|
|
+ sm.visible as visible,
|
|
|
|
+ sm.status as status,
|
|
|
|
+ sm.remark,
|
|
|
|
+ sm.creatorid as creatorId,
|
|
|
|
+ sm.createtime as createTime,
|
|
|
|
+ sm.updaterid as updaterId,
|
|
|
|
+ sm.updatetime as updateTime
|
|
|
|
+ from sys_menu sm
|
|
|
|
+ where sm.isvalid = 1
|
|
|
|
+ order by sm.menu_id
|
|
</select>
|
|
</select>
|
|
</mapper>
|
|
</mapper>
|