guoyuji
2025-02-19 f50b70fce51257349608837adfdd79e1337858a1
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -2874,4 +2874,27 @@
        group by a.process_id,a.technology_number
    </select>
    <select id="getGlassThicknessByProdutionId">
        select total_thickness as 'totalThickness',thickness as 'thickness' from sd.product
        where id = (
            select distinct b.product_id from sd.order_glass_detail as a
                    left join sd.order_detail as b
                    on a.order_id = b.order_id and a.order_number = b.order_number
                    where a.order_id = #{orderId}
                    and a.production_id = #{productionId}
            )
    </select>
    <select id="getOrderDetailByProductionId">
        select * from (select a.*,
        IF(a.height >= a.width, a.height, a.width) as 'long',
        IF(a.height &lt; a.width, a.height, a.width) as 'short'
        from sd.order_detail as a
        left join sd.order_glass_detail as b
        on a.order_id = b.order_id and a.order_number = b.order_number
        where a.order_id = #{orderId} and b.production_id = #{productionId}
        group by a.order_number) as c
        order by c.`long` desc
    </select>
</mapper>