List-mybatis批量插入数据(id自增/非自增)

 
        
	      SELECT LAST_INSERT_ID()
	    
    insert into mmall_order_item (id, order_no,user_id, product_id,
      product_name, product_image, current_unit_price,
      quantity, total_price, create_time,
      update_time)
    values
    
      (
      #{item.orderNo},#{item.userId},#{item.productId},#{item.productName},#{item.productImage},#{item.currentUnitPrice},#{item.quantity},#{item.totalPrice},now(),now()
      )
    
  

    insert into mmall_order_item (id, order_no,user_id, product_id,
      product_name, product_image, current_unit_price,
      quantity, total_price, create_time,
      update_time)
    values
    
      (
      #{item.id},#{item.orderNo},#{item.userId},#{item.productId},#{item.productName},#{item.productImage},#{item.currentUnitPrice},#{item.quantity},#{item.totalPrice},now(),now()
      )
    
  

你可能感兴趣的:(java)