diff --git a/src/main/java/com/spring/modules/sampleManagement/service/Impl/TechnicalSpecificationServiceImpl.java b/src/main/java/com/spring/modules/sampleManagement/service/Impl/TechnicalSpecificationServiceImpl.java index 8b00f522..e0eaddc4 100644 --- a/src/main/java/com/spring/modules/sampleManagement/service/Impl/TechnicalSpecificationServiceImpl.java +++ b/src/main/java/com/spring/modules/sampleManagement/service/Impl/TechnicalSpecificationServiceImpl.java @@ -2282,7 +2282,7 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification } } if (whereConditionArr[i].contains("customer_desc")){ - whereConditionArr[i] = "(dbo.plm_get_customer_desc(c.site, c.customer_id) " + customerDescSymbol + "'" + filteredList.get(i).getFormula() + "' or dbo.plm_get_dictDataLabel('finalCustomer', c.final_customer_id, c.site) " + customerDescSymbol + "'" + filteredList.get(i).getFormula()+"')"; + whereConditionArr[i] = "((select max(ci.customer_desc) from plm_customer_information ci where ci.customer_no = c.customer_id) " + customerDescSymbol + "'" + filteredList.get(i).getFormula() + "' or dbo.plm_get_dictDataLabel('finalCustomer', c.final_customer_id, c.site) " + customerDescSymbol + "'" + filteredList.get(i).getFormula()+"')"; } if (whereConditionArr[i].contains("cutterNumber")){ cutterNumber = whereConditionArr[i].split("'")[1]; diff --git a/src/main/resources/mapper/sampleManagement/TechnicalSpecificationMapper.xml b/src/main/resources/mapper/sampleManagement/TechnicalSpecificationMapper.xml index 1332a2ed..0715a90f 100644 --- a/src/main/resources/mapper/sampleManagement/TechnicalSpecificationMapper.xml +++ b/src/main/resources/mapper/sampleManagement/TechnicalSpecificationMapper.xml @@ -180,7 +180,7 @@ AND ( - dbo.plm_get_customer_desc(c.site, c.customer_id) like #{query.customerDesc} or + (select max(ci.customer_desc) from plm_customer_information ci where ci.customer_no = c.customer_id) like #{query.customerDesc} or dbo.plm_get_dictDataLabel('finalCustomer', c.final_customer_id, c.site) like #{query.customerDesc} ) @@ -2573,7 +2573,11 @@ FROM plm_technical_specification_sheet a left join view_Project_final_Part b on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no left join plm_project_info c on a.site = c.site and a.project_id = c.project_id - left join plm_customer_information cust on cust.site = c.site and cust.customer_no = c.customer_id + left join ( + select customer_no, max(customer_desc) as customer_desc + from plm_customer_information + group by customer_no + ) cust on cust.customer_no = c.customer_id left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002' left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and prh.workflow_id = d.workflow_id and a.step_id = d.step_id left join plm_customer_part_info pcpi on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no @@ -2621,7 +2625,7 @@ AND ( - dbo.plm_get_customer_desc(c.site, c.customer_id) like #{customerDesc}) + (select max(ci.customer_desc) from plm_customer_information ci where ci.customer_no = c.customer_id) like #{customerDesc}) and ${excludeStatusClause} @@ -2694,7 +2698,7 @@ AND ( - dbo.plm_get_customer_desc(c.site, c.customer_id) like #{customerDesc} or + (select max(ci.customer_desc) from plm_customer_information ci where ci.customer_no = c.customer_id) like #{customerDesc} or dbo.plm_get_dictDataLabel('finalCustomer', c.final_customer_id, c.site) like #{customerDesc} ) @@ -2935,7 +2939,11 @@ prh.workflow_id = d.workflow_id and a.step_id = d.step_id left join plm_customer_part_info pcpi on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no - left join plm_customer_information as pci on pcpi.site = pci.site and pcpi.customer_no = pci.customer_no + left join ( + select customer_no, max(customer_desc) as customer_desc + from plm_customer_information + group by customer_no + ) pci on pci.customer_no = pcpi.customer_no inner join plm_bm_prepress pbp on pbp.Site = a.site and pbp.code_no = a.code_no and (plateNo like #{cutterNumber} or @@ -3025,13 +3033,21 @@ left join view_Project_final_Part b on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no left join plm_project_info c on a.site = c.site and a.project_id = c.project_id - left join plm_customer_information cust on cust.site = c.site and cust.customer_no = c.customer_id + left join ( + select customer_no, max(customer_desc) as customer_desc + from plm_customer_information + group by customer_no + ) cust on cust.customer_no = c.customer_id left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002' left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and prh.workflow_id = d.workflow_id and a.step_id = d.step_id left join plm_customer_part_info pcpi on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no - left join plm_customer_information as pci on pcpi.site = pci.site and pcpi.customer_no = pci.customer_no + left join ( + select customer_no, max(customer_desc) as customer_desc + from plm_customer_information + group by customer_no + ) pci on pci.customer_no = pcpi.customer_no inner join plm_bm_prepress pbp on pbp.Site = a.site and pbp.code_no = a.code_no and (pbp.plateNo like #{cutterNumber} or