From af8c3efff1535105a0e944b46c17296e408b27cc Mon Sep 17 00:00:00 2001
From: qiezi <15576055375@163.com>
Date: Wed, 16 Oct 2024 16:00:02 +0800
Subject: [PATCH] 2024-10-16
---
.../Tooling/ProjectToolingApplyMapper.xml | 401 +++++++++++-------
.../proofing/ProofingInformationMapper.xml | 6 +-
.../quotation/QuotationInformationMapper.xml | 4 +-
.../TechnicalSpecificationMapper.xml | 143 ++++---
.../mapper/test/TestInformationMapper.xml | 5 +-
5 files changed, 365 insertions(+), 194 deletions(-)
diff --git a/src/main/resources/mapper/Tooling/ProjectToolingApplyMapper.xml b/src/main/resources/mapper/Tooling/ProjectToolingApplyMapper.xml
index 8dfb43c1..f865d37f 100644
--- a/src/main/resources/mapper/Tooling/ProjectToolingApplyMapper.xml
+++ b/src/main/resources/mapper/Tooling/ProjectToolingApplyMapper.xml
@@ -1,20 +1,43 @@
-
- SELECT b.site,b.project_id,d.part_no,b.part_desc,c.routing_revision,c.routing_type,c.alternative_no,c.operation_no,c.operation_name,
- d.operation_id,d.tool_id,d.tool_qty,d.remark,e.tool_description,e.standard_cost
- ,dbo.plm_get_alternativeDesc(c.site,c.part_no,c.routing_revision,c.routing_type,c.alternative_no) alternativeDescription
+ SELECT b.site,
+ b.project_id,
+ d.part_no,
+ b.part_desc,
+ c.routing_revision,
+ c.routing_type,
+ c.alternative_no,
+ c.operation_no,
+ c.operation_name,
+ d.operation_id,
+ d.tool_id,
+ d.tool_qty,
+ d.remark,
+ e.tool_description,
+ e.standard_cost
+ ,
+ dbo.plm_get_alternativeDesc(c.site, c.part_no, c.routing_revision, c.routing_type,
+ c.alternative_no) alternativeDescription
FROM view_Project_Part b
- left join plm_routing_component c on b.site=c.site and b.test_part_no=c.part_no
- left join routing_tool d on c.site=d.site and c.part_no=d.part_no and c.routing_revision=d.routing_revision and c.routing_type=d.routing_type
- and c.operation_id=d.operation_id
- left join tool_header e on d.site=e.site and d.tool_id=e.tool_id
- where b.site=#{site} and b.project_id in ${projectId} and d.tool_id is not null and b.active='Y'
- order by b.project_id,d.part_no,c.routing_revision,c.routing_type,c.alternative_no,c.operation_no
+ left join plm_routing_component c on b.site = c.site and b.test_part_no = c.part_no
+ left join routing_tool d
+ on c.site = d.site and c.part_no = d.part_no and c.routing_revision = d.routing_revision and
+ c.routing_type = d.routing_type
+ and c.operation_id = d.operation_id
+ left join tool_header e on d.site = e.site and d.tool_id = e.tool_id
+ where b.site = #{site}
+ and b.project_id in ${projectId}
+ and d.tool_id is not null
+ and b.active = 'Y'
+ order by b.project_id, d.part_no, c.routing_revision, c.routing_type, c.alternative_no, c.operation_no
- INSERT INTO plm_project_tool_applyDetail (site,apply_no,seqNo,tool_id,standard_cost,applyQty,remark,orderRef1,orderRef2,orderRef3,orderRef4,orderRef5,orderRef6) values
-
- (#{item.site},#{item.applyNo},#{item.seqNo},#{item.toolId},#{item.standardCost},#{item.applyQty},#{item.remark},#{item.orderRef1},
- #{item.orderRef2},#{item.orderRef3},#{item.orderRef4},#{item.orderRef5},#{item.orderRef6})
+ INSERT INTO plm_project_tool_applyDetail (site, apply_no, seqNo, tool_id, standard_cost, applyQty, remark,
+ orderRef1, orderRef2, orderRef3, orderRef4, orderRef5,
+ orderRef6) values
+
+ (#{item.site}, #{item.applyNo}, #{item.seqNo}, #{item.toolId}, #{item.standardCost}, #{item.applyQty},
+ #{item.remark}, #{item.orderRef1},
+ #{item.orderRef2}, #{item.orderRef3}, #{item.orderRef4}, #{item.orderRef5}, #{item.orderRef6})
-
-
-
- update routing_tool set ApplyFlag='Y' from plm_project_tool_applyDetail b
- where b.site=#{site} and b.apply_no=#{newApplyNo}
- and routing_tool.site=b.Site and routing_tool.part_no=b.orderRef2 and CONVERT(varchar(20),routing_tool.routing_revision) =b.orderRef3 and
- routing_tool.routing_type=b.orderRef4 and routing_tool.alternative_no=b.orderRef5
- and CONVERT(varchar(20), routing_tool.operation_id)=b.orderRef6
+ update routing_tool
+ set ApplyFlag='Y'
+ from plm_project_tool_applyDetail b
+ where b.site = #{site}
+ and b.apply_no = #{newApplyNo}
+ and routing_tool.site = b.Site
+ and routing_tool.part_no = b.orderRef2
+ and CONVERT(varchar(20), routing_tool.routing_revision) = b.orderRef3
+ and routing_tool.routing_type = b.orderRef4
+ and routing_tool.alternative_no = b.orderRef5
+ and CONVERT(varchar(20), routing_tool.operation_id) = b.orderRef6
- select a.site,a.apply_no,a.seqNo,a.tool_id,a.standard_cost,a.applyQty,a.remark,a.orderRef1,a.orderRef2,a.orderRef3,a.orderRef4,
-a.orderRef5,dbo.plm_get_toolDesc(a.site,a.tool_id) toolDesc,a.orderRef6,b.operation_no,b.operation_name
- from plm_project_tool_applyDetail a left join plm_routing_component b on a.site=b.site and a.orderRef6=convert(varchar(20),b.operation_id)
-
-
- AND a.site = #{site}
-
-
- AND a.apply_no = #{applyNo}
-
-
- AND a.orderRef1 = #{orderRef1}
-
-
- order by a.apply_no, a.seqNo
+ select a.site,
+ a.apply_no,
+ a.seqNo,
+ a.tool_id,
+ a.standard_cost,
+ a.applyQty,
+ a.remark,
+ a.orderRef1,
+ a.orderRef2,
+ a.orderRef3,
+ a.orderRef4,
+ a.orderRef5,
+ dbo.plm_get_toolDesc(a.site, a.tool_id) toolDesc,
+ a.orderRef6,
+ b.operation_no,
+ b.operation_name
+ from plm_project_tool_applyDetail a
+ left join plm_routing_component b
+ on a.site = b.site and a.orderRef6 = convert(varchar(20), b.operation_id)
+
+
+ AND a.site = #{site}
+
+
+ AND a.apply_no = #{applyNo}
+
+
+ AND a.orderRef1 = #{orderRef1}
+
+
+ order by a.apply_no, a.seqNo
update plm_project_tool_applyHeader
set status_code = #{statusCode},
- status = #{status}
- where site = #{site} and apply_no = #{applyNo}
+ status = #{status}
+ where site = #{site}
+ and apply_no = #{applyNo}
-
-
- delete from plm_project_tool_applyDetail where site=#{site} and apply_no=#{applyNo}
-
-
+
+
+ delete
+ from plm_project_tool_applyDetail
+ where site = #{site}
+ and apply_no = #{applyNo}
+
+
-
- update plm_project_tool_applyDetail set applyQty=#{applyQty},standard_cost=#{standardCost} where site=#{site} and apply_no=#{applyNo} and seqNo=#{seqNo}
-
+
+ update plm_project_tool_applyDetail
+ set applyQty=#{applyQty},
+ standard_cost=#{standardCost}
+ where site = #{site}
+ and apply_no = #{applyNo}
+ and seqNo = #{seqNo}
+
- select
- site,
- apply_no,
- seqNo,
- tool_id,
- standard_cost,
- applyQty,
- remark,
- orderRef1,
- orderRef2,
- orderRef3,
- orderRef4,
- orderRef5,
- unit_cost,
- orderRef6
+ select site,
+ apply_no,
+ seqNo,
+ tool_id,
+ standard_cost,
+ applyQty,
+ remark,
+ orderRef1,
+ orderRef2,
+ orderRef3,
+ orderRef4,
+ orderRef5,
+ unit_cost,
+ orderRef6
FROM plm_project_tool_applyDetail
- where site = #{site} and apply_no = #{applyNo}
+ where site = #{site}
+ and apply_no = #{applyNo}
\ No newline at end of file
diff --git a/src/main/resources/mapper/proofing/ProofingInformationMapper.xml b/src/main/resources/mapper/proofing/ProofingInformationMapper.xml
index 44ad06a4..45d6e4a0 100644
--- a/src/main/resources/mapper/proofing/ProofingInformationMapper.xml
+++ b/src/main/resources/mapper/proofing/ProofingInformationMapper.xml
@@ -61,8 +61,10 @@
on vpp.site = a.site and vpp.test_part_no = a.test_part_no and vpp.project_id = a.project_id
left join BU b on vpp.bu_no = b.bu_no and a.site = b.site
- a.site = #{query.site} and
- vpp.bu_no in ( select bu_No from dbo.Get_Now_BU_chooseAble (a.site,#{query.createBy}))
+ a.site = #{query.site}
+
+ and vpp.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(a.site, #{query.createBy}))
+
AND customer_no like #{query.customerNo}
diff --git a/src/main/resources/mapper/quotation/QuotationInformationMapper.xml b/src/main/resources/mapper/quotation/QuotationInformationMapper.xml
index e81458cb..4a1054a7 100644
--- a/src/main/resources/mapper/quotation/QuotationInformationMapper.xml
+++ b/src/main/resources/mapper/quotation/QuotationInformationMapper.xml
@@ -122,7 +122,9 @@
left join BU b on vpp.bu_no = b.bu_no and a.site = b.site
a.site = #{query.site}
- and vpp.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(a.site, #{query.createBy}))
+
+ and vpp.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(a.site, #{query.createBy}))
+
AND a.quotation_no = #{query.quotationNo}
diff --git a/src/main/resources/mapper/sampleManagement/TechnicalSpecificationMapper.xml b/src/main/resources/mapper/sampleManagement/TechnicalSpecificationMapper.xml
index 264ac9a1..bad63868 100644
--- a/src/main/resources/mapper/sampleManagement/TechnicalSpecificationMapper.xml
+++ b/src/main/resources/mapper/sampleManagement/TechnicalSpecificationMapper.xml
@@ -3,54 +3,101 @@
- SELECT a.id,a.site,a.code_no,a.project_id,a.test_part_no,a.status,a.rev_no,a.work_center_no,a.ECN_flag,a.ECN_no,a.ori_code_no,
- a.ECN_address,a.remark,a.create_date,a.create_by,a.update_date,a.update_by,b.final_part_no,b.part_type partTypeDesc,
- b.part_type,b.part_name,b.part_desc,b.part_spec,dbo.plm_get_technicalBaseDesc(a.status,'status') statusDesc,a.proofing_no,b.bu_no,dbo.plm_get_bu_desc(a.site,b.bu_no) buDesc,
- dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'engineer') engineer,
- dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'technician') technician,process,
- dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'quotationOfficer') quotationOfficer,c.customer_Id
- ,a.picture_addess,a.customerPictureChangeRemark,a.productionFileComments,a.bom_type,a.eng_chg_level,a.bom_alternative_no,a.routing_type,a.routing_revision,
- a.routing_alternative_no,a.pod,
- a.mpOperator,dbo.get_userDisPlay(a.mpOperator) mpOperatorName
- , a.cqcOperator,dbo.get_userDisPlay(a.cqcOperator) cqcOperatorName
- , a.faiOperator,dbo.get_userDisPlay(a.faiOperator) faiOperatorName
- ,a.peOperater,dbo.get_userDisPlay(a.peOperater) peOperaterName
- ,a.csOperater,dbo.get_userDisPlay(a.csOperater) csOperaterName
- ,a.dccOperater,dbo.get_userDisPlay(a.dccOperater) dccOperaterName
-
- 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
-
-
- AND a.id = #{query.id}
-
-
- AND a.site = #{query.site}
-
-
- AND a.ori_code_no like #{query.oriCodeNo}
-
-
- AND a.code_no like #{query.codeNo}
-
-
- AND a.project_id like #{query.projectId}
-
-
- AND a.test_part_no like #{query.testPartNo}
-
-
- AND dbo.plm_get_technicalBaseDesc(a.status,'status') like #{query.statusDesc}
-
-
- AND b.bu_no in ( select bu_No from dbo.Get_Now_BU_chooseAble ( #{query.site}, #{query.userName}))
-
-
- AND b.bu_no like #{query.buNo}
-
-
- order by a.code_no desc
+ SELECT a.id,
+ a.site,
+ a.code_no,
+ a.project_id,
+ a.test_part_no,
+ a.status,
+ a.rev_no,
+ a.work_center_no,
+ a.ECN_flag,
+ a.ECN_no,
+ a.ori_code_no,
+ a.ECN_address,
+ a.remark,
+ a.create_date,
+ a.create_by,
+ a.update_date,
+ a.update_by,
+ b.final_part_no,
+ b.part_type partTypeDesc,
+ b.part_type,
+ b.part_name,
+ b.part_desc,
+ b.part_spec,
+ dbo.plm_get_technicalBaseDesc(a.status, 'status') statusDesc,
+ a.proofing_no,
+ b.bu_no,
+ dbo.plm_get_bu_desc(a.site, b.bu_no) buDesc,
+ dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'engineer') engineer,
+ dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'technician') technician,
+ process,
+ dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'quotationOfficer') quotationOfficer,
+ c.customer_Id
+ ,
+ a.picture_addess,
+ a.customerPictureChangeRemark,
+ a.productionFileComments,
+ a.bom_type,
+ a.eng_chg_level,
+ a.bom_alternative_no,
+ a.routing_type,
+ a.routing_revision,
+ a.routing_alternative_no,
+ a.pod,
+ a.mpOperator,
+ dbo.get_userDisPlay(a.mpOperator) mpOperatorName
+ ,
+ a.cqcOperator,
+ dbo.get_userDisPlay(a.cqcOperator) cqcOperatorName
+ ,
+ a.faiOperator,
+ dbo.get_userDisPlay(a.faiOperator) faiOperatorName
+ ,
+ a.peOperater,
+ dbo.get_userDisPlay(a.peOperater) peOperaterName
+ ,
+ a.csOperater,
+ dbo.get_userDisPlay(a.csOperater) csOperaterName
+ ,
+ a.dccOperater,
+ dbo.get_userDisPlay(a.dccOperater) dccOperaterName
+
+ 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
+
+
+ AND a.id = #{query.id}
+
+
+ AND a.site = #{query.site}
+
+
+ AND a.ori_code_no like #{query.oriCodeNo}
+
+
+ AND a.code_no like #{query.codeNo}
+
+
+ AND a.project_id like #{query.projectId}
+
+
+ AND a.test_part_no like #{query.testPartNo}
+
+
+ AND dbo.plm_get_technicalBaseDesc(a.status, 'status') like #{query.statusDesc}
+
+
+ AND b.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(#{query.site}, #{query.userName}))
+
+
+ AND b.bu_no like #{query.buNo}
+
+
+ order by a.code_no desc
diff --git a/src/main/resources/mapper/test/TestInformationMapper.xml b/src/main/resources/mapper/test/TestInformationMapper.xml
index df20006c..b85bdf4d 100644
--- a/src/main/resources/mapper/test/TestInformationMapper.xml
+++ b/src/main/resources/mapper/test/TestInformationMapper.xml
@@ -66,7 +66,10 @@
left join BU b on vpp.bu_no = b.bu_no and a.site = b.site
a.site = #{query.site}
- and vpp.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(a.site, #{query.createBy}))
+
+
+ and vpp.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(a.site, #{query.createBy}))
+
AND a.test_no like #{query.testNo}