| | |
| | | mi.producer, |
| | | mi.inventory_quantity AS inventoryQuantity, |
| | | mi.available_quantity AS availableQuantity, |
| | | mi.plan_quantity AS planQuantity, |
| | | mi.safety_stock AS safetyStock, |
| | | mi.total_area AS totalArea, |
| | | mi.single_piece_area singlePieceArea, |
| | |
| | | ou.id as useId, |
| | | ou.project_no as projectNo, |
| | | ou.use_count AS inventoryQuantity, |
| | | ou.not_use_count AS availableQuantity, |
| | | mi.plan_quantity AS availableQuantity, |
| | | mi.plan_quantity AS planQuantity, |
| | | mi.id, |
| | | mi.inventory_organization as inventoryOrganization, |
| | | mi.material_code AS materialCode, |
| | |
| | | mi.producer, |
| | | mi.inventory_quantity AS inventoryQuantity, |
| | | mi.available_quantity AS availableQuantity, |
| | | mi.plan_quantity AS planQuantity, |
| | | mi.safety_stock AS safetyStock, |
| | | mi.total_area AS totalArea, |
| | | mi.single_piece_area singlePieceArea, |
| | |
| | | ou.id as useId, |
| | | ou.project_no as projectNo, |
| | | ou.use_count AS inventoryQuantity, |
| | | ou.not_use_count AS availableQuantity, |
| | | mi.plan_quantity AS availableQuantity, |
| | | mi.plan_quantity AS planQuantity, |
| | | mi.id, |
| | | mi.inventory_organization as inventoryOrganization, |
| | | mi.material_code AS materialCode, |
| | |
| | | </insert> |
| | | |
| | | <update id="updateMaterialInventoryAvailableOptOut"> |
| | | update pp.optimize_use |
| | | set not_use_count=not_use_count-#{quantity} |
| | | update mm.material_inventory |
| | | set available_quantity=available_quantity-#{quantity} |
| | | where id=#{useId} |
| | | </update> |
| | | |
| | | <update id="updateMaterialInventoryAvailableOptInt"> |
| | | update pp.optimize_use |
| | | set not_use_count=not_use_count+#{quantity} |
| | | update mm.material_inventory |
| | | set available_quantity=available_quantity+#{quantity} |
| | | where id=#{useId} |
| | | </update> |
| | | |
| | |
| | | |
| | | <update id="updateMaterialInventoryInventoryOut"> |
| | | update mm.material_inventory |
| | | set inventory_quantity=inventory_quantity-#{quantity} |
| | | set inventory_quantity=inventory_quantity-#{quantity},plan_quantity=if(plan_quantity-#{quantity}>=0,plan_quantity-#{quantity},0) |
| | | where id=#{inventoryId} |
| | | </update> |
| | | |
| | | <update id="updateMaterialInventoryInventoryInt"> |
| | | update mm.material_inventory |
| | | set inventory_quantity=inventory_quantity+#{quantity} |
| | | set inventory_quantity=inventory_quantity+#{quantity},plan_quantity=plan_quantity+#{quantity} |
| | | where id=#{inventoryId} |
| | | </update> |
| | | |