廖井涛
2024-04-09 57162abde4950b331c49777b3425b60d21de7732
north-glass-erp/target/classes/mapper/pp/Report.xml
@@ -44,14 +44,60 @@
            <result column="total_thickness" property="totalThickness"/>
            <result column="thickness" property="thickness"/>
        </association>
        <!--<result column="g_typeId" property="glassTypes.typeId"/>
        <result column="g_type" property="glassTypes.type"/>-->
    </resultMap>
<!--    流程卡进度-->
    <select id="processCardProgressMp">
        select
            a.product_name,
            b.glass_child,
            d.order_type,
            concat(c.process_id,'/',c.technology_number) as process_id,
            c.technology_number,
            c.quantity,
            e.reportWorkQuantity,
            e.reportWorkQuantityCount,
            e.broken_num,
            round(ifnull(f.inventory,0)*a.area,2) as  inventoryArea
        from
            flow_card as c
        left join
            sd.order_detail as a
        on  c.order_id = a.order_id
        and c.order_number = a.order_number
        left join sd.order_glass_detail as b
        on c.order_id = b.order_id
            and b.order_number = c.order_number
            and c.technology_number = b.technology_number
        left join sd.`order` as d
        on c.order_id = d.order_id
        left join mm.finished_goods_inventory as f
        on c.order_id = f.order_id and f.order_number = c.order_number
        left join (
                SELECT process_id,
                       technology_number,
                       sum(a.broken_num) as broken_num,
                       concat('{',
                              GROUP_CONCAT(concat("\"",process,"\":\"",reporting_work_num,"\"")),
                              '}'
                           ) as reportWorkQuantity,
                       concat('{',
                              GROUP_CONCAT(concat("\"",process,"\":\"",reporting_work_num_count,"\"")),
                              '}'
                           ) as  reportWorkQuantityCount
                FROM sd.order_process_detail as a
                where a.order_id=#{orderId}
                GROUP BY process_id,a.technology_number
            ) as e
        on e.process_id = c.process_id
            and e.technology_number = c.technology_number
        where a.order_id = #{orderId}
    </select>
</mapper>