mapper.core.SysRoleMapper.xml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ape-core Show documentation
Show all versions of ape-core Show documentation
Ape low code platform core module
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 < ( length( r.permissions ) - length( REPLACE ( r.permissions, ',', '' )) + 1 ) WHERE role_code IN ( <foreach collection="roles" item="role" separator=","> #{role} </foreach> ) </select> </mapper>