| | |
| | | </if> |
| | | update_time = now() |
| | | </set> |
| | | where product_model_id = #{ew.productModelId} and qualitity >= #{ew.qualitity} |
| | | where product_model_id = #{ew.productModelId} |
| | | and (qualitity - COALESCE(locked_quantity, 0)) >= #{ew.qualitity} |
| | | </update> |
| | | <update id="updateAddStockUnInventory"> |
| | | update stock_uninventory |
| | |
| | | (su.qualitity - COALESCE(su.locked_quantity, 0)) as un_locked_quantity, |
| | | pm.model, |
| | | pm.unit, |
| | | pm.thickness, |
| | | p.product_name |
| | | from stock_uninventory su |
| | | left join product_model pm on su.product_model_id = pm.id |