zhang_nuo
2 天以前 f3d0cf42321bb6f0f3c03a66c3d33c260f5d593e
src/main/resources/mapper/production/ProductionOperationTaskMapper.xml
@@ -31,6 +31,7 @@
               poro.operation_name as operationName,
               poro.type as type,
               IFNULL(scrapStat.scrapQty, 0) AS scrapQty,
               CASE WHEN pickStat.pickCount > 0 THEN 1 ELSE 0 END AS picked,
        ROUND(IFNULL(pot.complete_quantity, 0) / NULLIF(pot.plan_quantity, 0) * 100, 2) AS completionStatus,
        CASE
            WHEN pot.work_order_no LIKE 'FG%' THEN '返工返修'
@@ -41,6 +42,12 @@
                 left join production_order_routing_operation poro on pot.production_order_routing_operation_id = poro.id
                 left join product_model pm on pm.id = ifnull(poro.product_model_id, po.product_model_id)
                 left join product p on pm.product_id = p.id
                 left join (
            select count(1) as pickCount, pop.production_order_id, pop.technology_operation_id
            from production_order_pick pop
            group by pop.production_order_id, pop.technology_operation_id
        ) pickStat on pickStat.production_order_id = pot.production_order_id
                  and pickStat.technology_operation_id = poro.technology_operation_id
                 left join (
            select ppm.production_operation_task_id as taskId,
                   sum(ifnull(ppo.scrap_qty, 0)) as scrapQty
@@ -71,7 +78,7 @@
                and pot.work_order_no like concat('%', #{c.workOrderNo}, '%')
            </if>
        </where>
        order by pot.id desc
        order by pot.work_order_no desc
    </select>
    <select id="selectTaskStatisticsByDate" resultType="com.ruoyi.home.dto.ProductionTaskStatisticsDto">
@@ -215,4 +222,18 @@
        order by min(poro.drag_sort), poro.operation_name
    </select>
    <select id="listProcessStatusByOrderIds" resultType="com.ruoyi.production.bean.vo.ProductionOrderProcessTaskVo">
        select pot.production_order_id as productionOrderId,
               poro.operation_name as operationName,
               ROUND(IFNULL(pot.complete_quantity, 0) / NULLIF(pot.plan_quantity, 0) * 100, 2) AS completionStatus
        from production_operation_task pot
                 left join production_order_routing_operation poro
                           on pot.production_order_routing_operation_id = poro.id
        where pot.production_order_id in
        <foreach collection="orderIds" item="orderId" open="(" separator="," close=")">
            #{orderId}
        </foreach>
        order by pot.production_order_id, poro.drag_sort asc, pot.id asc
    </select>
</mapper>