<?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.njcn.user.mapper.FunctionMapper">

    <select id="getAllFunctions" resultType="FunctionVO">
        SELECT
            Id,Pid,
            `Name` title,
            `Code`,
            Path routePath,
            Icon,Sort,
            Type,
            Remark
        FROM
            sys_function
        WHERE
            STATE = 1 AND Type IN(0,1)
    </select>

    <select id="getFunctionsByList" resultType="FunctionVO">
        SELECT
            Id,Pid,
            `Name` title,
            `Code`,
            Path routePath,
            Icon,Sort,
            Type,
            Remark
        FROM
            sys_function
        WHERE
            STATE = 1 AND Type = 0
        AND
            Id in
            <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
                #{item}
            </foreach>
    </select>

    <select id="getUserFunctionsByList" resultType="FunctionVO">
        SELECT
        Id,Pid,
        `Name` title,
        `Code`,
        Path routePath,
        Icon,Sort,
        Type,
        Remark
        FROM
        sys_function
        WHERE
        STATE = 1 AND Type IN (0,1)
        AND
        Id in
        <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
            #{item}
        </foreach>
    </select>

</mapper>
