| | |
| | | pms.material_code AS materialCode, |
| | | pms.id AS productId |
| | | FROM product_order po |
| | | LEFT JOIN process_route pr ON po.route_id = pr.id |
| | | LEFT JOIN production_order_route pr ON po.route_id = pr.id |
| | | LEFT JOIN product_bom pb ON pr.bom_id = pb.id |
| | | LEFT JOIN product_material_sku pms ON pms.id = po.product_material_sku_id |
| | | LEFT JOIN product_material pm ON pm.id = pms.product_id |
| | | <where> |
| | | <if test="c.id != null"> |
| | | AND po.id = #{c.id} |
| | | </if> |
| | | <if test="c.npsNo != null and c.npsNo != ''"> |
| | | AND po.nps_no LIKE CONCAT('%', #{c.npsNo}, '%') |
| | | </if> |
| | |
| | | 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> |
| | | <select id="getProductOrderDto" resultType="com.ruoyi.production.dto.ProductOrderDto"> |
| | | SELECT |
| | | po.id, |
| | | po.nps_no, |
| | | po.tenant_id, |
| | | po.create_time, |
| | | po.update_time, |
| | | po.route_id, |
| | | po.quantity, |
| | | po.complete_quantity, |
| | | po.start_time, |
| | | po.end_time, |
| | | po.plan_complete_time, |
| | | po.status, |
| | | pm.product_name, |
| | | po.strength AS strength, |
| | | pr.process_route_code AS processRouteCode, |
| | | pr.description, |
| | | pb.id AS bomId, |
| | | pb.bom_no AS bomNo, |
| | | ROUND(po.complete_quantity / po.quantity * 100, 2) AS completionStatus, |
| | | pms.model, |
| | | pms.material_code AS materialCode, |
| | | pms.id AS productId |
| | | FROM product_order po |
| | | LEFT JOIN production_order_route pr ON po.route_id = pr.id |
| | | LEFT JOIN product_bom pb ON pr.bom_id = pb.id |
| | | LEFT JOIN product_material_sku pms ON pms.id = po.product_material_sku_id |
| | | LEFT JOIN product_material pm ON pm.id = pms.product_id |
| | | WHERE po.id = #{productOrderId} |
| | | </select> |
| | | </mapper> |