廖井涛
2025-08-25 fec9f42e00f2df68a2a20cbf132b17bdeed8e63a
north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml
@@ -222,4 +222,22 @@
    <select id="selectProcessCard">
        select processing_card from sd.`order` where order_id = #{orderId}
    </select>
    <update id="updateWorkIdMp">
        UPDATE sd.order_glass_detail AS ogd
            JOIN (
            SELECT order_id, order_number, MAX(production_id) AS production_id
            FROM sd.order_glass_detail
            WHERE production_id IS NOT NULL
            AND FIND_IN_SET(order_id, #{orderId})
            GROUP BY order_id, order_number
            ) AS t
        ON ogd.order_id = t.order_id AND ogd.order_number = t.order_number
            SET ogd.production_id = t.production_id,
                ogd.production_time = NOW(),
                ogd.founder = #{userName}
        WHERE ogd.production_id IS NULL
          AND FIND_IN_SET(ogd.order_id, #{orderId})
    </update>
</mapper>