All Downloads are FREE. Search and download functionalities are using the official Maven repository.

mapper.core.SysRoleMapper.xml Maven / Gradle / Ivy

The newest version!
<?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="com.ape9527.core.mapper.SysRoleMapper">

    <select id="getPermissions" resultType="java.lang.String">
        SELECT DISTINCT
            substring(
                SUBSTRING_INDEX( SUBSTRING_INDEX( substring( r.permissions, 2, length( r.permissions )-2 ), ',', b.help_topic_id + 1 ), ',', -1),
                2,
                length(
                    SUBSTRING_INDEX( SUBSTRING_INDEX( substring( r.permissions, 2, length( r.permissions )-2 ), ',', b.help_topic_id + 1 ), ',', -1)
                )-2
            ) as permission
        FROM
            sys_role r
        JOIN mysql.help_topic b ON b.help_topic_id &lt; ( length( r.permissions ) - length( REPLACE ( r.permissions, ',', '' )) + 1 )
        WHERE
            role_code IN (
                <foreach collection="roles" item="role" separator=",">
                    #{role}
                </foreach>
            )
    </select>
</mapper>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy