<?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.njzscloud.supervisory.sys.resource.mapper.ResourceMapper">
    <select id="occupied" resultType="java.lang.String">
        SELECT DISTINCT c.role_name
        FROM sys_resource a
        INNER JOIN sys_role_resource b ON b.res_id = a.id
        INNER JOIN sys_role c ON c.id = b.role_id
        <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
            ${ew.customSqlSegment}
        </if>
    </select>
</mapper>
