Browse Source

2024-10-16

master
qiezi 2 years ago
parent
commit
af8c3efff1
  1. 401
      src/main/resources/mapper/Tooling/ProjectToolingApplyMapper.xml
  2. 6
      src/main/resources/mapper/proofing/ProofingInformationMapper.xml
  3. 4
      src/main/resources/mapper/quotation/QuotationInformationMapper.xml
  4. 143
      src/main/resources/mapper/sampleManagement/TechnicalSpecificationMapper.xml
  5. 5
      src/main/resources/mapper/test/TestInformationMapper.xml

401
src/main/resources/mapper/Tooling/ProjectToolingApplyMapper.xml

@ -1,20 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.spring.modules.Tooling.mapper.ProjectToolingApplyMapper">
<select id="projectInfoForToolApply" parameterType="PlmProjectInfoData" resultType="PlmProjectInfoData">
SELECT project_id,ori_project_id,project_type_db,project_name,status,project_source,customer_id,create_by,
create_date,update_by,update_date,priority,site,id,project_desc,customer_remark,remark,dbo.get_projectTeamName(site,project_id,'owner') projectOwnerName
,dbo.get_projectTeamName(site,project_id,'manager') ProjectManagerName,dbo.plm_get_dictDataLabel('project_info_type_db',project_type_db,site) projectType,
dbo.plm_get_projectBaseDesc(status,'project_status') projectStatusDesc,dbo.plm_get_dictDataLabel('project_info_source',project_source,site) projectSourceDesc,
dbo.plm_get_customer_desc(site,customer_id) customerName,dbo.plm_get_dictDataLabel('project_info_priority',priority,site) priorityDesc,need_date,
dbo.get_projectUserRoleName(site,project_id) userRoleName,parent_project_no,
final_customer_id,dbo.plm_get_customer_desc(site,final_customer_id) finalCustomerName
<select id="projectInfoForToolApply" parameterType="PlmProjectInfoData" resultType="PlmProjectInfoData">
SELECT project_id,
ori_project_id,
project_type_db,
project_name,
status,
project_source,
customer_id,
create_by,
create_date,
update_by,
update_date,
priority,
site,
id,
project_desc,
customer_remark,
remark,
dbo.get_projectTeamName(site, project_id, 'owner') projectOwnerName
,
dbo.get_projectTeamName(site, project_id, 'manager') ProjectManagerName,
dbo.plm_get_dictDataLabel('project_info_type_db', project_type_db, site) projectType,
dbo.plm_get_projectBaseDesc(status, 'project_status') projectStatusDesc,
dbo.plm_get_dictDataLabel('project_info_source', project_source, site) projectSourceDesc,
dbo.plm_get_customer_desc(site, customer_id) customerName,
dbo.plm_get_dictDataLabel('project_info_priority', priority, site) priorityDesc,
need_date,
dbo.get_projectUserRoleName(site, project_id) userRoleName,
parent_project_no,
final_customer_id,
dbo.plm_get_customer_desc(site, final_customer_id) finalCustomerName
FROM plm_project_info
<where>
<!-- and dbo.plm_get_projectBaseDesc(status,'project_status') !='未发布'-->
<!-- <if test="query.id != null">-->
<!-- AND id = #{query.id}-->
<!-- </if>-->
<!-- and dbo.plm_get_projectBaseDesc(status,'project_status') !='未发布'-->
<!-- <if test="query.id != null">-->
<!-- AND id = #{query.id}-->
<!-- </if>-->
<if test="query.site != null and query.site != ''">
AND site = #{query.site}
</if>
@ -24,188 +47,282 @@
<if test="query.projectType != null and query.projectType != ''">
AND plm_project_info.project_type_db like #{query.projectType}
</if>
<if test="query.projectName != null and query.projectName != ''">
<if test="query.projectName != null and query.projectName != ''">
AND plm_project_info.project_name like #{query.projectName}
</if>
<if test="query.projectOwnerName != null and query.projectOwnerName != ''">
AND dbo.get_projectTeamName(site,project_id,'ProjectOwner') like '%' + #{query.projectOwnerName} +'%'
AND dbo.get_projectTeamName(site, project_id, 'ProjectOwner') like '%' + #{query.projectOwnerName} + '%'
</if>
<!-- <if test="query.userName != null and query.userName != '' and query.userName != 'admin'">-->
<!-- AND project_id in ( select project_id from AccessProject where site=#{query.site} and username=#{query.userName} and searchFlag='Y' )-->
<!-- AND bu_no in ( select bu_no from AccessBu where site=#{query.site} and username=#{query.userName})-->
<!-- </if>-->
<!-- <if test="query.userName != null and query.userName != '' and query.userName != 'admin'">-->
<!-- AND project_id in ( select project_id from AccessProject where site=#{query.site} and username=#{query.userName} and searchFlag='Y' )-->
<!-- AND bu_no in ( select bu_no from AccessBu where site=#{query.site} and username=#{query.userName})-->
<!-- </if>-->
</where>
</select>
</select>
<select id="getProjectPartToolForApply" resultType="RoutingToolApplyData">
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
</select>
<insert id="saveApplyHeader">
INSERT INTO plm_project_tool_applyHeader (site,apply_no,apply_by,status_code,status,apply_date,applySumQty,applyReason,remark,
create_by,create_date,department,quoter,tp,purchaser,totalCost)
values
(#{site},#{applyNo},#{applyBy},#{statusCode},#{status},#{applyDate},#{applySumQty},#{applyReason},#{remark},#{createBy},
#{createDate},#{department},#{quoter},#{tp},#{purchaser},#{totalCost})
INSERT INTO plm_project_tool_applyHeader (site, apply_no, apply_by, status_code, status, apply_date,
applySumQty, applyReason, remark,
create_by, create_date, department, quoter, tp, purchaser, totalCost)
values (#{site}, #{applyNo}, #{applyBy}, #{statusCode}, #{status}, #{applyDate}, #{applySumQty}, #{applyReason},
#{remark}, #{createBy},
#{createDate}, #{department}, #{quoter}, #{tp}, #{purchaser}, #{totalCost})
</insert>
<insert id="saveApplyDetail">
INSERT INTO plm_project_tool_applyDetail (site,apply_no,seqNo,tool_id,standard_cost,applyQty,remark,orderRef1,orderRef2,orderRef3,orderRef4,orderRef5,orderRef6) values
<foreach collection="list" item="item" index="index" separator=",">
(#{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
<foreach collection="list" item="item" index="index" separator=",">
(#{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})
</foreach>
</insert>
<update id="updateRoutingToolRequireFlag">
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
</update>
<select id="searchToolApplyHeader" resultType="PlmProjectToolApplyHeaderData">
SELECT site,apply_no,apply_by,status_code,status,apply_date,applySumQty,applyReason,remark,create_by,create_date,update_by,
update_date,prNo,remark1,poNo,allCost,remark2,supplierName,department,dbo.plm_get_dictDataLabel('tool_application_department',department,site) departmentDesc
,tp,dbo.get_userDisPlay(tp) tpName ,quoter,dbo.get_userDisPlay(quoter) quoterName ,purchaser,dbo.get_userDisPlay(purchaser) purchaserName,step_id
,reject_flag ,reject_step_id,totalCost
SELECT site
, apply_no
, apply_by
, status_code
, status
, apply_date
, applySumQty
, applyReason
, remark
, create_by
, create_date
, update_by
, update_date
, prNo
, remark1
, poNo
, allCost
, remark2
, supplierName
, department
, dbo.plm_get_dictDataLabel('tool_application_department', department, site) departmentDesc
, tp
, dbo.get_userDisPlay(tp) tpName
, quoter
, dbo.get_userDisPlay(quoter) quoterName
, purchaser
, dbo.get_userDisPlay(purchaser) purchaserName
, step_id
, reject_flag
, reject_step_id
, totalCost
FROM plm_project_tool_applyHeader
<where>
<if test="query.site != null and query.site != ''">
AND site = #{query.site}
</if>
<if test="query.applyNo != null and query.applyNo != ''">
AND apply_no like #{query.applyNo}
</if>
<if test="query.startDate != null ">
<if test="query.startDate != null">
AND apply_date >= #{query.startDate}
</if>
<if test="query.endDate != null ">
AND #{query.endDate} >= apply_date
<if test="query.endDate != null">
AND #{query.endDate} >= apply_date
</if>
<!-- <if test="query.projectOwnerName != null and query.projectOwnerName != ''">-->
<!-- AND dbo.get_projectTeamName(site,project_id,'ProjectOwner') like '%' + #{query.projectOwnerName} +'%'-->
<!-- </if>-->
<!-- <if test="query.userName != null and query.userName != '' and query.userName != 'admin'">-->
<!-- AND project_id in ( select project_id from AccessProject where site=#{query.site} and username=#{query.userName} and searchFlag='Y' )-->
<!-- AND bu_no in ( select bu_no from AccessBu where site=#{query.site} and username=#{query.userName})-->
<!-- </if>-->
<!-- <if test="query.projectOwnerName != null and query.projectOwnerName != ''">-->
<!-- AND dbo.get_projectTeamName(site,project_id,'ProjectOwner') like '%' + #{query.projectOwnerName} +'%'-->
<!-- </if>-->
<!-- <if test="query.userName != null and query.userName != '' and query.userName != 'admin'">-->
<!-- AND project_id in ( select project_id from AccessProject where site=#{query.site} and username=#{query.userName} and searchFlag='Y' )-->
<!-- AND bu_no in ( select bu_no from AccessBu where site=#{query.site} and username=#{query.userName})-->
<!-- </if>-->
</where>
</select>
<select id="searchToolApplyDetail" resultType="PlmProjectToolApplyDetailData">
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)
<where>
<if test="site != null and site != ''">
AND a.site = #{site}
</if>
<if test="applyNo != null and applyNo != ''">
AND a.apply_no = #{applyNo}
</if>
<if test="orderRef1 != null and orderRef1 != ''">
AND a.orderRef1 = #{orderRef1}
</if>
</where>
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)
<where>
<if test="site != null and site != ''">
AND a.site = #{site}
</if>
<if test="applyNo != null and applyNo != ''">
AND a.apply_no = #{applyNo}
</if>
<if test="orderRef1 != null and orderRef1 != ''">
AND a.orderRef1 = #{orderRef1}
</if>
</where>
order by a.apply_no, a.seqNo
</select>
<select id="checkToolApplyHeaderData" resultType="PlmProjectToolApplyHeaderData">
select
site,
apply_no,
apply_by,
status_code,
status,
apply_date,
applySumQty,
applyReason,
remark,
create_by,
create_date,
update_by,
update_date,
prNo,
remark1,
poNo,
allCost,
remark2,
supplierName,
step_id,
reject_flag,
reject_step_id
,tp,dbo.get_userDisPlay(tp) tpName ,quoter,dbo.get_userDisPlay(quoter) quoterName ,purchaser,dbo.get_userDisPlay(purchaser) purchaserName
FROM plm_project_tool_applyHeader
where site = #{site} and apply_no = #{applyNo}
select site,
apply_no,
apply_by,
status_code,
status,
apply_date,
applySumQty,
applyReason,
remark,
create_by,
create_date,
update_by,
update_date,
prNo,
remark1,
poNo,
allCost,
remark2,
supplierName,
step_id,
reject_flag,
reject_step_id
,
tp,
dbo.get_userDisPlay(tp) tpName,
quoter,
dbo.get_userDisPlay(quoter) quoterName,
purchaser,
dbo.get_userDisPlay(purchaser) purchaserName
FROM plm_project_tool_applyHeader
where site = #{site}
and apply_no = #{applyNo}
</select>
<update id="comfirmToolApply">
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}
</update>
<delete id="deletetoolingApplyHeader">
delete from plm_project_tool_applyHeader where site=#{site} and apply_no=#{applyNo}
</delete>
<delete id="deletetoolingApplyDetail">
delete from plm_project_tool_applyDetail where site=#{site} and apply_no=#{applyNo}
</delete>
<update id="saveHeaderMessage">
update plm_project_tool_applyHeader set prNo=#{prNo},remark1=#{remark1},poNo=#{poNo},
allCost=#{allCost},remark2=#{remark2},supplierName=#{supplierName} where site=#{site} and apply_no=#{applyNo}
</update>
<delete id="deletetoolingApplyHeader">
delete
from plm_project_tool_applyHeader
where site = #{site}
and apply_no = #{applyNo}
</delete>
<delete id="deletetoolingApplyDetail">
delete
from plm_project_tool_applyDetail
where site = #{site}
and apply_no = #{applyNo}
</delete>
<update id="saveHeaderMessage">
update plm_project_tool_applyHeader
set prNo=#{prNo},
remark1=#{remark1},
poNo=#{poNo},
allCost=#{allCost},
remark2=#{remark2},
supplierName=#{supplierName}
where site = #{site}
and apply_no = #{applyNo}
</update>
<update id="updateApplyHeader">
update plm_project_tool_applyHeader
set applySumQty = #{applySumQty},
applyReason = #{applyReason},
remark = #{remark},
tp=#{tp},
quoter=#{quoter},
purchaser=#{purchaser},
totalCost=#{totalCost,jdbcType=DECIMAL}
where site = #{site} and apply_no = #{applyNo}
update plm_project_tool_applyHeader
set applySumQty = #{applySumQty},
applyReason = #{applyReason},
remark = #{remark},
tp=#{tp},
quoter=#{quoter},
purchaser=#{purchaser},
totalCost=#{totalCost,jdbcType=DECIMAL}
where site = #{site}
and apply_no = #{applyNo}
</update>
<update id="updateApplyDetail">
update plm_project_tool_applyDetail set applyQty=#{applyQty},standard_cost=#{standardCost} where site=#{site} and apply_no=#{applyNo} and seqNo=#{seqNo}
</update>
<update id="updateApplyDetail">
update plm_project_tool_applyDetail
set applyQty=#{applyQty},
standard_cost=#{standardCost}
where site = #{site}
and apply_no = #{applyNo}
and seqNo = #{seqNo}
</update>
<select id="getProjectPartToolDetail" resultType="PlmProjectToolApplyDetailData">
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}
</select>
</mapper>

6
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
<where>
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}
<if test="query.createBy != null and query.createBy != ''">
and vpp.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(a.site, #{query.createBy}))
</if>
<if test="query.customerNo != null and query.customerNo != ''">
AND customer_no like #{query.customerNo}
</if>

4
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
<where>
a.site = #{query.site}
and vpp.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(a.site, #{query.createBy}))
<if test="query.createBy != null and query.createBy != ''">
and vpp.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(a.site, #{query.createBy}))
</if>
<if test="query.quotationNo != null and query.quotationNo != ''">
AND a.quotation_no = #{query.quotationNo}
</if>

143
src/main/resources/mapper/sampleManagement/TechnicalSpecificationMapper.xml

@ -3,54 +3,101 @@
<mapper namespace="com.spring.modules.sampleManagement.dao.TechnicalSpecificationMapper">
<select id="technicalSpecificationListSearch" parameterType="PlmTechnicalSpecificationSheetData" resultType="PlmTechnicalSpecificationSheetData">
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
<where>
<if test="query.id != null">
AND a.id = #{query.id}
</if>
<if test="query.site != null and query.site != ''">
AND a.site = #{query.site}
</if>
<if test="query.oriCodeNo != null and query.oriCodeNo != ''">
AND a.ori_code_no like #{query.oriCodeNo}
</if>
<if test="query.codeNo != null and query.codeNo != ''">
AND a.code_no like #{query.codeNo}
</if>
<if test="query.projectId != null and query.projectId != ''">
AND a.project_id like #{query.projectId}
</if>
<if test="query.testPartNo != null and query.testPartNo != ''">
AND a.test_part_no like #{query.testPartNo}
</if>
<if test="query.statusDesc != null and query.statusDesc != ''">
AND dbo.plm_get_technicalBaseDesc(a.status,'status') like #{query.statusDesc}
</if>
<if test="query.buNo == null || query.buNo == ''">
AND b.bu_no in ( select bu_No from dbo.Get_Now_BU_chooseAble ( #{query.site}, #{query.userName}))
</if>
<if test="query.buNo != null and query.buNo != ''">
AND b.bu_no like #{query.buNo}
</if>
</where>
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
<where>
<if test="query.id != null">
AND a.id = #{query.id}
</if>
<if test="query.site != null and query.site != ''">
AND a.site = #{query.site}
</if>
<if test="query.oriCodeNo != null and query.oriCodeNo != ''">
AND a.ori_code_no like #{query.oriCodeNo}
</if>
<if test="query.codeNo != null and query.codeNo != ''">
AND a.code_no like #{query.codeNo}
</if>
<if test="query.projectId != null and query.projectId != ''">
AND a.project_id like #{query.projectId}
</if>
<if test="query.testPartNo != null and query.testPartNo != ''">
AND a.test_part_no like #{query.testPartNo}
</if>
<if test="query.statusDesc != null and query.statusDesc != ''">
AND dbo.plm_get_technicalBaseDesc(a.status, 'status') like #{query.statusDesc}
</if>
<if test="query.buNo == null || query.buNo == ''">
AND b.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(#{query.site}, #{query.userName}))
</if>
<if test="query.buNo != null and query.buNo != ''">
AND b.bu_no like #{query.buNo}
</if>
</where>
order by a.code_no desc
</select>
<insert id="saveTechnicalSpecificationSheet">

5
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
<where>
a.site = #{query.site}
and vpp.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(a.site, #{query.createBy}))
<if test="query.createBy != null and query.createBy != ''">
and vpp.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(a.site, #{query.createBy}))
</if>
<if test="query.testNo != null and query.testNo != ''">
AND a.test_no like #{query.testNo}
</if>

Loading…
Cancel
Save