From 173eb9980894c6a6b0eaba66768bb50ed490c85f Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期二, 03 九月 2024 22:18:52 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override

---
 north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml |   30 +++++++++++++++++++-----------
 1 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml b/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
index fdc9834..6ad7932 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -83,11 +83,13 @@
                           process_id,a.reporting_work_id
                    from reporting_work as a
                        left join reporting_work_detail as b on a.reporting_work_id = b.reporting_work_id
-                   where this_process=#{previousProcess} and reviewed_state=0 and process_id=#{processIdStr} and b.technology_number=#{technologyStr}) as rw
+                   where this_process=#{previousProcess} and reviewed_state=0 and process_id=#{processIdStr}
+                     and  POSITION(b.technology_number in #{technologyStr})
+                   ) as rw
         on rw.process_id = fc.process_id
         left join reporting_work_detail as rwd on rw.reporting_work_id = rwd.reporting_work_id and rwd.technology_number=fc.technology_number
         where fc.process_id = #{processIdStr}
-          and fc.technology_number = #{technologyStr}
+          and POSITION(fc.technology_number in #{technologyStr})
           and if(#{reportType}=1,o.order_type!='鏍峰搧璁㈠崟',o.order_id!='')
         GROUP BY fc.process_id
     </select>
@@ -108,8 +110,10 @@
     <select id="SelectTechnologicalProcess">
         select ifnull((select ogd.process
                        from sd.order_glass_detail as ogd
+                       left join sd.`order` as o on o.order_id=ogd.order_id
                        where ogd.production_id = LEFT(#{processIdStr}, 11)
-                         and ogd.technology_number=#{technologyStr}
+                         and o.create_order>0
+                         and POSITION(ogd.technology_number in #{technologyStr})
                        limit 1),'') as  process
 
     </select>
@@ -160,7 +164,7 @@
                 where
                 reporting_work.this_process = #{process}
                 and a.process_id=#{processIdStr}
-                and a.technology_number =  #{technologyStr}
+                and POSITION(a.technology_number in #{technologyStr})
                 and a.review_status = 1
                 group by a.process_id,a.order_sort,a.technology_number
             ) as patch
@@ -171,9 +175,11 @@
 
         WHERE
             fc.process_id = #{processIdStr}
-          AND fc.technology_number = #{technologyStr}
+          AND  POSITION(fc.technology_number in #{technologyStr})
           AND odpd.process = #{process}
           and if(#{reportType}=1,o.order_type!='鏍峰搧璁㈠崟',o.order_id!='')
+        group by fc.order_number,
+                 ogd.technology_number
         order by fc.order_number
     </select>
 
@@ -211,7 +217,7 @@
                                from sd.order_glass_detail
                                where order_id = ogd.order_id
                                and order_number = ogd.order_number
-                               and technology_number =#{technologyStr}
+                               and POSITION(technology_number in #{technologyStr})
                                limit 1)
         </if>
 
@@ -249,7 +255,7 @@
         WHERE
             fc.process_id = #{processIdStr}
         <if test="process != '涓┖' and process != '澶硅兌' and process != '鍖呰' and process != '鎵撹兌鍜岀矘妗�' ">
-           AND fc.technology_number = #{technologyStr}
+           AND POSITION(fc.technology_number in #{technologyStr})
         </if>
         AND odpd.process = #{process}
         order by fc.order_number
@@ -383,14 +389,14 @@
                                    and b.order_id = SUBSTR(#{processId} from 1 for 10)
                                    and b.process = #{thisProcess}
                                    and b.process_id = a.process_id
-                 left join (select sum(patch_num) as patchNumSum,order_sort,technology_number,process_id
+                 left join (select sum(patch_num) as patchNumSum,order_sort,technology_number,process_id,patch_processes
                             from patch_log
-                            group by order_sort,technology_number) as c
+                            group by process_id,order_sort,technology_number,patch_processes) as c
                            on
                                        c.process_id = a.process_id
                                    and c.order_sort = a.order_number
                                    and c.technology_number = a.technology_number
-
+                                   and c.patch_processes= #{thisProcess}
         where
             a.process_id=SUBSTR(#{processId} from 1 for 14)
           and a.order_number = #{orderNumber}
@@ -524,6 +530,7 @@
           and rw.reporting_work_time between #{selectTime1} and #{selectTime2}
           and position(#{orderId} in rw.order_id)
           and rw.reviewed_state!=-1
+          and o.create_order>0
         <if test="reportingWork.reportingWorkId != null and reportingWork.reportingWorkId != ''">
             and rw.reporting_work_id regexp #{reportingWork.reportingWorkId}
         </if>
@@ -565,6 +572,7 @@
         where rw.reviewed_state != 2
           and rw.reporting_work_time between #{selectTime1} and #{selectTime2} and position(#{orderId} in rw.order_id)
           and rw.reviewed_state!=-1
+          and o.create_order>0
         <if test="reportingWork.reportingWorkId != null and reportingWork.reportingWorkId != ''">
             and rw.reporting_work_id regexp #{reportingWork.reportingWorkId}
         </if>
@@ -796,7 +804,7 @@
             left join reporting_work_detail as rwd on rw.reporting_work_id = rwd.reporting_work_id
         set rw.reviewed_state = 1
         where rw.process_id = #{substring} and rw.this_process=#{process}
-          and rwd.technology_number = #{result} and reviewed_state=0
+          and POSITION(rwd.technology_number in #{result}) and reviewed_state=0
     </update>
 
     <select id="getPatchConditionMp">

--
Gitblit v1.8.0