title: MySQLIntegrityConstraintViolationException: Column '' cannot be null
body: <pre><code>mapper:
  &lt;update id="updateSurplusAmountByPrimaryKeyAndMaterialTypeId" 
    parameterType="java.util.List"&gt;
      update db_logistics.table_inventory_material
      set surplusAmount=
      &lt;foreach collection="list" item="item" index="index"
               separator=" " open="case" close="end"&gt;
          when inventoryId=#{item.inventoryId} and materialTypeId=# 
      {item.materialTypeId} then #{item.surplusAmount,jdbcType=INTEGER}
      &lt;/foreach&gt;
      where inventoryId in
      &lt;foreach collection="list" index="index" item="item"
               separator="," open="(" close=")"&gt;
          #{item.inventoryId,jdbcType=BIGINT}
      &lt;/foreach&gt;
  &lt;/update&gt;
   fun updateSurplusAmountByPrimaryKeyAndMaterialTypeId(records: 
  List&lt;InventoryMaterial&gt;): Int
  data class InventoryMaterial(
      var inventoryId: Int = 0,
      var materialTypeId: Int = 0,
      var surplusAmount: Int = 0,
      var consumeSpeed: Float = 0f,
      var consumeAlarmDayCount: Int = 0,
      var updateDataTime: LocalDateTime =  LocalDateTime.now())
  </code></pre>
  
  <p>the error</p>
  
  <p>"Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'surplusAmount' cannot be null"</p>
  
  <p>when i modify the <code>when inventoryId=#{item.inventoryId} and materialTypeId=#{item.materialTypeId} </code> to <code>when inventoryId=#{item.inventoryId} </code>, then the error gone.
  But I need the to tow paramter inventoryId and materialTypeId can decide the inventoryId. So someone can give me some answer?</p>