<?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.shkj.system.mapper.SysUserBranchMapper">

    <insert id="batchUserBranch">
        insert into sys_user_branch(user_id, branch_id) values
        <foreach item="item" index="index" collection="list" separator=",">
            (#{item.userId},#{item.branchId})
        </foreach>
    </insert>
    <delete id="deleteUserBranchByUserId" parameterType="java.lang.Long">
        delete from sys_user_branch where user_id=#{userId}
    </delete>
    <delete id="deleteUserBranch" parameterType="Long">
        delete from sys_user_branch where user_id in
        <foreach collection="array" item="userId" open="(" separator="," close=")">
            #{userId}
        </foreach>
    </delete>
</mapper>