<?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.cm.common.plugin.dao.authority.IAuthorityDao">

    <!-- 新增人员权限 -->
    <insert id="saveAuthorityUser" parameterType="map">
        INSERT INTO authority_user(
            user_id,
            managed_user_id
        ) VALUES (
            #{userId},
            #{managedUserId}
        )
    </insert>

    <!-- 删除人员权限 -->
    <delete id="deleteAuthorityUser" parameterType="map">
        DELETE FROM
            authority_user
        WHERE
        <if test="userId != null and userId != ''">
            user_id = #{userId}
        </if>
    </delete>

</mapper>