From 51febf0ef7ec603c007e4b841c009d8630d60f49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=B1=B3?= <470431449@qq.com> Date: Sat, 29 Jun 2024 12:11:23 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=8F=98=E6=9B=B4=E5=BD=B1=E5=93=8D?= =?UTF-8?q?=E5=8F=8A=E5=90=8C=E6=AD=A5formal=E8=A1=A8=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/BomNewEbomParentService.java | 3 +- .../mapper/master/BomNewEbomParentMapper.xml | 226 ++++++++++-------- 2 files changed, 123 insertions(+), 106 deletions(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java index ae0acecc..8a426533 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java @@ -2530,9 +2530,10 @@ public class BomNewEbomParentService extends ServiceImpl - + @@ -54,8 +54,7 @@ - - + @@ -87,13 +86,16 @@ - SELECT status , created_by as bomCreatedBy , row_id as bomRowId, row_id as childBomRowId, a.* + SELECT status , created_by as bomCreatedBy , row_id as bomRowId, row_id as childBomRowId, a.* FROM t_bom_new_ebom_parent a - join (select material_no,max(current_version) current_version from t_bom_new_ebom_parent where - + join (select material_no,max(current_version) current_version from t_bom_new_ebom_parent where + status = 4 - - + + created_by=#{createdBy} and status in (1,3) - + (created_by=#{createdBy} or status=2 ) - and material_no in #{item} - group by material_no ) b on a.material_no=b.material_no and a.current_version=b.current_version - + group by material_no ) b on a.material_no=b.material_no and a.current_version=b.current_version - - - - - - - - - - + + + + + + + + + + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - select COUNT(1) from t_bom_new_ebom_parent a join t_bom_new_ebom_child b on a.row_id=b.parent_row_id and a.`status`=4 - and b.material_no=#{materialNo} + select COUNT(1) + from t_bom_new_ebom_parent a + join t_bom_new_ebom_child b on a.row_id = b.parent_row_id and a.`status` = 4 + and b.material_no = #{materialNo} @@ -342,23 +348,26 @@ where true - and a.bom_version_row_id=#{bomVersionRowId} + and a.bom_version_row_id=#{bomVersionRowId} and b.convert_to_ebom_time >= #{startDate} and b.expire_end_time <=#{endDate} - and a.material_no =#{materialNo} + and a.material_no =#{materialNo} - + UPDATE t_bom_new_ebom_parent p - SET p.bom_exist = (IF(EXISTS (SELECT 1 FROM t_bom_new_ebom_child WHERE parent_row_id = p.row_id), 1, 0)) + SET p.bom_exist = (IF(EXISTS(SELECT 1 FROM t_bom_new_ebom_child WHERE parent_row_id = p.row_id), 1, 0)) WHERE p.row_id = #{rowId};