廖井涛
2024-04-09 8202686b06680db9b82d4a99a31dc7f9dca4ee86
north-glass-erp/target/classes/mapper/pp/FolwCard.xml
@@ -61,8 +61,8 @@
        sum(c.compute_gross_area) as compute_gross_area,
        a.founder,
        c.processing_note,
        if(a.layout_status=0,"不可排版",if(a.layout_status=1,"可排版","已排版")) as layout_status
        from flow_card as a left join sd.`order` as b on a.order_Id=b.order_id
        if(a.layout_status=0,'不可排版',if(a.layout_status=1,'可排版','已排版')) as layout_status
        from (select  id,order_id,process_id,order_number, quantity,founder,layout_status,create_time 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
        where a.create_time between #{selectTime1} and #{selectTime2}
        <if test="flowCard.orderId != null and flowCard.orderId != ''">
@@ -167,7 +167,7 @@
    </select>
    <!--    分架明细查询-->
    <select id="detailsSelectMp" resultMap="flowCardMap">
    <select id="detailsSelectMp">
        select od.order_id,
        ogd.production_id,
        od.product_id,
@@ -180,18 +180,7 @@
        GROUP BY order_id,order_number
        ) as ogd on od.order_id=ogd.order_id and od.order_number=ogd.order_number
        where od.order_id = #{orderId} and ogd.splitting_status=0
        <if test="flowCard.orderId != null and flowCard.orderId != ''">
            and od.order_id regexp #{flowCard.orderId}
        </if>
        <if test="flowCard.orderGlassDetail.productionId != null and flowCard.orderGlassDetail.productionId != ''">
            and ogd.production_id regexp #{flowCard.orderGlassDetail.productionId}
        </if>
        <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">
            and od.product_id regexp #{flowCard.orderDetail.productId}
        </if>
        <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName != ''">
            and od.product_name regexp #{flowCard.orderDetail.productName}
        </if>
        group by od.order_id, ogd.production_id
        order by od.id desc
    </select>
@@ -211,7 +200,7 @@
    <update id="deleteFlowCardMp">
        delete
        from flow_card as fc
        where fc.process_id = #{processId}
        where fc.production_id = left(#{processId},11)
    </update>
    <!--    分架新增明细查询-->
@@ -390,17 +379,27 @@
        select fc.order_id,
               fc.process_id,
               fc.order_number,
               fc.technology_number,
               fc.quantity,
               ogd.child_width,
               ogd.child_height,
               round(ogd.child_width * ogd.child_height * fc.quantity / 1000000, 2) as area,
               od.product_name,
               ogd.glass_child,
               fc.founder,
               fc.splitFrame_time
               date(fc.splitFrame_time) as splitFrame_time
        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 = ogd.order_id and od.order_number = ogd.order_number
        where fc.process_id = #{processId}
        GROUP BY fc.order_id, fc.process_id, fc.order_number
        GROUP BY fc.order_id, fc.process_id, fc.order_number,fc.technology_number
        order by fc.order_number,fc.technology_number
    </select>
    <delete id="deleteReportingWork">
        delete from sd.order_process_detail
        where  left(process_id,11) = left(#{processId},11)
    </delete>
</mapper>