廖井涛
2025-02-25 dce5f099e76ecfa92ad708a3d5565a67844ceda2
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -69,7 +69,7 @@
        if(a.layout_status=0,'不可排版',if(a.layout_status=1,'可排版','已排版')) as layout_status,
        a.merge,
        a.rack
        from (select id,order_id,process_id,order_number, quantity,founder,max(layout_status) as layout_status,create_time,merge,rack from flow_card
        from (select id,order_id,process_id,order_number, quantity,founder,max(layout_status) as layout_status,create_time,max(merge) as merge,rack from flow_card
        group by process_Id,order_number) as a
        left join sd.`order` as b on a.order_Id=b.order_id
        left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number
@@ -525,7 +525,7 @@
                 left join pp.flow_card as fc on op.project_no=fc.project_no
                 left join sd.`order` as o on o.order_id=fc.order_id
        where date(op.create_time)>=#{selectTime1} and date(op.create_time) <= #{selectTime2}
          and state >= 20 and o.create_order>0
          and state >= 20 and (o.create_order>0   or o.create_order is null)
        GROUP BY op.project_no
        order by op.create_time desc
    </select>
@@ -588,7 +588,8 @@
                      ogdss.concatenated_glass_child                                   as glass_child,
                      fc.founder,
                      date(fc.splitFrame_time)                                         as splitFrame_time,
                      processed_part                                                   as process
                      processed_part                                                   as process,
                      merge
               from flow_card as fc
                        left join sd.order_glass_detail as ogd
@@ -625,7 +626,8 @@
                      ogdss.concatenated_glass_child                                   as glass_child,
                      fc.founder,
                      date(fc.splitFrame_time)                                         as splitFrame_time,
                      processed_part                                                   as process
                      processed_part                                                   as process,
                      merge
               from flow_card as fc
                        left join sd.order_glass_detail as ogd
@@ -827,6 +829,13 @@
        where fc.process_id = #{processId}
    </update>
    <!--    复选框修改流程卡合架-->
    <update id="updateProcessCardRack">
        update flow_card as fc
        set fc.rack=#{rack}
        where fc.process_id = #{processId} and fc.technology_number=#{technologyNumber}
    </update>
    <select id="getPrintLabel">
        select o.order_id,
               c.customer_abbreviation as customer_name,
@@ -839,11 +848,13 @@
               ogd.process,
               e.type_name,
               opd.stock_id,
               opd.polys_id,
               od.quantity,
               od.other_columns,
               od.bend_radius,
               od.order_number as heat_layout_id,
               a.id as heat_layout_sort
               a.id as heat_layout_sort,
               od.product_name
        from pp.optimize_detail opd
                 left join sd.`order` o on SUBSTR(opd.process_id, 1, 10) = o.order_id
                 left join sd.order_detail od
@@ -872,11 +883,14 @@
               ogd.glass_child,
               ogd.process,
               e.type_name,
               opd.stock_id,
               opd.polys_id,
               od.quantity,
               od.other_columns,
               od.bend_radius,
               opd.heat_layout_id,
               opd.heat_layout_sort
               opd.heat_layout_sort,
               od.product_name
        from pp.optimize_detail opd
                 left join sd.`order` o on SUBSTR(opd.process_id, 1, 10) = o.order_id
                 left join sd.order_detail od
@@ -1443,7 +1457,8 @@
               pd.separation,
               fc.technology_number,
               IFNULL(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S02')),'') as mapNumber,
               od.building_number
               od.building_number,
               fc.merge                                                         as merge
        from flow_card as fc
                 left join sd.order_glass_detail as ogd
                           on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and
@@ -2151,7 +2166,8 @@
                      fc.founder,
                      date(fc.splitFrame_time)                                         as splitFrame_time,
                      fc.print_status,
                      processed_part                                                   as process
                      processed_part                                                   as process,
                      merge
               from flow_card as fc
                        left join sd.order_glass_detail as ogd
@@ -2189,7 +2205,8 @@
                      fc.founder,
                      date(fc.splitFrame_time)                                         as splitFrame_time,
                      fc.print_status,
                      processed_part                                                   as process
                      processed_part                                                   as process,
                      merge
               from flow_card as fc
                        left join sd.order_glass_detail as ogd
@@ -2739,6 +2756,7 @@
               ogd.process,
               e.type_name,
               opd.stock_id,
               opd.polys_id,
               od.quantity,
               od.other_columns,
               od.bend_radius,
@@ -2844,6 +2862,7 @@
        a.order_id,
        a.process_id,
        a.technology_number,
        a.order_number,
        c.product_id,
        c.product_name,
        b.project,
@@ -2862,4 +2881,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>