<?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">
<mapper namespace="org.jeecg.modules.system.mapper.SysRoleMapper">


	<select id="getRoleIdList" resultType="java.lang.String">
            SELECT permissions FROM sys_role WHERE 1 = 1
		<if test="str != null">
			and id in
			<foreach collection="str" item="item" index="index" open="(" close=")" separator=",">
				#{item}
			</foreach>
		</if>
	</select>

	<select id="getRoleIdList1" resultType="java.lang.String">
		SELECT permissions FROM sys_role WHERE 1 = 1
        AND id in (select role_id from sys_user_role where user_id = #{id})
	</select>
    <select id="getByUserId" resultType="org.jeecg.modules.system.entity.SysRole">
		SELECT * FROM sys_role a
			LEFT JOIN sys_user_role b ON b.role_id = a.id
			LEFT JOIN sys_user c ON b.user_id = c.id
		WHERE c.id = #{id}
	</select>
</mapper>