<?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="cn.fateverse.query.mapper.TableRoleMapper">

    <insert id="batchInsert">
        insert into table_role (table_id, role_id) VALUES
        <foreach collection="list" item="item" separator=",">
            (#{item.tableId},#{item.roleId})
        </foreach>
    </insert>


    <select id="selectByTableId" resultType="cn.fateverse.query.entity.TableRole">
        select table_id, role_id from table_role where table_id = #{tableId}
    </select>


    <delete id="deleteByTableId">
        delete from table_role where table_id = #{tableId}
    </delete>

</mapper>