<?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.ebts.generator.dao.SearchTableRoleDao">

    <resultMap type="com.ebts.generator.entity.SearchTableRole" id="SearchTableRoleResult">
        <result property="searchTableId"    column="search_table_id"    />
        <result property="roleId"    column="role_id"    />
    </resultMap>

    <delete id="deleteSearchTableRoleById" parameterType="Long">
        delete from gen_search_table_role where search_table_id = #{searchTableId}
    </delete>

    <delete id="deleteSearchTableRoleByIds" parameterType="String">
        delete from gen_search_table_role where search_table_id in
        <foreach item="searchTableId" collection="array" open="(" separator="," close=")">
            #{searchTableId}
        </foreach>
    </delete>
    <insert id="batchSearchTableRole">
        insert into gen_search_table_role (search_table_id, role_id) values
        <foreach collection="list" separator="," item="item" index="index">
            (#{item.searchTableId},#{item.roleId})
        </foreach>
    </insert>
</mapper>