• mybatis批量插入


    <insert id="insertBatch" parameterType="java.util.List" >
            insert into biz_indexes_day (company_code, type,
            record_date, idx501, idx502,
            idx503, idx504, idx505,
            idx506, idx507, idx508,
            idx509, idx510, idx511,
            idx512, idx513, idx514,
            idx515, idx516, idx517,
            idx518, idx519, idx520,
            idx521, idx522, idx523,
            idx524, idx525, idx526,
            idx527, idx528, idx529,
            idx530, gtm_create, gtm_modify
            )
            values  <foreach collection="array" item="obj" index="index" separator=",">
            (#{obj.companyCode,jdbcType=VARCHAR}, #{obj.type,jdbcType=CHAR},
            #{obj.recordDate,jdbcType=CHAR}, #{obj.idx501,jdbcType=DOUBLE}, #{obj.idx502,jdbcType=DOUBLE},
            #{obj.idx503,jdbcType=DOUBLE}, #{obj.idx504,jdbcType=DOUBLE}, #{obj.idx505,jdbcType=DOUBLE},
            #{obj.idx506,jdbcType=DOUBLE}, #{obj.idx507,jdbcType=DOUBLE}, #{obj.idx508,jdbcType=DOUBLE},
            #{obj.idx509,jdbcType=DOUBLE}, #{obj.idx510,jdbcType=DOUBLE}, #{obj.idx511,jdbcType=DOUBLE},
            #{obj.idx512,jdbcType=DOUBLE}, #{obj.idx513,jdbcType=DOUBLE}, #{obj.idx514,jdbcType=DOUBLE},
            #{obj.idx515,jdbcType=DOUBLE}, #{obj.idx516,jdbcType=DOUBLE}, #{obj.idx517,jdbcType=DOUBLE},
            #{obj.idx518,jdbcType=DOUBLE}, #{obj.idx519,jdbcType=DOUBLE}, #{obj.idx520,jdbcType=DOUBLE},
            #{obj.idx521,jdbcType=DOUBLE}, #{obj.idx522,jdbcType=DOUBLE}, #{obj.idx523,jdbcType=DOUBLE},
            #{obj.idx524,jdbcType=DOUBLE}, #{obj.idx525,jdbcType=DOUBLE}, #{obj.idx526,jdbcType=DOUBLE},
            #{obj.idx527,jdbcType=DOUBLE}, #{obj.idx528,jdbcType=DOUBLE}, #{obj.idx529,jdbcType=DOUBLE},
            #{obj.idx530,jdbcType=DOUBLE}, #{obj.gtmCreate,jdbcType=TIMESTAMP}, #{obj.gtmModify,jdbcType=TIMESTAMP}
            )
        </foreach>
        </insert>

    mapper:

    void insertBatch(BizIndexesDay[] bizIndexes);
  • 相关阅读:
    rowkey设计原则和方法
    ubuntu安装及使用
    sqoop数据迁移
    Hive 自定义UDF操作步骤
    hive之数据导入导出
    MySQL优化
    MongoDB、Redis、elasticSearch、hbase的对比
    数据库基本操作
    count(*) 和 count(1)和count(列名)区别
    BigDecimal的运算——加减乘除
  • 原文地址:https://www.cnblogs.com/grey-wolf/p/6962712.html
Copyright © 2020-2023  润新知