批量插入写法

 

 

  <insert id="batchInsert" parameterType="list">
        INSERT INTO AC_OPERATOR_ROLE (OPERATOR_ID, ROLE_ID) VALUES

        <foreach collection="list" item="record" index="index" separator=",">

            ( #{record.OPERATOR_ID}, #{record.ROLE_ID} )

        </foreach>

    </insert>

 

可参考:http://blog.csdn.net/lin910429/article/details/38401061

posted @ 2015-10-16 09:39  剑握在手  阅读(192)  评论(0编辑  收藏  举报
返回顶部↑