| | |
| | | sku.material_code, |
| | | pm.product_name, |
| | | sku.model, |
| | | pprip.unit, |
| | | ppi.unit, |
| | | pos.unit_quantity, |
| | | sum(pprip.product_value) actualInputQuantity, |
| | | sum(ppi.quantity) actualInputQuantity, |
| | | sum(ppo.quantity+ppo.scrap_qty) actualOutputQuantity |
| | | from production_product_route_item_param pprip |
| | | left join production_product_route_item ppri on ppri.id=pprip.production_product_route_item_id |
| | | left join production_product_main ppm on ppm.id=ppri.product_main_id |
| | | from production_product_input ppi |
| | | left join production_product_main ppm on ppm.id=ppi.product_main_id |
| | | left join production_product_output ppo on ppm.id=ppo.product_main_id |
| | | left join product_material_sku sku ON pprip.product_id = sku.id |
| | | left join product_material_sku sku ON ppi.product_id = sku.id |
| | | left join product_material pm ON sku.product_id = pm.id |
| | | left join production_order_structure pos ON pos.product_model_id = pprip.product_id |
| | | left join production_order_structure pos ON pos.product_model_id = ppi.product_id |
| | | where ppm.product_order_id = #{productOrderId} |
| | | and pos.order_id = #{productOrderId} |
| | | and pprip.order_item_param_id is null |
| | | group by sku.material_code, |
| | | pm.product_name, |
| | | sku.model, |
| | | pos.unit_quantity, |
| | | pprip.unit)A |
| | | ppi.unit)A |
| | | |
| | | </select> |
| | | </mapper> |