gongchunyi
18 小时以前 f21cff62d4b6eb3433f6d5bb2c1ad8fae71d2a35
src/main/resources/mapper/stock/StockUninventoryMapper.xml
@@ -25,7 +25,8 @@
            </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
@@ -55,6 +56,7 @@
        (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