From 2cf827ada216097911ac25d555e8c841b765218b Mon Sep 17 00:00:00 2001
From: 邱宇豪 <qyh123230312>
Date: 星期四, 26 十月 2023 09:52:19 +0800
Subject: [PATCH] 20231026_qiuyh_磨具监测已完成、调整报表sql

---
 hd/pipe/secure/src/main/resources/mapping/PipeReportMapper.xml |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/hd/pipe/secure/src/main/resources/mapping/PipeReportMapper.xml b/hd/pipe/secure/src/main/resources/mapping/PipeReportMapper.xml
index 3ab61e8..d74a177 100644
--- a/hd/pipe/secure/src/main/resources/mapping/PipeReportMapper.xml
+++ b/hd/pipe/secure/src/main/resources/mapping/PipeReportMapper.xml
@@ -13,13 +13,13 @@
                IFNULL(e.shippingNum,0) shippingNum
        FROM      (
                          SELECT
-                                 COUNT(a.pro_id) produceTotal,
-                                 a.pro_id,
-                                 b.pro_name
-                         FROM t_pipe_info a
-                                      LEFT JOIN sys_project b on b.pro_id = a.pro_id
-                         WHERE b.company_id = #{companyId}
-                         GROUP BY a.pro_id
+                             COUNT(b.pro_id) produceTotal,
+                             b.pro_id,
+                             b.pro_name
+                         FROM  sys_project b
+                         LEFT JOIN t_pipe_info a on b.pro_id = a.pro_id
+                         WHERE b.is_use =1 and b.company_id = #{companyId}
+                         GROUP BY b.pro_id
                          ) c
                          LEFT JOIN
                          (
@@ -57,13 +57,14 @@
                 IFNULL(f.moldedNum,0) moldedNum
         FROM(
                 SELECT
-                        COUNT(a.pro_id) produceTotal,
-                        a.pro_id,
+                        COUNT(b.pro_id) produceTotal,
+                        b.pro_id,
                         b.pro_name
-                FROM t_steel_produce a
-                             LEFT JOIN sys_project b on b.pro_id = a.pro_id
-                WHERE a.is_use = 1 and b.company_id = #{companyId}
-                GROUP BY a.pro_id
+                FROM sys_project b
+                             LEFT JOIN t_pipe_info a on b.pro_id = a.pro_id
+                WHERE b.is_use =1 and b.company_id = #{companyId}
+                GROUP BY b.pro_id
+
             ) c
         LEFT JOIN
             (

--
Gitblit v1.9.3