<?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="jnpf.authority.mapper.FtbPermissionFunctionMenuMapper">

    <select id="getAListOfSubPages" resultType="jnpf.model.authority.vo.menu.FtbPermissionFunctionMenuVO">
        select
        F_Id as id,
        F_FunctionId as functionId,
        F_FuncCoding as funcCoding,
        F_FunName as funName,
        F_FunType as funType,
        F_ParentId as parentId,
        F_OriginalCoding as originalCoding,
        F_PageType as pageType
        from ftb_permission_function_menu
        where F_ParentId = #{menuId}
    </select>

    <select id="getRoleWithMenu" resultType="jnpf.model.authority.vo.role.FtbPermissionRoleInfoVO">
        SELECT
        a.F_RoleName as roleName,a.F_Id as roleId,a.F_RoleDescription as roleDescription,a.F_IsSuperAdmin as isSuperAdmin,
        GROUP_CONCAT(b.F_FunctionWebId) as functionWebId,GROUP_CONCAT(b.F_FunctionAppId) as functionAppId,
        GROUP_CONCAT(b.F_FunctionPcId) as functionPcId
        FROM
        ftb_permission_role a
        LEFT JOIN ftb_permission_role_menu b ON a.F_Id = b.F_RoleId
        <where>
            a.F_Id = #{roleId}
            and  b.F_RoleEnabled = 1
        </where>
        group by a.F_Id
    </select>
</mapper>