| | |
| | | delete from mm.material_outbound_detail where material_outbound_id=#{materialOutboundId} |
| | | </delete> |
| | | |
| | | <delete id="deleteMaterialLog" > |
| | | delete from mm.material_log where operation_order_number=#{materialOutboundId} |
| | | </delete> |
| | | |
| | | <delete id="deleteReturningWarehouseDetail" > |
| | | delete from mm.returning_warehouse_detail where returning_id=#{returningId} |
| | | </delete> |
| | | |
| | | <delete id="deleteReturningWarehouse" > |
| | | delete from mm.returning_warehouse where returning_id=#{returningId} |
| | | </delete> |
| | | |
| | | <select id="getMaximum" > |
| | | select count(*) from mm.material_outbound where date(create_time)=CURDATE() |
| | | select |
| | | ifnull(SUBSTR(max(right(material_outbound_id,8)) from 7),0) |
| | | from |
| | | mm.material_outbound as a |
| | | where |
| | | date(a.create_time) = curdate() |
| | | |
| | | </select> |
| | | |
| | | <select id="getMaximums" > |
| | | select count(*) from mm.returning_warehouse where date(create_time)=CURDATE() |
| | | select |
| | | ifnull(SUBSTR(max(right(returning_id,8)) from 7),0) |
| | | from |
| | | mm.returning_warehouse as a |
| | | where |
| | | date(a.create_time) = curdate() |
| | | |
| | | </select> |
| | | |
| | | <select id="getMaterialOutboundCount" > |
| | |
| | | <update id="updateMaterialInventory" > |
| | | update mm.material_inventory set inventory_quantity=inventory_quantity+#{materialInventory.inventoryQuantity}, |
| | | available_quantity=available_quantity+#{materialInventory.inventoryQuantity}, |
| | | total_area=total_area+#{totalArea} |
| | | total_area=single_piece_area*inventory_quantity |
| | | where material_code=#{materialCode} and date_of_manufacture=#{materialInventory.dateOfManufacture} |
| | | </update> |
| | | |
| | | <update id="updateMaterialInventoryNull" > |
| | | update mm.material_inventory set inventory_quantity=inventory_quantity+#{materialInventory.inventoryQuantity}, |
| | | available_quantity=available_quantity+#{materialInventory.inventoryQuantity}, |
| | | total_area=single_piece_area*inventory_quantity |
| | | where material_code=#{materialCode} |
| | | </update> |
| | | |
| | | <update id="updateMaterialInventoryReturning" > |
| | | update mm.material_inventory set available_quantity=available_quantity+#{returningWarehouseDetail.returnQuantity}, |
| | | total_area=total_area+#{totalArea} |
| | | update mm.material_inventory set available_quantity=available_quantity+#{returningWarehouseDetail.returnQuantity} |
| | | where material_code=#{materialCode} and |
| | | date_of_manufacture=#{returningWarehouseDetail.dateOfManufacture} |
| | | |
| | |
| | | </update> |
| | | |
| | | <update id="updateMaterialInventoryReturningNull" > |
| | | update mm.material_inventory set available_quantity=available_quantity+#{returningWarehouseDetail.returnQuantity}, |
| | | total_area=total_area+#{totalArea} |
| | | update mm.material_inventory set available_quantity=available_quantity+#{returningWarehouseDetail.returnQuantity} |
| | | where material_code=#{materialCode} and |
| | | date_of_manufacture is null |
| | | |