• mybatis插入List<Map<String, String>>批量数据到Oracle数据库


    数据结构为List<Map<String, String>>,list中每个map为一条数据记录,需用mybatis将其插入到Oracle数据库。

    mapper接口

    public void insertEngineEBOMTemp(@Param("paramMapList")List<Map<String, ?>> jsonMapList);

    mapper.xml

    <insert id="insertEngineEBOMTemp" parameterType="list">
            begin
            <foreach collection="paramMapList" item="paramMap" separator="">
            INSERT into TT_ENGINE_EBOM_FROM_TC 
            (
                ENGINE_EBOM_TC_ID,
                ENGINE_TYPE,
                FUNCTION_MODULE,
                GROUP_ZU,
                PART_CODE,
                PART_NAME,
                PART_NAME_EN,
                VERSION,
                PART_NUM,
                SUBSTITUTE_LIST,
                PUBLISH_DATE,
                PART_PHASE,
                PART_IMPORTANCE_LEVEL,
                PART_RESPONSIBLE_PERSON,
                PART_USE_POSITION,
                REFERENCE_TIGHTENING_TORQUE,
                REMARK
            )
            VALUES
            (
                SEQ_TT_ENGINE_EBOM_TC_ID.nextval,
                #{paramMap.ENGINE_TYPE, jdbcType=VARCHAR},
                #{paramMap.FUNCTION_MODULE, jdbcType=VARCHAR},
                #{paramMap.GROUP_ZU, jdbcType=VARCHAR},
                #{paramMap.PART_CODE, jdbcType=VARCHAR},
                #{paramMap.PART_NAME, jdbcType=VARCHAR},
                #{paramMap.PART_NAME_EN, jdbcType=VARCHAR},
                #{paramMap.VERSION, jdbcType=VARCHAR},
                #{paramMap.PART_NUM, jdbcType=VARCHAR},
                #{paramMap.SUBSTITUTE_LIST, jdbcType=VARCHAR},
                #{paramMap.PUBLISH_DATE, jdbcType=VARCHAR},
                #{paramMap.PART_PHASE, jdbcType=VARCHAR},
                #{paramMap.PART_IMPORTANCE_LEVEL, jdbcType=VARCHAR},
                #{paramMap.PART_RESPONSIBLE_PERSON, jdbcType=VARCHAR},
                #{paramMap.PART_USE_POSITION, jdbcType=VARCHAR},
                #{paramMap.REFERENCE_TIGHTENING_TORQUE, jdbcType=VARCHAR},
                #{paramMap.REMARK, jdbcType=VARCHAR}
            );
            </foreach>
            commit;
            end;
        </insert>
  • 相关阅读:
    WCF获取客户端IP,端口
    关闭应用程序(主程序)(WPF)
    WPF中自定义漂亮的进度条
    使用Silverlight4与Wcf4的Net.tcp实现的简单聊天室
    NET使用Js调用WebService
    [转]IBM服务器系列产品分类指南
    [转]delphi 变参函数:array of const
    [转]合并BPL包图文教程!
    [转]ABAP流程处理控制命令的说明
    [转]QR代码(Quick Response Code)简介
  • 原文地址:https://www.cnblogs.com/alphajuns/p/12305228.html
Copyright © 2020-2023  润新知