首页 > 其他 > 详细

Mybatis -- 批量添加 -- insertBatch

时间:2017-04-26 15:10:23      阅读:1098      评论:0      收藏:0      [点我收藏+]

啦啦啦

---------------InsertBatch

Class : Dao

    /**
     * 批量插入perfEnvirons
     * 
     * @author Liang
     *
     * 2017年4月25日
     */
    void insertBatch(List<PerfEnviron> perfEnvirons);

XML : 

    <insert id="insertBatch">
        INSERT INTO perf_environ(node_id,`type`,perf_time,pm25_h,pm10_h,temp_h,humi_h,co2_h,tvoc_h)
        VALUES
        <foreach collection="list" close="" index="index" item="item" open="" separator=",">
        (#{item.nodeId},#{item.type},#{item.perfTime},#{item.pm25H},#{item.pm10H},#{item.tempH},#{item.humiH},#{item.co2H},#{item.tvocH})
        </foreach>
    </insert>

啦啦啦

---------------

Mybatis -- 批量添加 -- insertBatch

原文:http://www.cnblogs.com/ClassNotFoundException/p/6768426.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!