From fcc62c9f3b829b51eb8f0607d9276c49b63c6331 Mon Sep 17 00:00:00 2001
From: zhanghl <253316343@qq.com>
Date: 星期日, 27 四月 2025 14:24:57 +0800
Subject: [PATCH] 零件统计问题修复

---
 aps-modules/aps-core/src/main/resources/mapper/core/ApsPartRouteStatMapper.xml |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/aps-modules/aps-core/src/main/resources/mapper/core/ApsPartRouteStatMapper.xml b/aps-modules/aps-core/src/main/resources/mapper/core/ApsPartRouteStatMapper.xml
index 250f555..8b55af0 100644
--- a/aps-modules/aps-core/src/main/resources/mapper/core/ApsPartRouteStatMapper.xml
+++ b/aps-modules/aps-core/src/main/resources/mapper/core/ApsPartRouteStatMapper.xml
@@ -123,11 +123,8 @@
         from aps_part_plan  as pl
             left join aps_process_route as rt on pl.document_number=rt.work_order_no
             left join aps_resource_group as rs on rs.resource_group_name=rt.process_name
-        where pl.del_flag='0' and rt.del_flag='0'
-            /*闆朵欢璁″垝鐘舵�佷负锛氶潪瀹屽伐 */
-            and ( pl.document_status is not null and ( pl.document_status!='3' or pl.order_status!='瀹屽伐') )
-            /*宸ュ簭璁″垝寮�宸ユ棩 灏忎簬绛変簬 璧勬簮缁勭殑鎴鏃ユ湡*/
-            and rt.process_plan_start_day  &lt;= rs.request_date
+        where pl.work_order_no is not null
+             and  rt.process_plan_start_day  &lt;= rs.request_date
             order by rt.work_order_no,process_plan_start_day
     </select>
 
@@ -155,7 +152,7 @@
              ,pl.resource_name
              , require_times
              , (gp.theory_hours * gp.devices_quantity)   as design_times
-             , ((gp.theory_hours * gp.devices_quantity) / require_times*100) as capacity_load
+             ,   cast (  require_times / cast (gp.theory_hours * gp.devices_quantity as numeric(18,4))  as numeric(18,4)) *100 as capacity_load
         from pl
                  left join aps_resource_group as gp on pl.resource_name = gp.resource_group_name
         where gp.del_flag = '0'

--
Gitblit v1.9.3