廖井涛
2025-02-25 dce5f099e76ecfa92ad708a3d5565a67844ceda2
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -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
@@ -831,7 +833,7 @@
    <update id="updateProcessCardRack">
        update flow_card as fc
        set fc.rack=#{rack}
        where fc.process_id = #{processId} and fc.technology_number=#{technologyNumber} and order_number=#{orderNumber}
        where fc.process_id = #{processId} and fc.technology_number=#{technologyNumber}
    </update>
    <select id="getPrintLabel">
@@ -846,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
@@ -879,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
@@ -1450,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
@@ -2158,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
@@ -2196,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
@@ -2746,6 +2756,7 @@
               ogd.process,
               e.type_name,
               opd.stock_id,
               opd.polys_id,
               od.quantity,
               od.other_columns,
               od.bend_radius,
@@ -2870,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>