Mybatis 批量插入数据

  int insertBatch(List<PreferProductProfitresultDetailPo> records);
  <insert id="insertBatch" parameterType="java.util.List" >
    insert into t_cmc_calculation_result_detail_info (result_id, create_time,
      last_update_time, create_user_id, last_update_user_id,
      cust_number, total_id, batch_num,
      depart_city, arrive_city, arrive_province,
      product, bill_num, charge_weight,
      discount_income_before, discount_income_after,
      cost, profit, profit_rate,
      settlement_profit, settlement_profit_rate,
      discount, balance_biscount, shipping_cost,
      orig_vehicle_cost, car_trans_cost, sort_cost,
      desc_operate_cost, goods_delivery_cost, market_cost,
      increment_claim_cost, finance_tax_cost, goods_weight,
      goods_volume, weight_bubble_rate, good_receive_cost,
      waybill_deal_cost, department_operate_cost,
      pickup_transcenter_cost, vehicle_transport_cost
      )
    values
    <foreach collection="list" item="detail" index="index" separator=",">
    ( #{detail.resultId,jdbcType=BIGINT},now(),
      #{detail.lastUpdateTime,jdbcType=TIMESTAMP}, #{detail.createUserId,jdbcType=VARCHAR}, #{detail.lastUpdateUserId,jdbcType=VARCHAR},
      #{detail.custNumber,jdbcType=VARCHAR}, #{detail.totalId,jdbcType=INTEGER}, #{detail.batchNum,jdbcType=VARCHAR},
      #{detail.departCity,jdbcType=VARCHAR}, #{detail.arriveCity,jdbcType=VARCHAR}, #{detail.arriveProvince,jdbcType=VARCHAR},
      #{detail.product,jdbcType=VARCHAR}, #{detail.billNum,jdbcType=DECIMAL}, #{detail.chargeWeight,jdbcType=DECIMAL},
      #{detail.discountIncomeBefore,jdbcType=DECIMAL}, #{detail.discountIncomeAfter,jdbcType=DECIMAL},
      #{detail.cost,jdbcType=DECIMAL}, #{detail.profit,jdbcType=DECIMAL}, #{detail.profitRate,jdbcType=DECIMAL},
      #{detail.settlementProfit,jdbcType=DECIMAL}, #{detail.settlementProfitRate,jdbcType=DECIMAL},
      #{detail.discount,jdbcType=DECIMAL}, #{detail.balanceDiscount,jdbcType=DECIMAL}, #{detail.shippingCost,jdbcType=DECIMAL},
      #{detail.origVehicleCost,jdbcType=DECIMAL}, #{detail.carTransCost,jdbcType=DECIMAL}, #{detail.sortCost,jdbcType=DECIMAL},
      #{detail.descOperateCost,jdbcType=DECIMAL}, #{detail.goodsDeliveryCost,jdbcType=DECIMAL}, #{detail.marketCost,jdbcType=DECIMAL},
      #{detail.incrementClaimCost,jdbcType=DECIMAL}, #{detail.financeTaxCost,jdbcType=DECIMAL}, #{detail.goodsWeight,jdbcType=DECIMAL},
      #{detail.goodsVolume,jdbcType=DECIMAL}, #{detail.weightBubbleRate,jdbcType=DECIMAL}, #{detail.goodsReceiveCost,jdbcType=DECIMAL},
      #{detail.waybillDealCost,jdbcType=DECIMAL}, #{detail.departmentOperateCost,jdbcType=DECIMAL},
      #{detail.pickupTranscenterCost,jdbcType=DECIMAL}, #{detail.vehicleTransportCost,jdbcType=DECIMAL}
      )
    </foreach>
  </insert>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值