mybatis插入list<map>示例

<insert id="saveListMapData" parameterType="java.util.Map">
        <foreach collection="listMap" item="map" separator=";">
            insert into ${tableName} (
            <foreach collection="map" item="value" index="key" separator=",">
                ${key}
            </foreach>
            )
            values (
            <foreach collection="map" item="value" index="key" separator=",">
                #{value}
            </foreach>
            )
        </foreach>
 </insert>

 这种写法使用很少,基本用不到,只是想到了记录下该如何使用

posted @ 2024-03-14 15:01  LUDAGOGO  阅读(554)  评论(0)    收藏  举报