拓恒统一认证授权服务
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.

42 lines
1.8KB

  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.PermissionsMapper">
  6. <resultMap id="BaseResultMap" type="com.tuoheng.model.entity.Permissions">
  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="clientId" column="client_id" jdbcType="VARCHAR"/>
  14. <result property="code" column="code" jdbcType="VARCHAR"/>
  15. <result property="name" column="name" jdbcType="VARCHAR"/>
  16. <result property="remark" column="remark" jdbcType="VARCHAR"/>
  17. <result property="type" column="type" jdbcType="INTEGER"/>
  18. <result property="menuId" column="menu_id" jdbcType="INTEGER"/>
  19. <result property="apiUrl" column="api_url" jdbcType="VARCHAR"/>
  20. </resultMap>
  21. <sql id="Base_Column_List">
  22. id,create_time,update_time,
  23. create_user,update_user,mark,
  24. client_id,code,name,
  25. remark,type,menu_id,
  26. api_url
  27. </sql>
  28. <!--根据role_id获取对应的权限集合-->
  29. <select id="getOpPermissionsByRoleId" resultType="com.tuoheng.model.entity.Permissions">
  30. select
  31. <include refid="Base_Column_List"/>
  32. from op_permissions
  33. where mark = 1
  34. and id in (select permission_id from op_role_permission where role_id = #{roleId} and mark = 1)
  35. </select>
  36. </mapper>