你好啊
2025-02-22 1a04230a60c65e2a7e8d1b392bc6408b2e77aa61
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -11,6 +11,7 @@
        <result column="create_time" property="createTime"/>
        <result column="layout_status" property="layoutStatus"/>
        <result column="merge" property="merge"/>
        <result column="rack" property="rack"/>
        <!--接收其他外键实体类数据-->
        <association property="order" javaType="com.example.erp.entity.sd.Order">
            <result column="project" property="project"/>
@@ -66,8 +67,9 @@
        c.processing_note,
        b.customer_name,
        if(a.layout_status=0,'不可排版',if(a.layout_status=1,'可排版','已排版')) as layout_status,
        a.merge
        from (select id,order_id,process_id,order_number, quantity,founder,max(layout_status) as layout_status,create_time,merge from flow_card
        a.merge,
        a.rack
        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
@@ -100,6 +102,9 @@
        </if>
        <if test="flowCard.merge != null">
            and a.merge regexp #{flowCard.merge}
        </if>
        <if test="flowCard.rack != null and flowCard.rack != ''">
            and a.rack regexp #{flowCard.rack}
        </if>
        <if test="flowCard.order.customerName != null and flowCard.order.customerName!= ''">
            and b.customer_name regexp #{flowCard.order.customerName}
@@ -520,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) &lt;= #{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>
@@ -583,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
@@ -620,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
@@ -822,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,
@@ -834,6 +848,7 @@
               ogd.process,
               e.type_name,
               opd.stock_id,
               opd.polys_id,
               od.quantity,
               od.other_columns,
               od.bend_radius,
@@ -867,6 +882,8 @@
               ogd.glass_child,
               ogd.process,
               e.type_name,
               opd.stock_id,
               opd.polys_id,
               od.quantity,
               od.other_columns,
               od.bend_radius,
@@ -1438,7 +1455,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
@@ -2146,7 +2164,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
@@ -2184,7 +2203,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
@@ -2734,6 +2754,7 @@
               ogd.process,
               e.type_name,
               opd.stock_id,
               opd.polys_id,
               od.quantity,
               od.other_columns,
               od.bend_radius,
@@ -2833,4 +2854,52 @@
    <select id="flowCardToOptimizeCount">
        select count(*) from pp.flow_card where order_id = #{orderId} and engineering_occupancy=1
    </select>
    <select id="getFlowCardDetail" >
        select
        a.order_id,
        a.process_id,
        a.technology_number,
        a.order_number,
        c.product_id,
        c.product_name,
        b.project,
        sum(a.quantity) as quantity,
        sum(c.compute_gross_area) as compute_gross_area,
        a.founder,
        c.processing_note,
        b.customer_name,
        a.merge,
        a.rack
        from  pp.flow_card 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
        where
             a.process_id regexp #{processId}
        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>