廖井涛
2025-08-07 ac0bc1d3df54c8f18a10b135daf28faebb25d20a
north-glass-erp/src/main/resources/mapper/sd/OrderProcessDetailMapper.xml
@@ -71,11 +71,21 @@
    <!--查询筛选后唯一的流程卡号-->
    <select id="filterOrderProcess">
        select id,process,order_number,technology_number
      select * from( select max(id) as id,process,order_number,technology_number,b.nickname,
                            case b.nickname when '' then 1
                            when null then 1
                            when 'stepC' then 2
                            when 'stepA' then 3
                            when 'stepD' then 4
                            when 'stepB' then 4
                     end as sort
        from order_process_detail
        left join (select DISTINCT basic_name,nickname from basic_data where basic_category = 'process') as b
        on b.basic_name = process
        where order_id = #{orderId}
        group by process
        order by id
        group by process) as a
        order by sort,id
    </select>