| | |
| | | </select> |
| | | |
| | | <select id="getMaterialInventoryCount" > |
| | | select * from mm.material_inventory where material_code=#{materialCode} and date_of_manufacture=#{dateOfManufacture} |
| | | select * from mm.material_inventory where material_code=#{materialCode} and date_of_manufacture=#{dateOfManufacture} and producer=#{producer} |
| | | </select> |
| | | |
| | | <select id="getMaterialInventoryCountNull" > |
| | | select * from mm.material_inventory where material_code=#{materialCode} and date_of_manufacture is null |
| | | select * from mm.material_inventory where material_code=#{materialCode} and date_of_manufacture is null and producer=#{producer} |
| | | </select> |
| | | |
| | | <select id="getMaterialInventoryCountId" > |
| | | select id from mm.material_inventory where material_code=#{materialCode} and date_of_manufacture=#{dateOfManufacture} |
| | | select id from mm.material_inventory where material_code=#{materialCode} and date_of_manufacture=#{dateOfManufacture} and producer=#{producer} |
| | | </select> |
| | | |
| | | <select id="getMaterialInventoryCountNullId" > |
| | | select id from mm.material_inventory where material_code=#{materialCode} and date_of_manufacture is null |
| | | select id from mm.material_inventory where material_code=#{materialCode} and date_of_manufacture is null and producer=#{producer} |
| | | </select> |
| | | |
| | | <select id="getIsNotMaterialOutboundDetail" > |
| | |
| | | available_quantity=available_quantity+#{materialInventory.inventoryQuantity}, |
| | | total_area=single_piece_area*inventory_quantity |
| | | where material_code=#{materialCode} and date_of_manufacture=#{materialInventory.dateOfManufacture} |
| | | and producer=#{materialInventory.producer} |
| | | </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} and date_of_manufacture is null |
| | | where material_code=#{materialCode} and date_of_manufacture is null and producer=#{materialInventory.producer} |
| | | </update> |
| | | |
| | | <update id="updateMaterialInventoryOut" > |
| | | update mm.material_inventory set inventory_quantity=inventory_quantity-#{quantity}, |
| | | available_quantity=available_quantity-#{quantity}, |
| | | total_area=single_piece_area*inventory_quantity |
| | | where material_code=#{materialCode} and date_of_manufacture=#{dateOfManufacture} |
| | | where material_code=#{materialCode} and date_of_manufacture=#{dateOfManufacture} and producer=#{producer} |
| | | </update> |
| | | |
| | | <update id="updateMaterialInventoryNullOut" > |
| | | update mm.material_inventory set inventory_quantity=inventory_quantity-#{quantity}, |
| | | available_quantity=available_quantity-#{quantity}, |
| | | total_area=single_piece_area*inventory_quantity |
| | | where material_code=#{materialCode} and date_of_manufacture is null |
| | | where material_code=#{materialCode} and date_of_manufacture is null and producer=#{producer} |
| | | </update> |
| | | |
| | | <update id="updateMaterialInventoryReturning" > |
| | | update mm.material_inventory set available_quantity=available_quantity+#{returningWarehouseDetail.returnQuantity} |
| | | where material_code=#{materialCode} and |
| | | date_of_manufacture=#{returningWarehouseDetail.dateOfManufacture} |
| | | date_of_manufacture=#{returningWarehouseDetail.dateOfManufacture} and producer=#{returningWarehouseDetail.producer} |
| | | |
| | | |
| | | </update> |
| | |
| | | <update id="updateMaterialInventoryReturningNull" > |
| | | update mm.material_inventory set available_quantity=available_quantity+#{returningWarehouseDetail.returnQuantity} |
| | | where material_code=#{materialCode} and |
| | | date_of_manufacture is null |
| | | date_of_manufacture is null and producer=#{returningWarehouseDetail.producer} |
| | | |
| | | |
| | | </update> |
| | |
| | | where id=#{materialInventoryId} |
| | | </update> |
| | | |
| | | <update id="updateMaterialInventoryOne" > |
| | | update mm.material_inventory set |
| | | quality_guarantee_period=#{materialInventory.qualityGuaranteePeriod}, |
| | | inventory_area=#{materialInventory.inventoryArea}, |
| | | remarks=#{materialInventory.remarks}, |
| | | available_quantity=available_quantity+#{materialInventory.availableQuantity}, |
| | | inventory_quantity=inventory_quantity+#{materialInventory.inventoryQuantity}, |
| | | total_area=inventory_quantity*single_piece_area |
| | | where id=#{materialInventoryId} |
| | | </update> |
| | | |
| | | </mapper> |