| | |
| | | |
| | | <select id="listPageProductionProductMainDto" resultType="com.ruoyi.production.dto.ProductionProductMainDto"> |
| | | select ppm.*, |
| | | ppm.post_name as postName, |
| | | po.nps_no as npsNo, |
| | | po.strength as strength, |
| | | pms.material_code as materialCode, |
| | | pm.product_name as productName, |
| | | pms.model as productModelName, |
| | | IFNULL(ppo.quantity, 0) as totalQuantity, |
| | | IFNULL(ppo.total_quantity, 0) as totalQuantity, |
| | | IFNULL(ppo.scrap_qty, 0) as scrapQty, |
| | | IFNULL(ppo.quantity, 0) as quantity |
| | | from |
| | | production_product_main ppm |
| | | left join production_product_output ppo on ppo.product_main_id = ppm.id |
| | | left join production_product_input ppi on ppi.product_main_id = ppm.id |
| | | left join product_order po on po.id = ppm.product_order_id |
| | | left join product_order_plan pop on po.id = pop.product_order_id |
| | | left join production_plan pp on pop.production_plan_id = pp.id |
| | | left join product_material_sku pms on pp.product_material_sku_id = pms.id |
| | | left join product_material_sku pms on po.product_material_sku_id = pms.id |
| | | left join product_material pm on pm.id = pms.product_id |
| | | <where> |
| | | <if test="c.npsNo != null and c.npsNo != ''"> |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="selectProductionProductMainDto" |
| | | resultType="com.ruoyi.production.dto.ProductionProductMainDto"> |
| | | SELECT ppm.id, |
| | | ppm.product_no, |
| | | ppm.post_name, |
| | | ppm.schedule, |
| | | ppm.reporting_time, |
| | | ppo.quantity, |
| | | ppo.scrap_qty, |
| | | ppo.total_quantity |
| | | FROM production_product_main ppm |
| | | left join production_product_output ppo on ppm.id = ppo.product_main_id |
| | | WHERE product_order_id=#{productOrderId} |
| | | order by reporting_time |
| | | </select> |
| | | |
| | | <delete id="deleteByWorkOrderIds" parameterType="java.util.List"> |
| | | DELETE FROM production_product_main |