Mybatis使用foreach插入List<Map<>>类型数据

代码示例:
    <insert id="batchSave" parameterType="hashmap">
        insert into t_table
        (id, name)
        values
        <foreach collection="list" item="line" separator=",">
            (
            <foreach collection="line" index="key" item="value"
                     separator=",">
                #{key},
                #{value}
            </foreach>
            )
        </foreach>
    </insert>
posted @ 2021-12-01 14:16  丶六千里  阅读(556)  评论(0)    收藏  举报