From 93b80ffb7f7ffc02bc414271b8ebeac82be6bcb9 Mon Sep 17 00:00:00 2001
From: huang <1532065656@qq.com>
Date: 星期一, 11 十一月 2024 16:29:00 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10105/r/ERP_override

---
 north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml |   55 +++++++++++++++++++++++++++++++------------------------
 1 files changed, 31 insertions(+), 24 deletions(-)

diff --git a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
index 1aece63..b413693 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -67,10 +67,10 @@
         b.customer_name,
         if(a.layout_status=0,'涓嶅彲鎺掔増',if(a.layout_status=1,'鍙帓鐗�','宸叉帓鐗�')) as layout_status,
         a.merge
-        from (select id,order_id,process_id,order_number, quantity,founder,layout_status,create_time,merge from flow_card
+        from (select id,order_id,process_id,order_number, quantity,founder,max(layout_status) as layout_status,create_time,merge from flow_card
         group by process_Id,order_number) as a left join sd.`order` as b on a.order_Id=b.order_id
         left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number
-        where a.create_time between #{selectTime1} and #{selectTime2}
+        where date(a.create_time)>=#{selectTime1} and date(a.create_time) &lt;= #{selectTime2}
         <if test="flowCard.orderId != null and flowCard.orderId != ''">
             and a.order_id regexp #{flowCard.orderId}
         </if>
@@ -114,7 +114,7 @@
         count(distinct a.process_Id) as 'total'
         from flow_card as a left join sd.`order` as b on a.order_Id=b.order_id
         left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number
-        where a.create_time between #{selectTime1} and #{selectTime2}
+        where date(a.create_time)>=#{selectTime1} and date(a.create_time) &lt;= #{selectTime2}
         <if test="flowCard.orderId != null and flowCard.orderId != ''">
             and a.order_id regexp #{flowCard.orderId}
         </if>
@@ -162,8 +162,8 @@
         o.delivery_address
         from sd.`order` as o
         left join sd.order_glass_detail ogd on o.order_id = ogd.order_id
-        where o.production_order=2 and ogd.splitting_status=0 and o.create_time between #{selectTime1} and
-        #{selectTime2}
+        where o.production_order=2 and ogd.splitting_status=0 and
+        date(o.create_time)>=#{selectTime1} and date(o.create_time) &lt;= #{selectTime2}
 
         <if test="flowCard.order.orderId != null and flowCard.order.orderId != ''">
             and o.order_id regexp #{flowCard.order.orderId}
@@ -263,7 +263,8 @@
                ods.S02,
                ods.S03,
                ods.S04,
-               ods.S05
+               ods.S05,
+               od.building_number
         from sd.order_detail as od
                  left join sd.order_glass_detail as ogd
                            on od.order_id = ogd.order_id and od.order_number = ogd.order_number
@@ -413,7 +414,7 @@
                  left join sd.order as o on od.order_id = o.order_id
                  left join production_scheduling as ps
                            on ps.order_id = od.order_id and ps.order_number = od.order_number
-        where od.create_time between #{selectTime1} and #{selectTime2}
+        where  date(od.create_time)>=#{selectTime1} and date(od.create_time) &lt;= #{selectTime2}
     </select>
 
     <!--   鏌ヨ瀵瑰簲搴忓彿鐨勫眰鏁�-->
@@ -469,7 +470,7 @@
                pack_type,
                batch
         from sd.order
-        where create_time between #{selectTime1} and #{selectTime2}
+        where date(create_time)>=#{selectTime1} and date(create_time) &lt;= #{selectTime2}
           and position(#{orderId} in order_id)
           and position(#{project} in project)
           and processing_card >0
@@ -479,7 +480,7 @@
     <select id="selectPrintFlowCard">
         select *
         from pp.optimize_project
-        where create_time between #{selectTime1} and #{selectTime2}
+        where date(create_time)>=#{selectTime1} and date(create_time) &lt;= #{selectTime2}
           and state >= 20
         order by create_time desc
     </select>
@@ -516,13 +517,14 @@
                                           ogds.glass_child                                  AS concatenated_glass_child,
                                           process                                           AS processed_part,
                                           ogds.child_width,
-                                          ogds.child_height
+                                          ogds.child_height,
+                                          ogds.group
                                    from sd.order_glass_detail as ogds
                                    where ogds.order_id = #{orderId}
-                                   GROUP BY order_id, order_number, ogds.glass_child, process) as ogdss
+                                   GROUP BY order_id, order_number, ogds.glass_child, process,ogds.group) as ogdss
                                   on fc.order_id = ogdss.order_id and ogdss.order_number = fc.order_number
                where fc.order_id = #{orderId}
-               GROUP BY fc.process_id, ogdss.concatenated_glass_child, ogdss.processed_part
+               GROUP BY fc.process_id, ogdss.concatenated_glass_child, ogdss.processed_part,ogdss.group
                order by fc.process_id, ogdss.technology_number)
 
               UNION
