<?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.RoleMapper">

    <!--获取角色分页列表-->
    <select id="page" resultType="RoleVO">
        SELECT sys_role.*
        FROM sys_role sys_role
        WHERE ${ew.sqlSegment}
    </select>

    <delete id="deleteUserRole">
        DELETE FROM sys_user_role where role_id in
        <foreach item="item" index="index" collection="ids" open="("
                 separator="," close=")">
            #{item}
        </foreach>
    </delete>

    <delete id="deleteFunctionRole">
        DELETE FROM sys_role_function where role_id in
        <foreach item="item" index="index" collection="ids" open="("
                 separator="," close=")">
            #{item}
        </foreach>
    </delete>

    <delete id="deleteComponentRole">
        DELETE FROM sys_role_component where role_id in
        <foreach item="item" index="index" collection="ids" open="("
                 separator="," close=")">
            #{item}
        </foreach>
    </delete>
</mapper>
