org.sonar.db.user.RoleMapper.xml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sonar-db-dao Show documentation
Show all versions of sonar-db-dao Show documentation
Open source platform for continuous inspection of code quality
The newest version!
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd"> <mapper namespace="org.sonar.db.user.RoleMapper"> <select id="selectComponentIdsByPermissionAndUserId" parameterType="map" resultType="long"> select ur.resource_id from user_roles ur where ur.user_id = #{userId,jdbcType=INTEGER} and ur.role = #{permission,jdbcType=VARCHAR} and ur.resource_id is not null union select gr.resource_id from group_roles gr inner join groups_users gu on gr.group_id=gu.group_id where gr.role = #{permission,jdbcType=VARCHAR} and gr.resource_id is not null and gu.user_id=#{userId,jdbcType=INTEGER} order by resource_id </select> <delete id="deleteGroupRolesByGroupId" parameterType="int"> delete from group_roles where group_id=#{id,jdbcType=INTEGER} </delete> </mapper>