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.

RoleMapper.xml 1006B

123456789101112131415161718192021222324252627282930313233343536
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd">
  3. <mapper namespace="org.sonar.db.user.RoleMapper">
  4. <select id="selectComponentUuidsByPermissionAndUserUuid" parameterType="map" resultType="String">
  5. select
  6. ur.component_uuid
  7. from
  8. user_roles ur
  9. where
  10. ur.user_uuid = #{userUuid,jdbcType=VARCHAR}
  11. and ur.role = #{permission,jdbcType=VARCHAR}
  12. and ur.component_uuid is not null
  13. union
  14. select
  15. gr.component_uuid
  16. from
  17. group_roles gr
  18. inner join groups_users gu on
  19. gr.group_uuid=gu.group_uuid
  20. where
  21. gr.role = #{permission,jdbcType=VARCHAR}
  22. and gr.component_uuid is not null
  23. and gu.user_uuid=#{userUuid,jdbcType=VARCHAR}
  24. order by
  25. component_uuid
  26. </select>
  27. <delete id="deleteGroupRolesByGroupUuid" parameterType="String">
  28. delete from
  29. group_roles
  30. where
  31. group_uuid=#{uuid,jdbcType=VARCHAR}
  32. </delete>
  33. </mapper>