chenlu
2025-03-07 3ab330b8aefb3cd781c9b8730b4ab7ac65e7e9d7
north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml
@@ -704,18 +704,30 @@
        where id=#{inventoryId}
    </update>
    <update id="updateMaterialInventoryInventoryOut">
    <update id="updateMaterialInventoryInventoryPlanQuantityOut">
        update mm.material_inventory
        set inventory_quantity=inventory_quantity-#{quantity},plan_quantity=if(plan_quantity-#{quantity}>=0,plan_quantity-#{quantity},0),total_area=inventory_quantity*single_piece_area
        where id=#{inventoryId}
    </update>
    <update id="updateMaterialInventoryInventoryInt">
    <update id="updateMaterialInventoryInventoryPlanQuantityInt">
        update mm.material_inventory
        set inventory_quantity=inventory_quantity+#{quantity},plan_quantity=plan_quantity+#{quantity},total_area=inventory_quantity*single_piece_area
        where id=#{inventoryId}
    </update>
    <update id="updateMaterialInventoryInventoryOut">
        update mm.material_inventory
        set inventory_quantity=inventory_quantity-#{quantity},total_area=inventory_quantity*single_piece_area
        where id=#{inventoryId}
    </update>
    <update id="updateMaterialInventoryInventoryInt">
        update mm.material_inventory
        set inventory_quantity=inventory_quantity+#{quantity},total_area=inventory_quantity*single_piece_area
        where id=#{inventoryId}
    </update>
    <update id="updateMaterialInventoryAvailableInventoryOut">
        update mm.material_inventory
        set available_quantity=available_quantity-#{quantity},inventory_quantity=inventory_quantity-#{quantity},total_area=inventory_quantity*single_piece_area