chenlu
2024-07-10 27346176f10ddcc2df668cdc76bf354132fb3dbc
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -510,12 +510,17 @@
               round(ogd.total_area, 2)                                     as total_area,
               od.perimeter,
               od.bend_radius,
               concat(od.processing_note,od.remarks) as remarks
               concat(od.processing_note,od.remarks) as remarks,
               od.other_columns,
               round(ogd.child_width) as width,
               round(ogd.child_height) as height,
               pd.separation
        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
                              fc.technology_number = ogd.technology_number
                 left join sd.order_detail as od on od.order_id = fc.order_id and od.order_number = fc.order_number
        left join sd.product_detail as pd on pd.prod_id=od.product_id and pd.glass_sort=ogd.technology_number
        where fc.process_id = #{processId}
          and fc.technology_number = #{technologyNumber}
        group by fc.process_id, fc.order_number
@@ -554,6 +559,7 @@
               od.width,
               od.height,
               ogd.glass_child,
               ogd.process,
               e.type_name,
               opd.stock_id,
               od.quantity,
@@ -563,7 +569,7 @@
                 left join sd.order_detail od
                           on SUBSTR(opd.process_id, 1, 10) = od.order_id and opd.order_sort = od.order_number
                 left join sd.order_glass_detail ogd
                           on SUBSTR(opd.process_id, 1, 10) = ogd.order_id and opd.order_sort = ogd.order_number
                           on SUBSTR(opd.process_id, 1, 10) = ogd.order_id and opd.order_sort = ogd.order_number and opd.layer=ogd.technology_number
                 left join sd.product p on od.product_id = p.id
                 left join sd.basic_glass_type e on e.type_id = p.type_id
        where opd.project_no = #{projectNo}
@@ -580,6 +586,7 @@
               od.order_number as orderNumber,
               fc.technology_number as technologyNumber,
               ogd.glass_child,
               ogd.process,
               c.customer_abbreviation as customer_name,
               ifnull(od.processing_note,'') as processing_note,
               bgt.type_name,
@@ -791,7 +798,33 @@
    <update id="updatePrintStateMp">
        update  pp.flow_card
        set print_status = #{printState}
        set print_status = print_status+1
        where process_id = #{processId} and technology_number = #{technologyNumber}
    </update>
    <select id="printFlowCardOrderSortMp">
        SELECT fc.process_id,
               fc.order_number,
               fc.technology_number,
               ogd.glass_address,
               ogd.child_width,
               ogd.child_height,
               fc.quantity,
               ROUND(ogd.child_width * ogd.child_height * fc.quantity / 1000000, 2) as area,
               fc.sort
        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 fc.technology_number = ogd.technology_number
        where fc.order_id=#{orderId}
        order by IF(fc.sort != NULL || fc.sort != '', fc.sort, fc.technology_number)
    </select>
    <update id="printOrderSortMp">
        update flow_card
        set sort = #{sort}
        where process_id = #{processId}
          and order_number = #{orderNumber}
          and technology_number = #{technologyNumber}
    </update>
</mapper>