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};