拓恒统一认证授权服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
2.4KB

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.tuoheng.mapper.op.MenusMapper">
  6. <resultMap id="BaseResultMap" type="com.tuoheng.model.entity.Menu">
  7. <id property="id" column="id" jdbcType="INTEGER"/>
  8. <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
  9. <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
  10. <result property="createUser" column="create_user" jdbcType="INTEGER"/>
  11. <result property="updateUser" column="update_user" jdbcType="INTEGER"/>
  12. <result property="mark" column="mark" jdbcType="TINYINT"/>
  13. <result property="parentId" column="parent_id" jdbcType="INTEGER"/>
  14. <result property="name" column="name" jdbcType="VARCHAR"/>
  15. <result property="clientId" column="client_id" jdbcType="VARCHAR"/>
  16. <result property="menuIcon" column="menu_icon" jdbcType="VARCHAR"/>
  17. <result property="path" column="path" jdbcType="VARCHAR"/>
  18. <result property="component" column="component" jdbcType="VARCHAR"/>
  19. <result property="target" column="target" jdbcType="VARCHAR"/>
  20. <result property="isHidden" column="is_hidden" jdbcType="INTEGER"/>
  21. <result property="sort" column="sort" jdbcType="INTEGER"/>
  22. <result property="status" column="status" jdbcType="INTEGER"/>
  23. </resultMap>
  24. <sql id="Base_Column_List">
  25. id,create_time,update_time,
  26. create_user,update_user,mark,
  27. parent_id,name,client_id,
  28. menu_icon,path,component,
  29. target,is_hidden,sort,status
  30. </sql>
  31. <!--根据角色id获取对应的菜单集合 无父级-->
  32. <select id="getOpMenusByRoleId" resultType="com.tuoheng.model.entity.Menu">
  33. select
  34. <include refid="Base_Column_List"/>
  35. from op_menus
  36. where mark = 1 and parent_id = 0
  37. and status = 1
  38. and id in (select menu_id from op_role_menu where role_id = #{roleId} and mark = 1)
  39. order by sort asc
  40. </select>
  41. <!--根据父级id查询所属对应的菜单列表-->
  42. <select id="getChildrenMenuByPid" resultType="com.tuoheng.model.entity.Menu">
  43. select
  44. <include refid="Base_Column_List"/>
  45. from op_menus
  46. where mark = 1 and status = 1 and parent_id = #{parentId}
  47. order by sort asc
  48. </select>
  49. </mapper>