src/main/resources/mapper/stock/StockInventoryMapper.xml
@@ -22,6 +22,7 @@ <if test="ew.version != null"> version = version + 1, </if> update_time = now() </set> where product_model_id = #{ew.productModelId} </update> @@ -31,9 +32,10 @@ <if test="ew.qualitity != null"> qualitity = qualitity - #{ew.qualitity}, </if> <if test="version != null"> <if test="ew.version != null"> version = version + 1, </if> update_time = now() </set> where product_model_id = #{ew.productModelId} and qualitity >= #{ew.qualitity} </update>