From 13e6f69bec23128767006c054f737d652c6e9cde Mon Sep 17 00:00:00 2001 From: haoliang <821644@qq.com> Date: Tue, 19 May 2026 14:17:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=AA=E8=A1=A8=E7=9B=98?= =?UTF-8?q?=E5=B7=A5=E4=BA=BA=E6=8E=92=E8=A1=8CCROSS=20JOIN=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E4=BA=A7=E9=87=8F=E9=87=8D=E5=A4=8D=E8=AE=A1=E7=AE=97?= =?UTF-8?q?4=E5=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/CncRepository/Impl/Dashboard/DashboardRepository.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/CncRepository/Impl/Dashboard/DashboardRepository.cs b/src/CncRepository/Impl/Dashboard/DashboardRepository.cs index 7da676e..862eb6f 100644 --- a/src/CncRepository/Impl/Dashboard/DashboardRepository.cs +++ b/src/CncRepository/Impl/Dashboard/DashboardRepository.cs @@ -125,10 +125,9 @@ namespace CncRepository.Impl.Dashboard { var sql = $@" SELECT w.name AS WorkerName, - COUNT(DISTINCT wm.machine_id) AS MachineCount, + COUNT(DISTINCT dp.machine_id) AS MachineCount, COALESCE(SUM(dp.end_total_count - dp.base_total_count), 0) AS TotalQuantity FROM cnc_worker w - LEFT JOIN cnc_worker_machine wm ON wm.worker_id = w.id LEFT JOIN cnc_daily_production dp ON dp.worker_id = w.id AND dp.production_date BETWEEN @Start AND @End AND dp.end_total_count > dp.base_total_count