| | |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | <select id="pageProductOrder" resultType="com.ruoyi.production.dto.ProductOrderDto"> |
| | | select po.*,sl.sales_contract_no,sl.customer_name,slp.product_category,slp.specification_model |
| | | select po.*, |
| | | sl.sales_contract_no, |
| | | sl.customer_name, |
| | | slp.product_category, |
| | | slp.specification_model, |
| | | ppr.process_route_code, |
| | | pb.bom_no, |
| | | ROUND(po.complete_quantity / po.quantity * 100, 2) AS completionStatus |
| | | from product_order po |
| | | left join sales_ledger sl on po.sales_ledger_id = sl.id |
| | | left join sales_ledger_product slp on po.product_model_id = slp.id |
| | | left join process_route pr on po.route_id = pr.id |
| | | left join product_process_route ppr on po.id = ppr.product_order_id |
| | | left join product_bom pb on pb.id = ppr.bom_id |
| | | <where> |
| | | <if test="c.npsNo != null and c.npsNo != ''"> |
| | | and po.nps_no like concat('%',#{c.npsNo},'%') |
| | |
| | | </where> |
| | | </select> |
| | | <select id="productMainByOrderId" resultType="com.ruoyi.production.dto.ProductOrderDto"> |
| | | select |
| | | po.*, |
| | | pwo.work_order_no, |
| | | pwo.report_work, |
| | | pwo.status, |
| | | pwo.quantity, |
| | | pwo.plan_quantity |
| | | select po.*, |
| | | pwo.work_order_no, |
| | | pwo.report_work, |
| | | pwo.status, |
| | | pwo.quantity, |
| | | pwo.plan_quantity |
| | | from product_order po |
| | | left join product_work_order pwo on po.id = pwo.product_order_id |
| | | left join product_work_order pwo on po.id = pwo.product_order_id |
| | | where po.id = #{c.id} |
| | | </select> |
| | | <select id="listProcessRoute" resultType="com.ruoyi.production.pojo.ProcessRoute"> |
| | | select pr.* |
| | | from process_route pr |
| | | left join product_model pm on pr.product_model_id = pm.id |
| | | left join sales_ledger_product slp on pm.id = slp.product_model_id |
| | | where slp.id = #{productModelId} |
| | | </select> |
| | | <select id="listProcessBom" resultType="com.ruoyi.production.dto.ProductStructureDto"> |
| | | select ps.id, |
| | | ps.product_model_id, |
| | | ps.process_id, |
| | | ps.unit_quantity, |
| | | ps.unit_quantity * po.quantity as demandedQuantity, |
| | | ps.unit, |
| | | p.product_name, |
| | | pp.name as process_name, |
| | | pm.product_id, |
| | | pm.model |
| | | from |
| | | product_structure ps |
| | | left join product_model pm on ps.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | left join product_process pp on ps.process_id = pp.id |
| | | left join product_process_route ppr on ps.bom_id = ppr.bom_id |
| | | left join product_order po on po.id = ppr.product_order_id |
| | | where ppr.product_order_id = #{orderId} |
| | | order by ps.id |
| | | </select> |
| | | |
| | | |
| | | </mapper> |