@@ -664,7 +666,8 @@
                round(ogd.child_width)                                         as width,
                round(ogd.child_height)                                        as height,
                pd.separation,
-               fc.technology_number
+               fc.technology_number,
+               IFNULL(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S02')),'') as mapNumber
         from flow_card as fc
                  left join sd.order_glass_detail as ogd
                            on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and
@@ -736,7 +739,7 @@
         (select (@row_number := @row_number + 1) as id,process_id as process_id from (select process_id from pp.optimize_detail tt where project_no =#{projectNo} group by process_id) tt,(select @row_number := 0) as t) a
         on a.process_id=opd.process_id
         where opd.project_no = #{projectNo}
-        order by opd.stock_id
+        order by opd.stock_id,opd.polys_id
     </select>
 
     <select id="getPrintLabel2">
@@ -1012,7 +1015,7 @@
                  left join patch_log as pl on pl.order_id = fc.order_id and pl.process_id = fc.process_id and
                                               pl.order_sort = fc.order_number and
                                               pl.technology_number = fc.technology_number
-        where pl.create_time between #{selectTime1} and #{selectTime2}
+        where date(pl.create_time)>=#{selectTime1} and date(pl.create_time) &lt;= #{selectTime2}
           and pl.review_status > 0
         GROUP BY pl.id, fc.process_id, ogd.technology_number
         order by pl.id desc, fc.process_id, ogd.technology_number
@@ -1196,7 +1199,7 @@
                  left join rework as pl on pl.order_id = fc.order_id and pl.process_id = fc.process_id and
                                            pl.order_sort = fc.order_number and
                                            pl.technology_number = fc.technology_number
-        where pl.create_time between #{selectTime1} and #{selectTime2}
+        where  date(pl.create_time)>=#{selectTime1} and date(pl.create_time) &lt;= #{selectTime2}
         GROUP BY fc.process_id,fc.order_number, ogd.technology_number, pl.reporting_work_id
         order by pl.id desc, fc.process_id, ogd.technology_number
     </select>
@@ -1213,7 +1216,8 @@
                round(ogd.child_width)                                         as width,
                round(ogd.child_height)                                        as height,
                pd.separation,
-               fc.technology_number
+               fc.technology_number,
+               IFNULL(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S02')),'') as mapNumber
         from flow_card as fc
                  left join sd.order_glass_detail as ogd
                            on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and
@@ -2014,6 +2018,7 @@
                /*ogd.technology_number,*/
                ogd.glass_address,
                (fc.quantity)                                                          as quantity,
+               (fc.quantity)                                                          as printQuantity,
                round((ogd.child_width * ogd.child_height * fc.quantity / 1000000), 2) as total_area,
                od.product_name,
                ogd.glass_child,
@@ -2044,6 +2049,7 @@
                ogd.technology_number,
                ogd.glass_address,
                (fc.quantity)                                                          as quantity,
+               (fc.quantity)                                                          as printQuantity,
                round((ogd.child_width * ogd.child_height * fc.quantity / 1000000), 2) as total_area,
                od.product_name,
                ogd.glass_child,
@@ -2085,7 +2091,7 @@
                od.processing_note                                    as processingNote,
                width,
                height,
-               fc.quantity,
+               #{printQuantity}                                      as quantity,
                od.order_number                                       as orderNumber,
                fc.technology_number                                  as technologyNumber,
                od.building_number                                    as buildingNumber,
@@ -2114,7 +2120,8 @@
                '鏂囨湰' as custom2,
                '鏂囨湰' as custom3,
                '鏂囨湰' as custom4,
-               '鏂囨湰' as custom5
+               '鏂囨湰' as custom5,
+               od.quantity
         from sd.order as o
                  left join sd.order_detail as od on o.order_id = od.order_id
                  left join flow_card as fc on o.order_id = fc.order_id and
@@ -2226,11 +2233,11 @@
 
     <select id="remakList">
         SELECT
-            JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S01')) AS S01,
-            JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S04')) AS S02,
-            JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S05')) AS S03,
-            JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S06')) AS S04,
-            JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S07')) AS S05
+            ifnull(JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S01')),'') AS S01,
+            ifnull(JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S04')),'') AS S02,
+            ifnull(JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S05')),'') AS S03,
+            ifnull(JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S06')),'') AS S04,
+            ifnull(JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S07')),'') AS S05
         FROM flow_card as fc left join sd.order_detail as od on  fc.order_id = od.order_id
         and fc.order_number = od.order_number
         WHERE fc.process_id=#{processId}

--
Gitblit v1.8.0