From a27fdf6b900e267eb84e1c6a5e1a693ee90d1274 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期四, 10 九月 2026 21:17:05 +0800
Subject: [PATCH] feat(stock): 添加库存报表导出功能并完善库存入库字段Excel注解

---
 src/main/resources/mapper/production/ProductionAccountMapper.xml |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/main/resources/mapper/production/ProductionAccountMapper.xml b/src/main/resources/mapper/production/ProductionAccountMapper.xml
index 4be1c23..d66347f 100644
--- a/src/main/resources/mapper/production/ProductionAccountMapper.xml
+++ b/src/main/resources/mapper/production/ProductionAccountMapper.xml
@@ -124,8 +124,10 @@
         select date_format(scheduling_date, '%m-%d') as dateStr,
                cast(ifnull(sum(finished_num), 0) as decimal(18,2)) as numberOfCompleted,
                cast(ifnull(sum(work_hours), 0) as decimal(18,2)) as amount,
-               cast(0 as decimal(18,2)) as passRate
+               cast(sum(ppo.quantity) / sum(ppo.quantity + ppo.scrap_qty) * 100.00 as decimal(18,2)) as passRate
         from production_account
+        left join production_product_main ppm on ppm.id = production_account.production_product_main_id
+        left join production_product_output ppo on ppo.production_product_main_id = ppm.id
         where scheduling_date &gt;= #{startDate}
           and scheduling_date &lt;= #{endDate}
         group by date_format(scheduling_date, '%m-%d')

--
Gitblit v1.9.3