You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1649 lines
81 KiB
1649 lines
81 KiB
<?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.sampleManagement.dao.TechnicalSpecificationMapper">
|
|
|
|
<resultMap id="getTechnicalSpecificationSheetData" type="PlmTechnicalSpecificationSheetData">
|
|
<result column="id" property="id"/>
|
|
<result column="site" property="site"/>
|
|
<result column="code_no" property="codeNo"/>
|
|
<result column="project_id" property="projectId"/>
|
|
<result column="test_part_no" property="testPartNo"/>
|
|
<result column="status" property="status"/>
|
|
<result column="rev_no" property="revNo"/>
|
|
<result column="work_center_no" property="workCenterNo"/>
|
|
<result column="ECN_flag" property="ecnFlag"/>
|
|
<result column="ECN_no" property="ecnNo"/>
|
|
<result column="ori_code_no" property="oriCodeNo"/>
|
|
<result column="ECN_address" property="ecnAddress"/>
|
|
<result column="remark" property="remark"/>
|
|
<result column="create_date" property="createDate"/>
|
|
<result column="create_by" property="createBy"/>
|
|
<result column="update_date" property="updateDate"/>
|
|
<result column="update_by" property="updateBy"/>
|
|
<result column="final_part_no" property="finalPartNo"/>
|
|
<result column="partTypeDesc" property="partTypeDesc"/>
|
|
<result column="partType" property="partType"/>
|
|
<result column="part_name" property="partName"/>
|
|
<result column="part_desc" property="partDesc"/>
|
|
<result column="part_spec" property="partSpec"/>
|
|
<result column="statusDesc" property="statusDesc"/>
|
|
<result column="proofing_no" property="proofingNo"/>
|
|
<result column="bu_no" property="buNo"/>
|
|
<result column="buDesc" property="buDesc"/>
|
|
<result column="engineer" property="engineer"/>
|
|
<result column="technician" property="technician"/>
|
|
<result column="process" property="process"/>
|
|
<result column="quotationOfficer" property="quotationOfficer"/>
|
|
<result column="engineerNo" property="engineerNo"/>
|
|
<result column="technicianNo" property="technicianNo"/>
|
|
<result column="customer_Id" property="customerId"/>
|
|
<result column="picture_addess" property="pictureAddess"/>
|
|
<result column="customerPictureChangeRemark" property="customerPictureChangeRemark"/>
|
|
<result column="productionFileComments" property="productionFileComments"/>
|
|
<result column="bom_type" property="bomType"/>
|
|
<result column="eng_chg_level" property="engChgLevel"/>
|
|
<result column="bom_alternative_no" property="bomAlternativeNo"/>
|
|
<result column="routing_type" property="routingType"/>
|
|
<result column="routing_revision" property="routingRevision"/>
|
|
<result column="routing_alternative_no" property="routingAlternativeNo"/>
|
|
<result column="pod" property="pod"/>
|
|
<result column="mpOperator" property="mpOperator"/>
|
|
<result column="mpOperatorName" property="mpOperatorName"/>
|
|
<result column="cqcOperator" property="cqcOperator"/>
|
|
<result column="cqcOperatorName" property="cqcOperatorName"/>
|
|
<result column="faiOperator" property="faiOperator"/>
|
|
<result column="faiOperatorName" property="faiOperatorName"/>
|
|
<result column="peOperater" property="peOperater"/>
|
|
<result column="peOperaterName" property="peOperaterName"/>
|
|
<result column="csOperater" property="csOperater"/>
|
|
<result column="dccOperater" property="dccOperater"/>
|
|
<result column="dccOperaterName" property="dccOperaterName"/>
|
|
<result column="is_reject" property="isReject"/>
|
|
<result column="node_id" property="nodeId"/>
|
|
<result column="node_name" property="nodeName"/>
|
|
<result column="customer_part_no" property="customerPartNo"/>
|
|
<result column="sp" property="sp"/>
|
|
<result column="remarkPage" property="remarkPage"/>
|
|
<result column="rev" property="rev"/>
|
|
<result column="customer_rev" property="customerRev"/>
|
|
<result column="plm_part_no" property="plmPartNo"/>
|
|
<result column="project_name" property="projectName"/>
|
|
</resultMap>
|
|
|
|
<select id="technicalSpecificationListSearch" parameterType="PlmTechnicalSpecificationSheetData" resultType="PlmTechnicalSpecificationSheetData">
|
|
SELECT a.id,
|
|
a.site,
|
|
a.code_no as codeNo,
|
|
a.project_id as projectId,
|
|
a.test_part_no as testPartNo,
|
|
a.status,
|
|
a.rev_no as revNo,
|
|
a.work_center_no as workCenterNo,
|
|
a.ECN_flag as ecnFlag,
|
|
a.ECN_no as ecnNo,
|
|
a.ori_code_no as oriCodeNo,
|
|
a.ECN_address as ecnAddress,
|
|
a.remark,
|
|
a.create_date as createDate,
|
|
a.create_by as createBy,
|
|
a.update_date as updateDate,
|
|
a.update_by as updateBy,
|
|
b.final_part_no as finalPartNo,
|
|
b.part_type as partTypeDesc,
|
|
b.part_type as partType,
|
|
b.part_name as partName,
|
|
b.part_desc as partDesc,
|
|
b.part_spec as partSpec,
|
|
dbo.plm_get_technicalBaseDesc(a.status, 'status') as statusDesc,
|
|
a.proofing_no as proofingNo,
|
|
b.bu_no as buNo,
|
|
dbo.plm_get_bu_desc(a.site, b.bu_no) as buDesc,
|
|
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'engineer') as engineer,
|
|
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'technician') as technician,
|
|
process,
|
|
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'quotationOfficer') as quotationOfficer,
|
|
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'engineer') as engineerNo,
|
|
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'technician') as technicianNo,
|
|
c.customer_Id as customerId,
|
|
a.picture_addess as pictureAddess,
|
|
a.customerPictureChangeRemark,
|
|
a.productionFileComments,
|
|
a.bom_type as bomType,
|
|
a.eng_chg_level as engChgLevel,
|
|
a.bom_alternative_no as bomAlternativeNo,
|
|
a.routing_type as routingType,
|
|
a.routing_revision as routingRevision,
|
|
a.routing_alternative_no as routingAlternativeNo,
|
|
a.pod,
|
|
a.mpOperator,
|
|
dbo.get_userDisPlay(a.mpOperator) as mpOperatorName,
|
|
a.cqcOperator,
|
|
dbo.get_userDisPlay(a.cqcOperator) as cqcOperatorName,
|
|
a.faiOperator,
|
|
dbo.get_userDisPlay(a.faiOperator) as faiOperatorName,
|
|
a.peOperater,
|
|
dbo.get_userDisPlay(a.peOperater) as peOperaterName,
|
|
a.csOperater,
|
|
dbo.get_userDisPlay(a.csOperater) as csOperaterName,
|
|
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'dcc') as dccOperater,
|
|
dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'dcc') as dccOperaterName,
|
|
d.is_reject as isReject,
|
|
d.node_id as nodeId,
|
|
d.node_name as nodeName,
|
|
pcpi.customer_part_no as customerPartNo,
|
|
dbo.get_plm_Approval_username(a.site, prh.workflow_id, d.node_id, a.code_no) as sp,
|
|
a.remarkPage,
|
|
a.rev,
|
|
a.customer_rev as customerRev,
|
|
b.plm_part_no as plmPartNo,
|
|
c.project_name as projectName
|
|
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_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
|
|
<if test="query.cutterNumber != null and query.cutterNumber != ''">
|
|
inner join plm_bm_prepress pbp on pbp.Site = a.site and pbp.code_no = a.code_no and
|
|
(plateNo like #{query.cutterNumber} or
|
|
cutterNumber like #{query.cutterNumber})
|
|
</if>
|
|
<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.ecnFlag != null and query.ecnFlag != ''">
|
|
AND a.ecn_flag = #{query.ecnFlag}
|
|
</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} or
|
|
b.final_part_no like #{query.testPartNo} or
|
|
a.relevance_part_no like #{query.testPartNo} or
|
|
pcpi.customer_part_no like #{query.testPartNo}
|
|
)
|
|
</if>
|
|
<if test="query.customerDesc != null and query.customerDesc != ''">
|
|
AND (
|
|
dbo.plm_get_customer_desc(c.site, c.customer_id) like #{query.customerDesc} or
|
|
dbo.plm_get_dictDataLabel('finalCustomer', c.final_customer_id, c.site) like #{query.customerDesc}
|
|
)
|
|
</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.ori_code_no desc, a.rev_no desc
|
|
</select>
|
|
|
|
<insert id="saveTechnicalSpecificationSheet">
|
|
insert into plm_technical_specification_sheet(site, code_no, project_id, test_part_no, status, rev_no, ECN_flag,
|
|
ECN_no, ECN_address, remark,
|
|
create_date, create_by, proofing_no, ori_code_no, bom_type,
|
|
eng_chg_level, bom_alternative_no, routing_type, routing_revision,
|
|
routing_alternative_no, stage, materialType, step_id
|
|
, cqcOperator, faiOperator, peOperater, csOperater, mpOperator, rev, customer_rev,certification)
|
|
values ( #{site}, #{codeNo}, #{projectId}, #{testPartNo}, #{status}, #{revNo}, #{ecnFlag}, #{ecnNo}, #{ecnAddress}
|
|
, #{remark}, GetDate(), #{createBy}, #{proofingNo}, #{oriCodeNo}, #{bomType}, #{engChgLevel,jdbcType=INTEGER}
|
|
, #{bomAlternativeNo}, #{routingType}, #{routingRevision,jdbcType=INTEGER}, #{routingAlternativeNo}, 'Sample'
|
|
, 'Label', 10
|
|
, #{cqcOperator}, #{faiOperator}, #{peOperater}, #{csOperater}, #{mpOperator}, #{rev}, #{customerRev},'RoHs')
|
|
</insert>
|
|
|
|
<update id="updateProjectPartNowBm">
|
|
update plm_project_part set now_bm=#{codeNo} where site=#{site} and project_id=#{projectId} and test_part_no=#{testPartNo}
|
|
</update>
|
|
|
|
<insert id="saveTechnicalSpecificationTeams">
|
|
insert into plm_technicalSpecification_team (site,code_no,operator_id,type)
|
|
values (#{site},#{codeNo},#{operatorId},#{type})
|
|
</insert>
|
|
<insert id="saveBatchTechnicalSpecificationTeams" >
|
|
insert into plm_technicalSpecification_team (site,code_no,operator_id,type)
|
|
values
|
|
<foreach collection="list" item="item" separator=",">
|
|
(#{item.site},#{item.codeNo},#{item.operatorId},#{item.type})
|
|
</foreach>
|
|
</insert>
|
|
|
|
<update id="updateTechnicalSpecificationSheet">
|
|
update plm_technical_specification_sheet set project_id=#{projectId},test_part_no=#{testPartNo},status=#{status}
|
|
,rev_no=#{revNo},ECN_no=#{ecnNo},ECN_flag=#{ecnFlag},ECN_address=#{ecnAddress},remark=#{remark},update_date=GetDate(),update_by=#{updateBy}
|
|
,cqcOperator=#{cqcOperator},faiOperator=#{faiOperator},peOperater=#{peOperater},
|
|
csOperater=#{csOperater},mpOperator=#{mpOperator},rev=#{rev},customer_rev=#{customerRev}
|
|
where id=#{id}
|
|
</update>
|
|
|
|
<delete id="deleteTechnicalSpecificationTeamsForBase">
|
|
delete from plm_technicalSpecification_team where site=#{site} and code_no=#{codeNo} and type in ('quotationOfficer','engineer','technician','dcc','cqc','fai')
|
|
</delete>
|
|
<delete id="deleteTechnicalSpecificationTeamsForDetail">
|
|
delete from plm_technicalSpecification_team where site=#{site} and code_no=#{codeNo} and type in ('reviewEngineer','peEngineer','cqe')
|
|
</delete>
|
|
<select id="searchTechnicalSpecificationTeamStr" resultType="String">
|
|
select operator_id from plm_technicalSpecification_team where type=#{type} and site=#{site} and code_no=#{codeNo}
|
|
</select>
|
|
|
|
<select id="getTechnicalCustomerInfoData" resultType="TechnicalCustomerInfoData">
|
|
select a.id,b.customer_id,c.customer_desc as customerName,c.customer_description as customerDesc ,b.customer_Remark,b.remark,
|
|
a.picture_addess,a.customerPictureChangeRemark,a.productionFileComments
|
|
from plm_technical_specification_sheet a
|
|
left join plm_project_info b on a.site=b.site and a.project_id=b.project_id
|
|
left join plm_customer_information c on b.site=c.site and b.customer_id=c.customer_no where a.id=#{id}
|
|
|
|
</select>
|
|
|
|
<select id="searchBMUser" resultType="PlmOperatorData">
|
|
select a.username operator_id, a.user_display operator_name, b.site, b.bu_no as buNo
|
|
from sys_user a
|
|
left join AccessBu b on a.username = b.username
|
|
<if test="roleNo != null and roleNo != ''">
|
|
inner join AccessRole r on r.username = a.username and r.role_no = #{roleNo}
|
|
</if>
|
|
where b.bu_no = #{buNo}
|
|
<if test="roleNo != null and roleNo != ''">
|
|
and r.site = #{site}
|
|
</if>
|
|
and b.site = #{site}
|
|
order by a.username desc
|
|
</select>
|
|
|
|
<select id="tsdBasicInformationSearch" resultType="PlmTechnicalSpecificationSheetData">
|
|
SELECT top 1 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,
|
|
b.bu_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,
|
|
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'engineer') engineer,
|
|
stage,
|
|
dbo.plm_get_dictDataLabel('bm_process', process, a.site) process,
|
|
remarkPage,
|
|
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'quotationOfficer') quotationOfficer,
|
|
c.customer_Id,
|
|
a.ori_code_no,
|
|
a.overPrintOperator,
|
|
a.printOperator,
|
|
dbo.get_userDisPlay(a.overPrintOperator) overPrintOperatorName,
|
|
dbo.get_userDisPlay(a.printOperator) printOperatorName,
|
|
a.peOperater,
|
|
dbo.get_userDisPlay(a.peOperater) peOperaterName,
|
|
a.csOperater,
|
|
dbo.get_userDisPlay(a.csOperater) csOperaterName,
|
|
isnull(a.step_id, 10) stepId,
|
|
d.is_reject,
|
|
a.pod,
|
|
d.node_id,
|
|
d.node_name,
|
|
a.mpOperator,
|
|
dbo.get_userDisPlay(a.mpOperator) mpOperatorName,
|
|
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'technician') technician,
|
|
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'engineer') engineerNo,
|
|
dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'dcc') dcc,
|
|
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'technician') technicianNo,
|
|
dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'cqc') cqcOperatorName,
|
|
dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'fai') faiOperatorName,
|
|
<!-- a.cqcOperator,-->
|
|
<!-- a.faiOperator,-->
|
|
<!-- dbo.get_userDisPlay(a.cqcOperator) cqcOperatorName,-->
|
|
<!-- dbo.get_userDisPlay(a.faiOperator) faiOperatorName,-->
|
|
a.rev,
|
|
a.customer_rev,
|
|
relevance_part_no
|
|
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_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 isnull(a.step_id, 10) = d.step_id
|
|
where a.site = #{site}
|
|
and a.code_no = #{codeNo}
|
|
</select>
|
|
|
|
<delete id="deleteTechnicalSpecificationList">
|
|
delete from plm_technical_specification_sheet where id=#{id}
|
|
</delete>
|
|
<update id="updateBMProcess">
|
|
update plm_technical_specification_sheet set process=#{process},overPrintOperator=#{overPrintOperator},printOperator=#{printOperator} where site=#{site} and code_no=#{codeNo}
|
|
</update>
|
|
|
|
<select id="getTestPartChangeData" resultType="PlmProjectPartData">
|
|
select top 1 * from view_Project_final_Part where site=#{site} and test_part_no=#{testPartNo}
|
|
</select>
|
|
|
|
<select id="BMBasicInformationSearch" resultType="PlmTechnicalSpecificationSheetData">
|
|
SELECT top 1 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.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,
|
|
dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'engineer') engineer,
|
|
dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'technician') technician,
|
|
dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'quotationOfficer') quotationOfficer,c.customer_Id,
|
|
a.proofing_no,a.ori_code_no
|
|
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 a.site=#{site} and a.code_no=#{codeNo}
|
|
</select>
|
|
|
|
<select id="getProofingDataByUserRole" resultType="PlmTechnicalSpecificationSheetData">
|
|
SELECT
|
|
a.site,
|
|
a.proofing_no,
|
|
a.project_id,
|
|
a.test_part_no,
|
|
dbo.plm_get_test_part_name(a.site,a.test_part_no) partName,
|
|
dbo.plm_get_test_part_desc(a.site, a.test_part_no) partDesc,
|
|
b.customer_id,
|
|
b.final_customer_id,
|
|
dbo.plm_get_customer_desc(a.site,b.customer_id) CustomerDesc,
|
|
dbo.plm_get_dictDataLabel('finalCustomer',b.final_customer_id,a.site) finalCustomerDesc,
|
|
b.project_name,d.bu_no
|
|
from plm_proofing_information a
|
|
left join plm_project_info b on a.site = b.site and a.project_id = b.project_id
|
|
left join part as c on a.site = c.site and a.test_part_no = c.part_no
|
|
left join plm_project_part d on a.site = d.site and a.test_part_no = d.test_part_no
|
|
<where>
|
|
and a.site=#{site}
|
|
AND a.project_id in ( select project_id from AccessProject where site=#{site} and username=#{username} and searchFlag='Y' )
|
|
<if test="proofingNo!= null and proofingNo != ''">
|
|
AND a.proofing_no like #{proofingNo}
|
|
</if>
|
|
<if test="projectId!= null and projectId != ''">
|
|
AND a.project_id like #{projectId}
|
|
</if>
|
|
<if test="customerId!= null and customerId != ''">
|
|
AND b.customer_id like #{customerId}
|
|
</if>
|
|
<if test="finalCustomerId!= null and finalCustomerId != ''">
|
|
AND b.final_customer_id like #{finalCustomerId}
|
|
</if>
|
|
and c.status = 'Y'
|
|
</where>
|
|
</select>
|
|
<update id="updateBMBasicInformation" >
|
|
update plm_technical_specification_sheet
|
|
set status=#{status}
|
|
, stage=#{stage}
|
|
, remarkPage=#{remarkPage}
|
|
, rev_no=#{revNo}
|
|
, ECN_no=#{ecnNo}
|
|
, ECN_flag=#{ecnFlag}
|
|
, ECN_address=#{ecnAddress}
|
|
, cqcOperator=#{cqcOperator}
|
|
, update_date=GetDate()
|
|
, update_by=#{updateBy}
|
|
, faiOperator=#{faiOperator}
|
|
, peOperater=#{peOperater}
|
|
, csOperater=#{csOperater}
|
|
, pod=#{pod}
|
|
, mpOperator=#{mpOperator}
|
|
, relevance_part_no=#{relevancePartNo}
|
|
where site = #{site}
|
|
and code_no = #{codeNo}
|
|
</update>
|
|
|
|
<select id="searchBMcustomerInfo" resultType="PlmTechnicalSpecificationSheetData">
|
|
select a.site,
|
|
a.code_no,
|
|
a.picture_addess,
|
|
a.customerPictureChangeRemark,
|
|
a.productionFileComments,
|
|
b.customer_id,
|
|
dbo.plm_get_customer_desc(b.site, b.customer_id) CustomerDesc,
|
|
b.final_customer_id finalCustomerNo,
|
|
dbo.plm_get_dictDataLabel('finalCustomer', b.final_customer_id, a.site) finalCustomerDesc,
|
|
c.final_part_no as part_no,
|
|
c.part_desc,
|
|
c.material_number,
|
|
c.part_type as part_family,
|
|
b.customer_remark,
|
|
a.remark,
|
|
a.ori_code_no,
|
|
a.materialType,
|
|
a.customerRevNo,
|
|
a.materialNumber,
|
|
a.certification,
|
|
a.customerRemark,
|
|
a.projectRemark,
|
|
b.project_id,
|
|
pcpi.customer_part_no
|
|
from plm_technical_specification_sheet a
|
|
left join plm_project_info b on a.site = b.site and a.project_id = b.project_id
|
|
left join view_Project_final_Part c
|
|
on a.site = c.site and a.test_part_no = c.test_part_no and a.project_id = c.project_id
|
|
left join plm_customer_part_info pcpi
|
|
on a.site = pcpi.site and a.test_part_no = pcpi.part_no and b.customer_id = pcpi.customer_no
|
|
where a.site = #{site}
|
|
and a.code_no = #{codeNo}
|
|
</select>
|
|
|
|
<update id="updateBMcustomerInfo">
|
|
update plm_technical_specification_sheet
|
|
set picture_Addess=#{pictureAddess},
|
|
materialType=#{materialType},
|
|
customerPictureChangeRemark=#{customerPictureChangeRemark},
|
|
productionFileComments =#{productionFileComments},
|
|
remark=#{remark},
|
|
update_date=GetDate(),
|
|
update_by=#{updateBy},
|
|
certification=#{certification},
|
|
customerRevNo=#{customerRevNo},
|
|
materialNumber=#{materialNumber},
|
|
customerRemark=#{customerRemark},
|
|
projectRemark=#{projectRemark}
|
|
where site = #{site}
|
|
and code_no = #{codeNo}
|
|
</update>
|
|
|
|
<select id="searchBMPackageInfo" resultType="PlmBmPackageInfoData">
|
|
select site,code_no,matrixStripped,appliedType,finalFormat,[rowCount],columnCount,missingAllowedFlag,rollPerQty,addingFilmFlag,
|
|
packageRequest,coreType,coreDiameter,joinAllowedFlag,coreWidth,specialPositiorFlag,copyPosition,overprintingFlag,
|
|
otherRequirement from plm_bm_packageInfo
|
|
where site=#{site} and code_no=#{codeNo}
|
|
</select>
|
|
|
|
<update id="updateBMPackageInfo">
|
|
update plm_bm_packageInfo set
|
|
matrixStripped=#{matrixStripped},appliedType=#{appliedType},finalFormat=#{finalFormat},[rowCount]=#{rowCount,jdbcType=INTEGER},columnCount=#{columnCount,jdbcType=INTEGER},
|
|
missingAllowedFlag=#{missingAllowedFlag},rollPerQty=#{rollPerQty,jdbcType=DECIMAL},addingFilmFlag=#{addingFilmFlag},
|
|
packageRequest=#{packageRequest},coreType=#{coreType},coreDiameter=#{coreDiameter},joinAllowedFlag=#{joinAllowedFlag},coreWidth=#{coreWidth,jdbcType=DECIMAL},
|
|
specialPositiorFlag=#{specialPositiorFlag},copyPosition=#{copyPosition},overprintingFlag=#{overprintingFlag},
|
|
otherRequirement=#{otherRequirement},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
|
|
</update>
|
|
|
|
<select id="saveBMPackageInfo">
|
|
insert into plm_bm_packageInfo (site,code_no,matrixStripped,appliedType,finalFormat,[rowCount],columnCount,missingAllowedFlag,rollPerQty,addingFilmFlag,
|
|
packageRequest,coreType,coreDiameter,joinAllowedFlag,coreWidth,specialPositiorFlag,copyPosition,overprintingFlag,
|
|
otherRequirement,update_date,update_by) values
|
|
(#{site},#{codeNo},#{matrixStripped},#{appliedType},#{finalFormat},#{rowCount,jdbcType=INTEGER},#{columnCount,jdbcType=INTEGER},
|
|
#{missingAllowedFlag},#{rollPerQty,jdbcType=DECIMAL},#{addingFilmFlag},#{packageRequest},#{coreType},#{coreDiameter},#{joinAllowedFlag},#{coreWidth,jdbcType=DECIMAL},
|
|
#{specialPositiorFlag},#{copyPosition},#{overprintingFlag},#{otherRequirement},GetDate(),#{updateBy})
|
|
</select>
|
|
|
|
<select id="searchPartDataForSelect" resultType="com.spring.modules.part.vo.PartInformationVo">
|
|
select top 100 a.erp_part_no ,a.part_desc,a.family_id,a.spec,family_name
|
|
from part a left join part_family b on a.site=b.site and a.family_id=b.family_id
|
|
<where>
|
|
and a.site=#{site}
|
|
<if test="erpPartNo!= null and erpPartNo != ''">
|
|
AND a.erp_part_no like #{erpPartNo}
|
|
</if>
|
|
<if test="familyId!= null and familyId != ''">
|
|
AND a.family_id like #{familyId}
|
|
</if>
|
|
<if test="partDesc!= null and partDesc != ''">
|
|
AND a.part_desc like #{partDesc}
|
|
</if>
|
|
and a.erp_part_no is not null and a.erp_part_no !=''
|
|
</where>
|
|
</select>
|
|
|
|
<insert id="saveBMBom" >
|
|
insert into plm_bm_bom (Site,code_no,erp_part_no,quantity,remark,create_by,create_date)
|
|
values(#{site},#{codeNo},#{erpPartNo},#{quantity},#{remark},#{username},GetDate())
|
|
</insert>
|
|
|
|
<update id="updateBMBom" >
|
|
update plm_bm_bom set quantity=#{quantity,jdbcType=DECIMAL} ,remark=#{remark},update_by=#{username},
|
|
update_date=GetDate() where Site=#{site} and code_no=#{codeNo} and erp_part_no=#{erpPartNo}
|
|
</update>
|
|
|
|
<select id="searchBMBom" resultType="PlmBmBomData">
|
|
select a.Site,a.code_no,a.erp_part_no,a.quantity,a.remark,b.part_desc,b.spec,b.family_id,c.family_name
|
|
from plm_bm_bom a
|
|
left join part b on a.erp_part_no=b.erp_part_no and a.site=b.site
|
|
left join part_family c on b.family_id=c.family_id and b.site=c.site
|
|
<where>
|
|
and a.site=#{site}
|
|
<if test="erpPartNo!= null and erpPartNo != ''">
|
|
AND a.erp_part_no like #{erpPartNo}
|
|
</if>
|
|
<if test="codeNo!= null and codeNo != ''">
|
|
AND a.code_no like #{codeNo}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
|
|
<delete id="deleteBMBom" >
|
|
delete from plm_bm_bom where code_no=#{codeNo} and site=#{site} and erp_part_no=#{erpPartNo}
|
|
</delete>
|
|
|
|
<select id="searchBMRoutingDetail" resultType="PlmBmRoutingData">
|
|
SELECT a.Site,a.code_no,a.processDetail,a.supplyAdhesiveTape,a.routingDrawing,a.drawingRevison,a.drawingDate,a.workInfo,
|
|
a.wiRevison,a.wiDate,a.routingRemark,a.routingAction,
|
|
dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'reviewEngineer') reviewEngineer,
|
|
dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'peEngineer') peEngineer,
|
|
dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'cqe') cqe
|
|
FROM plm_bm_routing a
|
|
where a.site=#{site} and a.code_no=#{codeNo}
|
|
</select>
|
|
|
|
<insert id="saveBMRoutingDetail">
|
|
insert into plm_bm_routing (Site,code_no,processDetail,supplyAdhesiveTape,routingDrawing,drawingRevison,drawingDate,workInfo,wiRevison,wiDate,
|
|
routingRemark,routingAction,update_by,update_date) values
|
|
(#{site},#{codeNo},#{processDetail},#{supplyAdhesiveTape},#{routingDrawing},#{drawingRevison},#{drawingDate},#{workInfo},#{wiRevison},#{wiDate},
|
|
#{routingRemark},#{routingAction},#{username},GetDate())
|
|
</insert>
|
|
|
|
<update id="updateBMRoutingDetail">
|
|
update plm_bm_routing set processDetail=#{processDetail},supplyAdhesiveTape=#{supplyAdhesiveTape},routingDrawing=#{routingDrawing},
|
|
drawingRevison=#{drawingRevison},drawingDate=#{drawingDate},workInfo=#{workInfo},wiRevison=#{wiRevison},wiDate=#{wiDate},
|
|
routingRemark=#{routingRemark},routingAction=#{routingAction},update_by=#{username},update_date=GetDate() where site=#{site} and code_no=#{codeNo}
|
|
</update>
|
|
|
|
<select id="checkPlmBmPropertiesValueHeaderData" resultType="PlmBmPropertiesValueHeaderData">
|
|
select Site,bu_no,PartNo,CodeNo,SubCodeSeqNo,SubCodeDesc,RecordType from plm_bm_propertiesValueHeader
|
|
where PartNo=#{codeNo} and site=#{site} and CodeNo=#{type} and bu_no=#{buNo}
|
|
</select>
|
|
|
|
<insert id="savePlmBmPropertiesValueHeaderData">
|
|
insert into plm_bm_propertiesValueHeader(Site,bu_no,PartNo,CodeNo,SubCodeSeqNo,SubCodeDesc,RecordType )
|
|
select #{site},#{buNo},#{codeNo},#{type},1,code_desc,'BM' from plm_bm_model_header
|
|
where site=#{site} and bu_no=#{buNo} and function_type='BM' and code_no=#{type}
|
|
</insert>
|
|
|
|
<insert id="savePlmBmPropertiesValueData">
|
|
insert into plm_bm_propertiesValue(Site,bu_no,PartNo,CodeNo,SubCodeSeqNo,SubCodeDesc,ItemNo,PropertiesItemNo,TextValue,NumValue,RecordType,order_id)
|
|
select #{site},#{buNo},#{codeNo},#{type},1,b.code_desc,a.seq_no,a.properties_item_no,c.DefaultValue,null,'BM',a.order_id
|
|
from plm_bm_model_header b left join plm_properties_model_detail a on a.site=#{site} and a.function_type='BM'
|
|
and a.code_no=b.properties_code_no
|
|
left join plm_properties_item c on a.properties_item_no=c.ItemNo and a.site=c.site and a.function_type=c.ItemType
|
|
where b.site=#{site} and b.bu_no=#{buNo} and b.function_type='BM' and b.code_no=#{type} and a.code_no is not null
|
|
</insert>
|
|
|
|
<select id="searchBMPropertiesValue" resultType="PlmBmPropertiesValueData">
|
|
select a.Site,a.bu_no,a.PartNo,a.CodeNo,a.SubCodeSeqNo,a.SubCodeDesc,a.ItemNo,a.PropertiesItemNo,a.TextValue,a.NumValue,a.RecordType,a.order_id,b.itemDesc,b.ValueType_DB,b.ValueChooseFlag
|
|
from plm_bm_propertiesValue a left join plm_properties_item b on a.PropertiesItemNo=b.ItemNo and a.site=b.site and a.RecordType=b.ItemType
|
|
where a.site=#{site} and a.bu_no=#{buNo} and a.RecordType='BM' and a.CodeNo=#{type} and a.PartNo=#{codeNo} order by a.order_id
|
|
</select>
|
|
|
|
<select id="getAvailableValueList" resultType="PlmPropertiesItemAvailableData">
|
|
select ItemNo,ValueNo,AvailableValue from plm_properties_item_available where itemNo=#{propertiesItemNo} and site=#{site} and ItemType='BM'
|
|
</select>
|
|
|
|
<update id="updateBMPropertiesValue">
|
|
update plm_bm_propertiesValue set NumValue=#{numValue,jdbcType=DOUBLE} ,TextValue=#{textValue} where site=#{site} and bu_no=#{buNo} and PartNo=#{partNo} and RecordType=#{recordType}
|
|
and SubCodeSeqNo=#{subCodeSeqNo} and CodeNo = #{codeNo} and ItemNo=#{itemNo}
|
|
</update>
|
|
|
|
<select id="getBMPageBase" resultType="PlmBmPageBaseData">
|
|
select bu_no,code_no from plm_bm_model_header where bu_no=#{buNo} and site=#{site} and active='Y'
|
|
</select>
|
|
|
|
<select id="searchBMRoute" resultType="com.spring.modules.part.vo.RoutingComponentVo">
|
|
SELECT
|
|
a.site,
|
|
a.part_no,
|
|
a.routing_type,
|
|
a.routing_revision,
|
|
a.alternative_no,
|
|
a.operation_id,
|
|
a.operation_no,
|
|
a.operation_name,
|
|
a.efficiency_factor,
|
|
a.mach_run_factor,
|
|
a.mach_setup_time,
|
|
a.run_time_code,
|
|
a.labor_run_factor,
|
|
a.labor_setup_time,
|
|
a.crew_size,
|
|
a.setup_crew_size,
|
|
a.outside_op_item,
|
|
a.machine_no,
|
|
a.work_center_no,
|
|
dbo.get_workCenter_desc(a.site, a.work_center_no) as workCenterDesc,
|
|
a.labor_class_no,
|
|
a.setup_labor_class_no,
|
|
a.overlap,
|
|
a.note_text as componentNoteText,
|
|
b.itemType
|
|
|
|
FROM plm_routing_component a
|
|
left join WorkCenter_BMType b on a.site=b.site and a.work_center_no=b.workCenterNo
|
|
where a.site = #{site} and a.part_no =#{partNo} and a.routing_type = #{routingType} and a.routing_revision = #{routingRevision,jdbcType=INTEGER} and a.alternative_no = #{alternativeNo}
|
|
order by operation_no
|
|
</select>
|
|
|
|
<insert id="saveBMRoute">
|
|
insert into plm_bm_routing_detail (site,code_no,item_no,OperationDesc,remark,create_date,create_by)
|
|
values(#{site},#{codeNo},#{itemNo},#{operationDesc},#{remark},GetDate(),#{username})
|
|
</insert>
|
|
<update id="updateBMRoute">
|
|
update plm_bm_routing_detail set item_no=#{itemNo},OperationDesc=#{operationDesc}
|
|
,remark=#{remark},update_date=GetDate(),update_by=#{username}
|
|
where id=#{id}
|
|
</update>
|
|
|
|
<delete id="deleteBMRoute">
|
|
delete from plm_bm_routing_detail where id=#{id}
|
|
</delete>
|
|
|
|
<select id="searchBMTPInfoDetail" resultType="PlmBmTpInfoDetailData">
|
|
select site,code_no,colourMatch,environment,eordValue,customerFile,laberSize,crossNumber,hp,rowNumber,vp,remark
|
|
from plm_bm_tpInfoDetail where site=#{site} and code_no=#{codeNo}
|
|
</select>
|
|
|
|
<insert id="saveBMTPInfoDetail">
|
|
insert into plm_bm_tpInfoDetail (site,code_no,colourMatch,environment,eordValue,customerFile,laberSize,crossNumber,hp,rowNumber,vp,remark,update_date,update_by)
|
|
values(#{site},#{codeNo},#{colourMatch},#{environment},#{eordValue},#{customerFile},#{laberSize},#{crossNumber},#{hp},#{rowNumber},#{vp},#{remark},GetDate(),#{updateBy})
|
|
</insert>
|
|
|
|
<update id="updateBMTPInfoDetail">
|
|
update plm_bm_tpInfoDetail set colourMatch=#{colourMatch},environment=#{environment},eordValue=#{eordValue},customerFile=#{customerFile},
|
|
laberSize=#{laberSize},crossNumber=#{crossNumber},hp=#{hp},rowNumber=#{rowNumber},vp=#{vp},
|
|
remark=#{remark},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
|
|
</update>
|
|
|
|
<select id="searchBMTPInfoColor" resultType="PlmBmTpInfoColorData">
|
|
select site,code_no,[order],color,inkType,colorRet,colorMatch,remark,filmNo,stencilNo,update_by,update_date,id
|
|
from plm_bm_tpInfoColor where site=#{site} and code_no=#{codeNo} order by [order]
|
|
</select>
|
|
|
|
<insert id="saveBMTPInfoColor">
|
|
insert into plm_bm_tpInfoColor (site,code_no,[order],color,inkType,colorRet,colorMatch,remark,filmNo,stencilNo,update_by,update_date)
|
|
values(#{site},#{codeNo},#{order},#{color},#{inkType},#{colorRet},#{colorMatch},#{remark},#{filmNo},#{stencilNo},#{updateBy},GetDate())
|
|
</insert>
|
|
|
|
<update id="updateBMTPInfoColor">
|
|
update plm_bm_tpInfoColor set [order]=#{order},color=#{color},inkType=#{inkType},colorRet=#{colorRet},
|
|
colorMatch=#{colorMatch},remark=#{remark},filmNo=#{filmNo},stencilNo=#{stencilNo},
|
|
update_date=GetDate(),update_by=#{updateBy} where id=#{id}
|
|
</update>
|
|
|
|
<delete id="deleteBMTPInfoColor">
|
|
delete from plm_bm_tpInfoColor where id=#{id}
|
|
</delete>
|
|
|
|
<select id="checkPlmBmTpInfoColorOrder" resultType="PlmBmTpInfoColorData">
|
|
select site from plm_bm_tpInfoColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}
|
|
</select>
|
|
|
|
|
|
<select id="searchBMTPInfoCut" resultType="PlmBmTpInfoCutData">
|
|
select site,code_no,[order],cuttingMachine,cuttingType,cutterTooling,cutterLayout,cutterCost,p2c,c2c,cutterNo,update_date,
|
|
update_by,id
|
|
from plm_bm_tpInfoCut where site=#{site} and code_no=#{codeNo} order by [order]
|
|
</select>
|
|
|
|
<insert id="saveBMTPInfoCut">
|
|
insert into plm_bm_tpInfoCut (site,code_no,[order],cuttingMachine,cuttingType,cutterTooling,cutterLayout,cutterCost,p2c,c2c,cutterNo,update_date,
|
|
update_by)
|
|
values(#{site},#{codeNo},#{order},#{cuttingMachine},#{cuttingType},#{cutterTooling},#{cutterLayout},#{cutterCost},#{p2c},#{c2c},#{cutterNo},GetDate(),#{updateBy})
|
|
</insert>
|
|
|
|
<update id="updateBMTPInfoCut">
|
|
update plm_bm_tpInfoCut set [order]=#{order},cuttingMachine=#{cuttingMachine},cuttingType=#{cuttingType},cutterTooling=#{cutterTooling},
|
|
cutterLayout=#{cutterLayout},cutterCost=#{cutterCost},p2c=#{p2c},c2c=#{c2c},cutterNo=#{cutterNo},
|
|
update_date=GetDate(),update_by=#{updateBy} where id=#{id}
|
|
</update>
|
|
|
|
<select id="checkPlmBmTpInfoCutOrder" resultType="PlmBmTpInfoCutData">
|
|
select site from plm_bm_tpInfoCut where site=#{site} and code_no=#{codeNo} and [order]=#{order}
|
|
</select>
|
|
|
|
<delete id="deleteBMTPInfoCut">
|
|
delete from plm_bm_tpInfoCut where id=#{id}
|
|
</delete>
|
|
|
|
|
|
<select id="searchBMPrepressDetail" resultType="PlmBmPrepressData">
|
|
select Site,code_no,plateNo,cutterNumber,cutterLayout,[action],remark,feedback,update_by,update_date
|
|
from plm_bm_prepress where site=#{site} and code_no=#{codeNo}
|
|
</select>
|
|
|
|
<insert id="saveBMPrepressDetail">
|
|
insert into plm_bm_prepress (Site,code_no,plateNo,cutterNumber,cutterLayout,[action],remark,feedback,update_by,update_date)
|
|
values(#{site},#{codeNo},#{plateNo},#{cutterNumber},#{cutterLayout},#{action},#{remark},#{feedback},#{updateBy},GetDate())
|
|
</insert>
|
|
|
|
<update id="updateBMPrepressDetail">
|
|
update plm_bm_prepress
|
|
set plateNo=#{plateNo},
|
|
cutterNumber=#{cutterNumber},
|
|
cutterLayout=#{cutterLayout},
|
|
[action]=#{action},
|
|
remark=#{remark},
|
|
feedback=#{feedback},
|
|
update_by=#{updateBy},
|
|
update_date=GetDate()
|
|
where site = #{site}
|
|
and code_no = #{codeNo}
|
|
</update>
|
|
|
|
<select id="searchBMPrepressColor" resultType="PlmBmPrepressColorData">
|
|
select site,code_no,[order],meshModel,meshSize,angle,coatingType,filmNo,stencilNo,color,update_by,update_date
|
|
from plm_bm_PrepressColor where site=#{site} and code_no=#{codeNo} order by [order]
|
|
</select>
|
|
|
|
<insert id="saveBMPrepressColor">
|
|
insert into plm_bm_PrepressColor (site,code_no,[order],meshModel,meshSize,angle,coatingType,filmNo,stencilNo,color,update_by,update_date)
|
|
values(#{site},#{codeNo},#{order},#{meshModel},#{meshSize},#{angle},#{coatingType},#{filmNo},#{stencilNo},#{color},#{updateBy},GetDate())
|
|
</insert>
|
|
|
|
<update id="updateBMPrepressColor">
|
|
update plm_bm_PrepressColor set [order]=#{order},color=#{color},meshModel=#{meshModel},meshSize=#{meshSize},
|
|
angle=#{angle},coatingType=#{coatingType},filmNo=#{filmNo},stencilNo=#{stencilNo},
|
|
update_date=GetDate(),update_by=#{updateBy} where id=#{id}
|
|
</update>
|
|
|
|
<delete id="deleteBMPrepressColor">
|
|
delete from plm_bm_PrepressColor where id=#{id}
|
|
</delete>
|
|
|
|
<select id="checkPlmBmPrepressColorOrder" resultType="PlmBmPrepressColorData">
|
|
select site from plm_bm_PrepressColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}
|
|
</select>
|
|
|
|
|
|
|
|
<select id="searchBMPrintOtherDetail" resultType="PlmBmPrintOtherData">
|
|
select site,code_no,remark,[action],update_date,update_by,id
|
|
from plm_bm_PrintOther where site=#{site} and code_no=#{codeNo}
|
|
</select>
|
|
|
|
<insert id="saveBMPrintOtherDetail">
|
|
insert into plm_bm_PrintOther (site,code_no,remark,[action],update_date,update_by)
|
|
values(#{site},#{codeNo},#{remark},#{action},GetDate(),#{updateBy})
|
|
</insert>
|
|
|
|
<update id="updateBMPrintOtherDetail">
|
|
update plm_bm_PrintOther set remark=#{remark},[action]=#{action} where site=#{site} and code_no=#{codeNo}
|
|
</update>
|
|
|
|
<select id="searchBMPrintOtherColor" resultType="PlmBmPrintOtherColorData">
|
|
select site,code_no,[order],seqNo,ink,[type],otherRef,update_date,update_by
|
|
from plm_bm_PrintOtherColor where site=#{site} and code_no=#{codeNo} order by [order] ,seqNo
|
|
</select>
|
|
|
|
<insert id="saveBMPrintOtherColor">
|
|
insert into plm_bm_PrintOtherColor (site,code_no,[order],seqNo,ink,[type],otherRef,update_by,update_date)
|
|
values(#{site},#{codeNo},#{order},#{seqNo},#{ink},#{type},#{otherRef},#{updateBy},GetDate())
|
|
</insert>
|
|
|
|
<update id="updateBMPrintOtherColor">
|
|
update plm_bm_PrintOtherColor set [order]=#{order},seqNo=#{seqNo},ink=#{ink},[type]=#{type},
|
|
otherRef=#{otherRef},
|
|
update_date=GetDate(),update_by=#{updateBy} where id=#{id}
|
|
</update>
|
|
|
|
<delete id="deleteBMPrintOtherColor">
|
|
delete from plm_bm_PrintOtherColor where id=#{id}
|
|
</delete>
|
|
|
|
<select id="checkPlmBmPrintOtherColorOrder" resultType="PlmBmPrintOtherColorData">
|
|
select site from plm_bm_PrintOtherColor where site=#{site} and code_no=#{codeNo} and [order]=#{order} and seqNo=#{seqNo}
|
|
</select>
|
|
|
|
<update id="updateBMModal">
|
|
update plm_bm_model_header set properties_code_no=#{propertiesCodeNo} ,active=#{active} where site=#{site}
|
|
and bu_no=#{buNo} and code_no=#{codeNo}
|
|
</update>
|
|
|
|
<select id="checkBMModelHeader" resultType="PlmBmModelHeaderData">
|
|
select properties_code_no from plm_bm_model_header where site=#{site}
|
|
and bu_no=#{buNo} and code_no=#{type}
|
|
</select>
|
|
|
|
|
|
|
|
<select id="searchBMPropertiesHeaderForBM" resultType="PlmBmModelHeaderData">
|
|
select properties_code_no from plm_bm_model_header where site=#{site}
|
|
and bu_no=#{buNo} and code_no=#{type}
|
|
</select>
|
|
|
|
<!-- Ink Mixing 油墨房-->
|
|
|
|
|
|
<select id="searchBMInkMixingDetail" resultType="PlmBmInkMixingData">
|
|
select site,code_no,colourMatch,visuallySetting,indicate,customerFile,remarks,[action],update_date,update_by
|
|
from plm_bm_InkMixing where site=#{site} and code_no=#{codeNo}
|
|
</select>
|
|
|
|
<insert id="saveBMInkMixingDetail">
|
|
insert into plm_bm_InkMixing (site,code_no,colourMatch,visuallySetting,indicate,customerFile,remarks,[action],update_date,update_by)
|
|
values(#{site},#{codeNo},#{colourMatch},#{visuallySetting},#{indicate},#{customerFile},#{remarks},#{action},GetDate(),#{updateBy})
|
|
</insert>
|
|
|
|
<update id="updateBMInkMixingDetail">
|
|
update plm_bm_InkMixing set colourMatch=#{colourMatch},visuallySetting=#{visuallySetting},indicate=#{indicate}
|
|
,customerFile=#{customerFile},[action]=#{action},remarks=#{remarks},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
|
|
</update>
|
|
|
|
<select id="searchBMInkMixingColor" resultType="PlmBmInkMixingColorData">
|
|
select site,code_no,[order],color,[type],supplier,inkUsage,mixTime,standbyTime,Viscosity,RecycleTimes,update_by,update_date,id
|
|
|
|
from plm_bm_InkMixingColor where site=#{site} and code_no=#{codeNo} order by [order]
|
|
</select>
|
|
|
|
<insert id="saveBMInkMixingColor">
|
|
insert into plm_bm_InkMixingColor (site,code_no,[order],color,[type],supplier,inkUsage,mixTime,standbyTime,Viscosity,RecycleTimes,update_by,update_date)
|
|
values(#{site},#{codeNo},#{order},#{color},#{type},#{supplier},#{inkUsage},#{mixTime},#{standbyTime},#{viscosity},#{recycleTimes},#{updateBy},GetDate())
|
|
</insert>
|
|
|
|
<update id="updateBMInkMixingColor">
|
|
update plm_bm_InkMixingColor set [order]=#{order},color=#{color},[type]=#{type},supplier=#{supplier},inkUsage=#{inkUsage},
|
|
mixTime=#{mixTime},standbyTime=#{standbyTime},Viscosity=#{viscosity},RecycleTimes=#{recycleTimes},
|
|
update_date=GetDate(),update_by=#{updateBy} where id=#{id}
|
|
</update>
|
|
|
|
<delete id="deleteBMInkMixingColor">
|
|
delete from plm_bm_InkMixingColor where id=#{id}
|
|
</delete>
|
|
|
|
<select id="checkPlmBmInkMixingColorOrder" resultType="PlmBmInkMixingColorData">
|
|
select site from plm_bm_InkMixingColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}
|
|
</select>
|
|
|
|
<!-- Ink Formulation 油墨配方-->
|
|
|
|
<select id="searchBMInkFormulationDetail" resultType="PlmBmInkFormulationData">
|
|
select Site,code_no,remarks,label_size,qpa,[action],[cross],row,hp,vp,update_date,update_by
|
|
from plm_bm_InkFormulation where site=#{site} and code_no=#{codeNo}
|
|
</select>
|
|
|
|
<insert id="saveBMInkFormulationDetail">
|
|
insert into plm_bm_InkFormulation (Site,code_no,remarks,label_size,qpa,[action],[cross],row,hp,vp,update_date,update_by)
|
|
values(#{site},#{codeNo},#{remarks},#{labelSize},#{qpa},#{action},#{cross},#{row},#{hp},#{vp},GetDate(),#{updateBy})
|
|
</insert>
|
|
|
|
<update id="updateBMInkFormulationDetail">
|
|
update plm_bm_InkFormulation set remarks=#{remarks},label_size=#{labelSize},qpa=#{qpa},[action]=#{action},[cross]=#{cross}
|
|
,row=#{row},[hp]=#{hp},vp=#{vp},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
|
|
</update>
|
|
|
|
<select id="searchBMInkFormulationColor" resultType="PlmBmInkFormulationColorData">
|
|
select site,code_no,[order],hardness,tartness,printingSide,energy,dry_speed,dry_time,dry_temp,dry_time2,update_date,update_by,
|
|
id
|
|
|
|
from plm_bm_InkFormulationColor where site=#{site} and code_no=#{codeNo} order by [order]
|
|
</select>
|
|
|
|
<insert id="saveBMInkFormulationColor">
|
|
insert into plm_bm_InkFormulationColor (site,code_no,[order],hardness,tartness,printingSide,energy,dry_speed,dry_time,dry_temp,dry_time2,update_date,update_by)
|
|
values(#{site},#{codeNo},#{order},#{hardness},#{tartness},#{printingSide},#{energy},#{drySpeed},#{dryTime},#{dryTemp},#{dryTime2},GetDate(),#{updateBy})
|
|
</insert>
|
|
|
|
<update id="updateBMInkFormulationColor">
|
|
update plm_bm_InkFormulationColor set [order]=#{order},hardness=#{hardness},[tartness]=#{tartness},printingSide=#{printingSide},energy=#{energy},
|
|
dry_speed=#{drySpeed},dry_time=#{dryTime},dry_temp=#{dryTemp},dry_time2=#{dryTime2},
|
|
update_date=GetDate(),update_by=#{updateBy} where id=#{id}
|
|
</update>
|
|
|
|
<delete id="deleteBMInkFormulationColor">
|
|
delete from plm_bm_InkFormulationColor where id=#{id}
|
|
</delete>
|
|
|
|
<select id="checkPlmBmInkFormulationColorOrder" resultType="PlmBmInkFormulationColorData">
|
|
select site from plm_bm_InkFormulationColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}
|
|
</select>
|
|
|
|
<!-- Lamination 覆膜 -->
|
|
|
|
<select id="searchBMLaminationDetail" resultType="PlmBmLaminationData">
|
|
select site,code_no,[action],update_date,update_by,remark
|
|
from plm_bm_Lamination where site=#{site} and code_no=#{codeNo}
|
|
</select>
|
|
|
|
<insert id="saveBMLaminationDetail">
|
|
insert into plm_bm_Lamination (site,code_no,[action],update_date,update_by,remark)
|
|
values(#{site},#{codeNo},#{action},GetDate(),#{updateBy},#{remark})
|
|
</insert>
|
|
|
|
<update id="updateBMLaminationDetail">
|
|
update plm_bm_Lamination set remark=#{remark},[action]=#{action},
|
|
update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
|
|
</update>
|
|
|
|
<select id="searchBMLaminationCut" resultType="PlmBmLaminationCutData">
|
|
select site,code_no,[order],station,processStep,machine,laminationType,rm_partNo,rm_partNo2,film_partNo,lamination_side,remarks,
|
|
update_date,update_by,id
|
|
|
|
from plm_bm_LaminationCut where site=#{site} and code_no=#{codeNo} order by [order]
|
|
</select>
|
|
|
|
<insert id="saveBMLaminationCut">
|
|
insert into plm_bm_LaminationCut (site,code_no,[order],station,processStep,machine,laminationType,rm_partNo,rm_partNo2,film_partNo,lamination_side,remarks,
|
|
update_date,update_by)
|
|
values(#{site},#{codeNo},#{order},#{station},#{processStep},#{machine},#{laminationType},#{rmPartNo},#{rmPartNo2},#{filmPartNo},#{laminationSide},#{remarks},
|
|
GetDate(),#{updateBy})
|
|
</insert>
|
|
|
|
<update id="updateBMLaminationCut">
|
|
update plm_bm_LaminationCut set [order]=#{order},station=#{station},[processStep]=#{processStep},machine=#{machine},laminationType=#{laminationType},
|
|
rm_partNo=#{rmPartNo},rm_partNo2=#{rmPartNo2},film_partNo=#{filmPartNo},lamination_side=#{laminationSide},remarks=#{remarks},
|
|
update_date=GetDate(),update_by=#{updateBy} where id=#{id}
|
|
</update>
|
|
|
|
<delete id="deleteBMLaminationCut">
|
|
delete from plm_bm_LaminationCut where id=#{id}
|
|
</delete>
|
|
|
|
<select id="checkPlmBmLaminationCutOrder" resultType="PlmBmLaminationCutData">
|
|
select site from plm_bm_LaminationCut where site=#{site} and code_no=#{codeNo} and [order]=#{order}
|
|
</select>
|
|
|
|
<!-- Cnc -->
|
|
|
|
<select id="searchBMCncDetail" resultType="PlmBmCncData">
|
|
select site,code_no,[action],update_date,update_by
|
|
from plm_bm_Cnc where site=#{site} and code_no=#{codeNo}
|
|
</select>
|
|
|
|
<insert id="saveBMCncDetail">
|
|
insert into plm_bm_Cnc (site,code_no,[action],update_date,update_by)
|
|
values(#{site},#{codeNo},#{action},GetDate(),#{updateBy})
|
|
</insert>
|
|
|
|
<update id="updateBMCncDetail">
|
|
update plm_bm_Cnc set [action]=#{action},
|
|
update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
|
|
</update>
|
|
|
|
<select id="searchBMCncCut" resultType="PlmBmCncCutData">
|
|
select site,code_no,[order],cutting_machine,program_name,cutting_speed,spec,p2c,c2c,remarks,update_date,update_by,id
|
|
|
|
from plm_bm_CncCut where site=#{site} and code_no=#{codeNo} order by [order]
|
|
</select>
|
|
|
|
<insert id="saveBMCncCut">
|
|
insert into plm_bm_CncCut (site,code_no,[order],cutting_machine,program_name,cutting_speed,spec,p2c,c2c,remarks,update_date,update_by)
|
|
values(#{site},#{codeNo},#{order},#{cuttingMachine},#{programName},#{cuttingSpeed},#{spec},#{p2c},#{c2c},#{remarks},
|
|
GetDate(),#{updateBy})
|
|
</insert>
|
|
|
|
<update id="updateBMCncCut">
|
|
update plm_bm_CncCut set [order]=#{order},cutting_machine=#{cuttingMachine},[program_name]=#{programName},cutting_speed=#{cuttingSpeed},spec=#{spec},
|
|
p2c=#{p2c},c2c=#{c2c},remarks=#{remarks},
|
|
update_date=GetDate(),update_by=#{updateBy} where id=#{id}
|
|
</update>
|
|
|
|
<delete id="deleteBMCncCut">
|
|
delete from plm_bm_CncCut where id=#{id}
|
|
</delete>
|
|
|
|
<select id="checkPlmBmCncCutOrder" resultType="PlmBmCncCutData">
|
|
select site from plm_bm_CncCut where site=#{site} and code_no=#{codeNo} and [order]=#{order}
|
|
</select>
|
|
|
|
<!-- Cut -->
|
|
|
|
<select id="searchBMCutDetail" resultType="PlmBmCutData">
|
|
select site,code_no,[action],remarks,update_date,update_by
|
|
from plm_bm_Cut where site=#{site} and code_no=#{codeNo}
|
|
</select>
|
|
|
|
<insert id="saveBMCutDetail">
|
|
insert into plm_bm_Cut (site,code_no,[action],update_date,update_by,remarks)
|
|
values(#{site},#{codeNo},#{action},GetDate(),#{updateBy},#{remarks})
|
|
</insert>
|
|
|
|
<update id="updateBMCutDetail">
|
|
update plm_bm_Cut set [action]=#{action},remarks=#{remarks},
|
|
update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
|
|
</update>
|
|
|
|
<select id="searchBMCutCut" resultType="PlmBmCutCutData">
|
|
select site,code_no,[order],cutting_machine,cutting_type,cutting_tooling,cutter_no,cutter_layout,cutter_cost,program_name,
|
|
program_path,p2c,c2c,update_by,update_date,id
|
|
from plm_bm_CutCut where site=#{site} and code_no=#{codeNo} order by [order]
|
|
</select>
|
|
|
|
<insert id="saveBMCutCut">
|
|
insert into plm_bm_CutCut (site,code_no,[order],cutting_machine,cutting_type,cutting_tooling,cutter_no,cutter_layout,cutter_cost,program_name,
|
|
program_path,p2c,c2c,update_by,update_date)
|
|
values(#{site},#{codeNo},#{order},#{cuttingMachine},#{cuttingType},#{cuttingTooling},#{cutterNo},#{cutterLayout},#{cutterCost},#{programName},
|
|
#{programPath},#{p2c},#{c2c},#{updateBy},GetDate())
|
|
</insert>
|
|
|
|
<update id="updateBMCutCut">
|
|
update plm_bm_CutCut set [order]=#{order},cutting_machine=#{cuttingMachine},[cutting_type]=#{cuttingType},cutting_tooling=#{cuttingTooling},cutter_no=#{cutterNo},
|
|
cutter_layout=#{cutterLayout},cutter_cost=#{cutterCost},program_name=#{programName}, p2c=#{p2c},c2c=#{c2c},program_path=#{programPath},
|
|
update_date=GetDate(),update_by=#{updateBy} where id=#{id}
|
|
</update>
|
|
|
|
<delete id="deleteBMCutCut">
|
|
delete from plm_bm_CutCut where id=#{id}
|
|
</delete>
|
|
|
|
<select id="checkPlmBmCutCutOrder" resultType="PlmBmCutCutData">
|
|
select site from plm_bm_CutCut where site=#{site} and code_no=#{codeNo} and [order]=#{order}
|
|
</select>
|
|
|
|
|
|
|
|
<!-- printing 印刷-->
|
|
|
|
|
|
<select id="searchBMPrintingDetail" resultType="PlmBmPrintingData">
|
|
select site,code_no,colour_match,conditions,colour_indicat,customer_file,glossiness_requirement,comments,repeat,vp,label_size,
|
|
down,plate_distortion_rate,actual_number,print_position,goods_roll_width,update_date,update_by,printLayout
|
|
from plm_bm_Printing where site=#{site} and code_no=#{codeNo}
|
|
</select>
|
|
|
|
<insert id="saveBMPrintingDetail">
|
|
insert into plm_bm_Printing (site,code_no,colour_match,conditions,colour_indicat,customer_file,glossiness_requirement,comments,repeat,vp,label_size,
|
|
down,plate_distortion_rate,actual_number,print_position,goods_roll_width,update_date,update_by,printLayout)
|
|
values(#{site},#{codeNo},#{colourMatch},#{conditions},#{colourIndicat},#{customerFile},#{glossinessRequirement},#{comments},
|
|
#{repeat},#{vp},#{labelSize},#{down},#{plateDistortionRate},#{actualNumber},#{printPosition},#{goodsRollWidth},
|
|
GetDate(),#{updateBy},#{printLayout})
|
|
</insert>
|
|
|
|
<update id="updateBMPrintingDetail">
|
|
update plm_bm_Printing set printLayout=#{printLayout},colour_match=#{colourMatch},conditions=#{conditions},colour_indicat=#{colourIndicat},customer_file=#{customerFile},glossiness_requirement=#{glossinessRequirement},comments=#{comments},
|
|
repeat=#{repeat},vp=#{vp},label_size=#{labelSize},down=#{down},plate_distortion_rate=#{plateDistortionRate},actual_number=#{actualNumber},print_position=#{printPosition},goods_roll_width=#{goodsRollWidth},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
|
|
</update>
|
|
|
|
<select id="searchBMPrintingColor" resultType="PlmBmPrintingColorData">
|
|
select site,code_no,[order],ink_type,color_reference,color_match,bcm,speed,dry,gallus,mark_andy,lp,Hexiang,update_date,update_by,
|
|
id
|
|
|
|
from plm_bm_PrintingColor where site=#{site} and code_no=#{codeNo} order by [order]
|
|
</select>
|
|
|
|
<insert id="saveBMPrintingColor">
|
|
insert into plm_bm_PrintingColor (site,code_no,[order],ink_type,color_reference,color_match,bcm,speed,dry,gallus,mark_andy,lp,Hexiang,update_by,update_date)
|
|
values(#{site},#{codeNo},#{order},#{inkType},#{colorReference},#{colorMatch},#{bcm},#{speed},#{dry},#{gallus},#{markAndy},#{lp},#{hexiang},#{updateBy},GetDate())
|
|
</insert>
|
|
|
|
<update id="updateBMPrintingColor">
|
|
update plm_bm_PrintingColor set [order]=#{order},ink_type=#{inkType},[color_reference]=#{colorReference},color_match=#{colorMatch},bcm=#{bcm},
|
|
speed=#{speed},dry=#{dry},gallus=#{gallus},mark_andy=#{markAndy},lp=#{lp},Hexiang=#{hexiang},
|
|
update_date=GetDate(),update_by=#{updateBy} where id=#{id}
|
|
</update>
|
|
|
|
<delete id="deleteBMPrintingColor">
|
|
delete from plm_bm_PrintingColor where id=#{id}
|
|
</delete>
|
|
|
|
<select id="checkPlmBmPrintingColorOrder" resultType="PlmBmPrintingColorData">
|
|
select site from plm_bm_PrintingColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}
|
|
</select>
|
|
|
|
<select id="getBomNowRevNo" resultType="com.spring.modules.part.entity.BomHeaderEntity">
|
|
select top 1 eng_chg_level,bom_type,site,part_no
|
|
from plm_bom_header
|
|
where site=#{site} and part_no=#{partNo}
|
|
and GetDate()>eff_phase_in_date and isnull(eff_phase_out_date, DATEADD(d, 1, GETDATE())) >GetDate()
|
|
</select>
|
|
|
|
<select id="getTopOneBomAlternativeNo" resultType="com.spring.modules.part.entity.BomDetailEntity">
|
|
select top 1 site,part_no,alternative_no,alternative_description,bom_type,eng_chg_level
|
|
from plm_bom_detail where site=#{site} and part_no=#{partNo} and bom_type=#{bomType} and eng_chg_level=#{engChgLevel}
|
|
</select>
|
|
|
|
<select id="getRouteNowRevNo" resultType="com.spring.modules.part.entity.RoutingHeaderEntity">
|
|
select top 1 site,part_no,routing_revision,routing_type
|
|
from plm_routing_header
|
|
where site=#{site} and part_no=#{partNo} and GetDate()>phase_in_date and isnull(phase_out_date, DATEADD(d, 1, GETDATE())) >GetDate()
|
|
</select>
|
|
<select id="getTopOneRouteAlternativeNo" resultType="com.spring.modules.part.entity.RoutingDetailEntity">
|
|
select top 1 site,part_no,routing_revision,routing_type,alternative_no,alternative_description
|
|
from plm_routing_detail
|
|
where site=#{site} and part_no=#{partNo} and routing_type=#{routingType} and routing_revision=#{routingRevision}
|
|
</select>
|
|
<select id="getBMBomDetail" resultType="com.spring.modules.part.entity.BomDetailEntity">
|
|
select a.site, a.bom_type, a.eng_chg_level, a.bom_alternative_no alternativeNo, b.final_part_no partNo
|
|
from plm_technical_specification_sheet a
|
|
left join view_Project_final_Part b on a.site = b.site and a.test_part_no = b.test_part_no
|
|
left join plm_bom_detail c
|
|
on a.site = c.site and b.final_part_no = c.part_no and a.eng_chg_level = c.eng_chg_level
|
|
and a.bom_alternative_no = c.alternative_no and a.bom_type = c.bom_type
|
|
where a.site = #{site}
|
|
and a.code_no = #{codeNo}
|
|
and a.project_id = b.project_id
|
|
and c.status = 'Buildable'
|
|
</select>
|
|
<select id="getBMRouteDetail" resultType="com.spring.modules.part.entity.RoutingDetailEntity">
|
|
select a.site, a.routing_type, a.routing_revision, a.routing_alternative_no alternativeNo, b.final_part_no partNo
|
|
from plm_technical_specification_sheet a
|
|
left join view_Project_final_Part b on a.site = b.site and a.test_part_no = b.test_part_no
|
|
left join plm_routing_detail c
|
|
on a.site = c.site and b.final_part_no = c.part_no AND a.routing_revision = c.routing_revision
|
|
and a.routing_alternative_no = c.alternative_no and a.routing_type = c.routing_type
|
|
where a.site = #{site}
|
|
and a.code_no = #{codeNo}
|
|
and a.project_id = b.project_id
|
|
and c.status = 'Buildable'
|
|
</select>
|
|
|
|
|
|
<select id="searchBMBomDetail" resultType="com.spring.modules.part.vo.BomDetailVo">
|
|
select a.site,
|
|
a.part_no,
|
|
b.alternative_no,
|
|
b.alternative_description,
|
|
a.bom_type,
|
|
a.eng_chg_level,
|
|
b.min_lot_qty,
|
|
b.default_flag,
|
|
a.note_text,
|
|
a.create_date,
|
|
a.create_by,
|
|
a.update_date,
|
|
a.update_by,
|
|
b.status,
|
|
a.official_flag,
|
|
a.eff_phase_in_date,
|
|
a.eff_phase_out_date
|
|
from plm_bom_header a
|
|
left join plm_bom_detail b
|
|
on a.site = b.site and a.part_no = b.part_NO and a.bom_type = b.bom_type AND A.eng_chg_level = B.eng_chg_level
|
|
where a.part_no = #{partNo}
|
|
and a.site = #{site}
|
|
and a.bom_type != 'Repair'
|
|
and b.status = 'Buildable'
|
|
</select>
|
|
<update id="updateBMBomRev">
|
|
update plm_technical_specification_sheet set bom_type=#{bomType},eng_chg_level=#{engChgLevel,jdbcType=INTEGER},
|
|
bom_alternative_no=#{bomAlternativeNo} where site=#{site} and code_no=#{codeNo}
|
|
</update>
|
|
<update id="updateBMRouteRev">
|
|
update plm_technical_specification_sheet set routing_type=#{routingType},routing_revision=#{routingRevision,jdbcType=INTEGER},
|
|
routing_alternative_no=#{routingAlternativeNo} where site=#{site} and code_no=#{codeNo}
|
|
</update>
|
|
|
|
<select id="searchRouteDetail" resultType="com.spring.modules.part.vo.RoutingDetailVo">
|
|
select a.site,
|
|
a.part_no,
|
|
a.routing_revision,
|
|
a.routing_type,
|
|
b.alternative_no,
|
|
b.alternative_description,
|
|
b.status,
|
|
a.official_flag,
|
|
a.phase_in_date,
|
|
a.phase_out_date
|
|
from plm_routing_header a
|
|
left join plm_routing_detail b
|
|
on a.site = b.site and a.part_no = b.part_NO and a.routing_type = b.routing_type AND A.routing_revision = B.routing_revision
|
|
where a.site = #{site}
|
|
and a.part_no = #{partNo}
|
|
and a.routing_type != 'Repair'
|
|
and b.status = 'Buildable'
|
|
</select>
|
|
|
|
<select id="searchBMRemarkPage" resultType="PlmTechnicalSpecificationSheetData">
|
|
select site,remarkPage,code_no from plm_technical_specification_sheet where site=#{site} and code_no=#{codeNo}
|
|
</select>
|
|
<update id="updateBMRemarkPage">
|
|
update plm_technical_specification_sheet set remarkPage=#{remarkPage} where site=#{site} and code_no=#{codeNo}
|
|
</update>
|
|
|
|
<select id="searchPartLastQuotationNo" resultType="com.spring.modules.quotation.entity.QuotationHeader">
|
|
select top 1 a.site,a.quotation_no
|
|
from quotation_header a left join quotation_detail b on a.quotation_header_id=b.quotation_header_id
|
|
where b.site=#{site} and b.product_no=#{productNo} order by a.create_time desc
|
|
</select>
|
|
|
|
<select id="getSysProxyAddress" resultType="SysProxyAddress">
|
|
select physicalAddress,proxyAddress,remark from sys_proxy_address
|
|
|
|
</select>
|
|
|
|
<select id="searchBMprintFlexoColor" resultType="PlmBmPrintFlexoColorData">
|
|
select id,site,codeNo,printSide,[order],colorReference,inkCode,colorMatch,lpi,bcm,openFlag,gallus,markAndy,hexiang,temperature,
|
|
pressure,updateDate,updateBy from plm_bm_printFlexoColor
|
|
where site=#{site} and codeNo=#{codeNo}
|
|
order by printSide desc,[order]
|
|
</select>
|
|
|
|
<select id="checkBMprintFlexoColorOrder" resultType="PlmBmPrintFlexoColorData">
|
|
select id,site,codeNo,printSide,[order] from plm_bm_printFlexoColor
|
|
where site=#{site} and codeNo=#{codeNo} and printSide=#{printSide} and [order]=#{order}
|
|
|
|
</select>
|
|
|
|
<insert id="saveBMprintFlexoColor" >
|
|
insert into plm_bm_printFlexoColor(site,codeNo,printSide,[order],colorReference,inkCode,colorMatch,lpi,bcm,openFlag,gallus,markAndy,hexiang,temperature,
|
|
pressure,updateDate,updateBy,remark) values
|
|
(#{site},#{codeNo},#{printSide},#{order},#{colorReference},#{inkCode},#{colorMatch},#{lpi},#{bcm},#{openFlag},#{gallus},
|
|
#{markAndy},#{hexiang},#{temperature},#{pressure},GetDate(),#{updateBy},#{remark})
|
|
</insert>
|
|
|
|
<update id="updateBMprintFlexoColor" >
|
|
update plm_bm_printFlexoColor set printSide=#{printSide},[order]=#{order,jdbcType=INTEGER},colorReference=#{colorReference},inkCode=#{inkCode},
|
|
colorMatch=#{colorMatch},lpi=#{lpi},bcm=#{bcm},openFlag=#{openFlag},gallus=#{gallus},markAndy=#{markAndy},hexiang=#{hexiang},temperature=#{temperature},
|
|
pressure=#{pressure},updateDate=GetDate(),updateBy=#{updateBy},remark=#{remark} where id=#{id}
|
|
</update>
|
|
|
|
<delete id="deleteBMprintFlexoColor">
|
|
delete from plm_bm_printFlexoColor where id=#{id}
|
|
</delete>
|
|
|
|
<select id="searchBMprintIndigoColor" resultType="PlmBmPrintIndigoColorData">
|
|
select id,code_no,site,[order],printSide,colorReference,inkCode,colorMatch,printMotion,opticalDensity,lut,lpi,screenAngle,printHits,
|
|
blanketTemperture,remark,updateBy,updateDate from plm_bm_printIndigoColor
|
|
where site=#{site} and code_no=#{codeNo}
|
|
order by printSide desc,[order]
|
|
</select>
|
|
|
|
<select id="checkBMprintIndigoColorOrder" resultType="PlmBmPrintIndigoColorData">
|
|
select id,site,code_no,printSide,[order] from plm_bm_printIndigoColor
|
|
where site=#{site} and code_no=#{codeNo} and printSide=#{printSide} and [order]=#{order}
|
|
</select>
|
|
|
|
<insert id="saveBMprintIndigoColor" >
|
|
insert into plm_bm_printIndigoColor(site,code_no,[order],printSide,colorReference,inkCode,colorMatch,printMotion,opticalDensity,lut,lpi,screenAngle,printHits,
|
|
blanketTemperture,remark,updateBy,updateDate) values
|
|
(#{site},#{codeNo},#{order},#{printSide},#{colorReference},#{inkCode},#{colorMatch},#{printMotion},#{opticalDensity},#{lut},#{lpi},
|
|
#{screenAngle},#{printHits},#{blanketTemperture},#{remark},#{updateBy},GetDate())
|
|
</insert>
|
|
|
|
<update id="updateBMprintIndigoColor" >
|
|
update plm_bm_printIndigoColor set printSide=#{printSide},[order]=#{order,jdbcType=INTEGER},colorReference=#{colorReference},inkCode=#{inkCode},
|
|
colorMatch=#{colorMatch},printMotion=#{printMotion},opticalDensity=#{opticalDensity},lut=#{lut},lpi=#{lpi},screenAngle=#{screenAngle},printHits=#{printHits},blanketTemperture=#{blanketTemperture},
|
|
remark=#{remark},updateDate=GetDate(),updateBy=#{updateBy} where id=#{id}
|
|
</update>
|
|
|
|
<delete id="deleteBMprintIndigoColor">
|
|
delete from plm_bm_printIndigoColor where id=#{id}
|
|
</delete>
|
|
|
|
<select id="selectTechnicalSpecification" resultType="PlmTechnicalSpecificationSheet">
|
|
SELECT
|
|
id,site,code_no,proofing_no,project_id,test_part_no,status,rev_no,work_center_no,ECN_flag,ECN_no,ECN_address,remark,
|
|
create_date,create_by,update_date,update_by,picture_addess,customerPictureChangeRemark,productionFileComments,
|
|
ori_code_no,bom_type,eng_chg_level,bom_alternative_no,routing_type,routing_revision,routing_alternative_no,remarkPage,
|
|
process,stage,materialType,cqcOperator,faiOperator,overPrintOperator,printOperator,peOperater,csOperater,
|
|
step_id,reject_flag,reject_step_id,mpOperator,pod
|
|
FROM plm_technical_specification_sheet a
|
|
where a.site = #{site} and a.code_no = #{codeNo}
|
|
</select>
|
|
|
|
<update id="updateStatus" parameterType="PlmTechnicalSpecificationSheetData">
|
|
update plm_technical_specification_sheet
|
|
set status = #{status},
|
|
update_date = getDate(),
|
|
update_by = #{userName}
|
|
where site = #{site} and code_no = #{codeNo}
|
|
</update>
|
|
|
|
<select id="selectTechnicalSpecificationTeam" parameterType="string" resultType="PlmTechnicalSpecificationTeamData">
|
|
SELECT
|
|
a.site,
|
|
a.code_no,
|
|
a.operator_id,
|
|
a.type,
|
|
b.domain_control_account
|
|
FROM plm_technicalSpecification_team as a
|
|
left join sys_user as b on a.operator_id = b.username
|
|
where a.site = #{site} and a.code_no = #{codeNo}
|
|
</select>
|
|
|
|
<select id="getBMStatusDesc" resultType="PlmTechnicalSpecificationSheetData">
|
|
SELECT
|
|
id,site,code_no,dbo.plm_get_technicalBaseDesc(a.status,'status') statusDesc
|
|
FROM plm_technical_specification_sheet a
|
|
where a.site = #{site} and a.code_no = #{codeNo}
|
|
</select>
|
|
|
|
<select id="getFinalPartData" resultType="PlmProjectPartData">
|
|
Select
|
|
a.Final_Part_No,
|
|
a.Test_part_no,
|
|
a.Active,
|
|
a.Part_desc,
|
|
a.project_id,
|
|
pcpi.customer_part_no,
|
|
a.bu_no
|
|
from view_Project_final_Part a
|
|
left join plm_project_info c on a.site = c.site and a.project_id = c.project_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
|
|
<where>
|
|
and a.site = #{query.site}
|
|
<if test="query.projectId!= null and query.projectId != ''">
|
|
AND a.project_id like #{query.projectId}
|
|
</if>
|
|
<if test="query.finalPartNo != null and query.finalPartNo != ''">
|
|
AND a.Final_Part_No like #{query.finalPartNo}
|
|
</if>
|
|
<if test="query.customerPartNo!= null and query.customerPartNo != ''">
|
|
AND pcpi.customer_part_no like #{query.customerPartNo}
|
|
</if>
|
|
<if test="query.testPartNo != null and query.testPartNo != ''">
|
|
AND a.Test_part_no like #{query.testPartNo}
|
|
</if>
|
|
<if test="query.partDesc!= null and query.partDesc != ''">
|
|
AND a.Part_desc like #{query.partDesc}
|
|
</if>
|
|
and a.RealFlag = 'Y'
|
|
</where>
|
|
</select>
|
|
|
|
<select id="getOADetailForBM" resultType="PlmTechnicalSpecificationSheetData">
|
|
select
|
|
top 1
|
|
d.is_reject,
|
|
d.node_id,
|
|
d.node_name,
|
|
dbo.get_plm_Approval_username (a.site, prh.workflow_id,d.node_id,a.code_no) as sp
|
|
from plm_technical_specification_sheet a
|
|
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
|
|
where a.site=#{site} and a.code_no=#{codeNo}
|
|
</select>
|
|
|
|
|
|
<select id="searchCopyPart" resultType="PlmProjectPartData">
|
|
Select a.Final_Part_No,a.Test_part_no,a.Active, a.Part_desc ,a.project_id,pcpi.customer_part_no,a.bu_no
|
|
from plm_project_info c
|
|
left join view_Project_Part a on a.site = c.site and a.project_id = c.project_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 part p on a.Final_Part_No = p.part_no
|
|
left join plm_technical_specification_sheet ps on a.site=ps.site and a.Test_part_no=ps.Test_part_no
|
|
|
|
where a.project_id=#{projectId} and a.site=#{site} and a.Test_part_no!=#{testPartNo} and a.realFlag='Y' and ps.Test_part_no is null
|
|
and dbo.Get_PartHasRealBOMRoute(a.site,a.Final_Part_No) ='Y'
|
|
|
|
|
|
</select>
|
|
|
|
<select id="queryCustomerPartNo" resultType="java.lang.String">
|
|
select top 1 pcpi.customer_part_no
|
|
from plm_customer_part_info pcpi
|
|
where pcpi.site = #{site}
|
|
and pcpi.customer_no = #{customerId}
|
|
and pcpi.part_no = #{partNo}
|
|
</select>
|
|
|
|
<insert id="saveCustomerPartNo">
|
|
insert into plm_customer_part_info(site, customer_no, part_no, customer_part_no, create_date, create_by)
|
|
values (#{site},#{customerId},#{partNo},#{customerPartNo},getdate(),#{username})
|
|
</insert>
|
|
|
|
<update id="updateCustomerPartNo">
|
|
update plm_customer_part_info
|
|
set customer_part_no = #{customerPartNo},
|
|
update_by = #{username},
|
|
update_date = getdate()
|
|
where site = #{site}
|
|
and customer_no = #{customerId}
|
|
and part_no = #{partNo}
|
|
</update>
|
|
|
|
<select id="technicalSpecificationList"
|
|
resultType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
|
|
SELECT a.id,
|
|
a.site,
|
|
a.code_no as codeNo,
|
|
a.project_id as projectId,
|
|
a.test_part_no as testPartNo,
|
|
a.status,
|
|
a.rev_no as revNo,
|
|
a.work_center_no as workCenterNo,
|
|
a.ECN_flag as ecnFlag,
|
|
a.ECN_no as ecnNo,
|
|
a.ori_code_no as oriCodeNo,
|
|
a.ECN_address as ecnAddress,
|
|
a.remark,
|
|
a.create_date as createDate,
|
|
a.create_by as createBy,
|
|
a.update_date as updateDate,
|
|
a.update_by as updateBy,
|
|
b.final_part_no as finalPartNo,
|
|
b.part_type as partTypeDesc,
|
|
b.part_type as partType,
|
|
b.part_name as partName,
|
|
b.part_desc as partDesc,
|
|
b.part_spec as partSpec,
|
|
dbo.plm_get_technicalBaseDesc(a.status, 'status') as statusDesc,
|
|
a.proofing_no as proofingNo,
|
|
b.bu_no as buNo,
|
|
dbo.plm_get_bu_desc(a.site, b.bu_no) as buDesc,
|
|
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'engineer') as engineer,
|
|
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'technician') as technician,
|
|
process,
|
|
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'quotationOfficer') as quotationOfficer,
|
|
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'engineer') as engineerNo,
|
|
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'technician') as technicianNo,
|
|
c.customer_Id as customerId,
|
|
a.picture_addess as pictureAddess,
|
|
a.customerPictureChangeRemark,
|
|
a.productionFileComments,
|
|
a.bom_type as bomType,
|
|
a.eng_chg_level as engChgLevel,
|
|
a.bom_alternative_no as bomAlternativeNo,
|
|
a.routing_type as routingType,
|
|
a.routing_revision as routingRevision,
|
|
a.routing_alternative_no as routingAlternativeNo,
|
|
a.pod,
|
|
a.mpOperator,
|
|
dbo.get_userDisPlay(a.mpOperator) as mpOperatorName,
|
|
a.peOperater,
|
|
dbo.get_userDisPlay(a.peOperater) as peOperaterName,
|
|
a.csOperater,
|
|
dbo.get_userDisPlay(a.csOperater) as csOperaterName,
|
|
dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'dcc') as dccOperaterName,
|
|
dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'cqc') as cqcOperatorName,
|
|
dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'fai') as faiOperatorName,
|
|
<!-- a.cqcOperator,-->
|
|
<!-- dbo.get_userDisPlay(a.cqcOperator) as cqcOperatorName,-->
|
|
<!-- a.faiOperator,-->
|
|
<!-- dbo.get_userDisPlay(a.faiOperator) as faiOperatorName,-->
|
|
d.is_reject as isReject,
|
|
d.node_id as nodeId,
|
|
d.node_name as nodeName,
|
|
pcpi.customer_part_no as customerPartNo,
|
|
dbo.get_plm_Approval_username(a.site, prh.workflow_id, d.node_id, a.code_no) as sp,
|
|
a.remarkPage,
|
|
a.rev,
|
|
a.customer_rev as customerRev,
|
|
b.plm_part_no as plmPartNo,
|
|
c.project_name as projectName
|
|
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_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
|
|
<if test="cutterNumber != null and cutterNumber != ''">
|
|
inner join plm_bm_prepress pbp on pbp.Site = a.site and pbp.code_no = a.code_no and
|
|
(plateNo like #{cutterNumber} or
|
|
cutterNumber like #{cutterNumber})
|
|
</if>
|
|
<where>
|
|
<if test="id != null">
|
|
AND a.id = #{id}
|
|
</if>
|
|
<if test="site != null and site != ''">
|
|
AND a.site = #{site}
|
|
</if>
|
|
<if test="ecnFlag != null and ecnFlag != ''">
|
|
AND a.ecn_flag = #{ecnFlag}
|
|
</if>
|
|
<if test="oriCodeNo != null and oriCodeNo != ''">
|
|
AND a.ori_code_no like #{oriCodeNo}
|
|
</if>
|
|
<if test="codeNo != null and codeNo != ''">
|
|
AND a.code_no like #{codeNo}
|
|
</if>
|
|
<if test="projectId != null and projectId != ''">
|
|
AND a.project_id like #{projectId}
|
|
</if>
|
|
<if test="testPartNo != null and testPartNo != ''">
|
|
AND (
|
|
a.test_part_no like #{testPartNo} or
|
|
b.final_part_no like #{testPartNo} or
|
|
a.relevance_part_no like #{testPartNo} or
|
|
pcpi.customer_part_no like #{testPartNo}
|
|
)
|
|
</if>
|
|
<if test="customerDesc != null and customerDesc != ''">
|
|
AND (
|
|
dbo.plm_get_customer_desc(c.site, c.customer_id) like #{customerDesc})
|
|
</if>
|
|
<if test="status == null or status == ''">
|
|
and a.status != 'death'
|
|
</if>
|
|
<if test="statusDesc != null and statusDesc != ''">
|
|
<!-- AND dbo.plm_get_technicalBaseDesc(a.status, 'status') like #{statusDesc}-->
|
|
and a.status = #{statusDesc}
|
|
</if>
|
|
<if test="buNo == null || buNo == ''">
|
|
AND b.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(#{site}, #{userName}))
|
|
</if>
|
|
<if test="buNo != null and buNo != ''">
|
|
AND b.bu_no like #{buNo}
|
|
</if>
|
|
</where>
|
|
order by a.ori_code_no desc, a.rev_no desc
|
|
</select>
|
|
|
|
<select id="queryTechnicalSpecificationCount" resultType="long">
|
|
SELECT
|
|
count(1)
|
|
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_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
|
|
<if test="cutterNumber != null and cutterNumber != ''">
|
|
inner join plm_bm_prepress pbp on pbp.Site = a.site and pbp.code_no = a.code_no and
|
|
(plateNo like #{cutterNumber} or
|
|
cutterNumber like #{cutterNumber})
|
|
</if>
|
|
<where>
|
|
<if test="id != null">
|
|
AND a.id = #{id}
|
|
</if>
|
|
<if test="site != null and site != ''">
|
|
AND a.site = #{site}
|
|
</if>
|
|
<if test="ecnFlag != null and ecnFlag != ''">
|
|
AND a.ecn_flag = #{ecnFlag}
|
|
</if>
|
|
<if test="oriCodeNo != null and oriCodeNo != ''">
|
|
AND a.ori_code_no like #{oriCodeNo}
|
|
</if>
|
|
<if test="codeNo != null and codeNo != ''">
|
|
AND a.code_no like #{codeNo}
|
|
</if>
|
|
<if test="projectId != null and projectId != ''">
|
|
AND a.project_id like #{projectId}
|
|
</if>
|
|
<if test="testPartNo != null and testPartNo != ''">
|
|
AND (
|
|
a.test_part_no like #{testPartNo} or
|
|
b.final_part_no like #{testPartNo} or
|
|
a.relevance_part_no like #{testPartNo} or
|
|
pcpi.customer_part_no like #{testPartNo}
|
|
)
|
|
</if>
|
|
<if test="customerDesc != null and customerDesc != ''">
|
|
AND (
|
|
dbo.plm_get_customer_desc(c.site, c.customer_id) like #{customerDesc} or
|
|
dbo.plm_get_dictDataLabel('finalCustomer', c.final_customer_id, c.site) like #{customerDesc}
|
|
)
|
|
</if>
|
|
<if test="statusDesc != null and statusDesc != ''">
|
|
AND dbo.plm_get_technicalBaseDesc(a.status, 'status') like #{statusDesc}
|
|
</if>
|
|
<if test="buNo == null || buNo == ''">
|
|
AND b.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(#{site}, #{userName}))
|
|
</if>
|
|
<if test="buNo != null and buNo != ''">
|
|
AND b.bu_no like #{buNo}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="queryTechnicalSpecificationList"
|
|
resultType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
|
|
EXEC dbo.getTechnicalSpecificationPageWithSql #{sql}, #{page}, #{limit}
|
|
</select>
|
|
|
|
<select id="queryChangeLog" resultType="com.spring.modules.change.vo.ChangeRequestVo">
|
|
SELECT a.site,
|
|
a.bu_no,
|
|
a.change_no,
|
|
a.applicant_id,
|
|
dbo.get_userDisPlay(a.applicant_id) as applicantName,
|
|
b.department_no as applicationDepartmentId,
|
|
dbo.get_department_name(a.site, b.department_no) as applicationDepartmentName,
|
|
a.apply_date,
|
|
a.ecn_type,
|
|
a.change_impact,
|
|
a.change_impact_desc,
|
|
a.ecn_stage,
|
|
a.change_type,
|
|
a.tp_engineer_id,
|
|
dbo.get_userDisPlay(a.tp_engineer_id) as tpEngineerName,
|
|
a.change_phase_in_date,
|
|
a.df_is_product,
|
|
a.printing,
|
|
a.manufacturing_cost_is_change,
|
|
a.change_request_desc,
|
|
a.is_re_quote,
|
|
a.ul_certification_requirements,
|
|
a.ul_continue_to_meet_demand,
|
|
a.gp_certification_requirements,
|
|
a.gp_continue_to_meet_demand,
|
|
a.create_date,
|
|
a.create_by,
|
|
a.update_date,
|
|
a.update_by,
|
|
a.industrial_engineer_id,
|
|
dbo.get_userDisPlay(a.industrial_engineer_id) as industrialEngineerName,
|
|
a.change_status,
|
|
a.cqc_operator_id,
|
|
dbo.get_userDisPlay(a.cqc_operator_id) as cqcOperatorName,
|
|
a.fai_operator_id,
|
|
dbo.get_userDisPlay(a.fai_operator_id) as faiOperatorName,
|
|
a.step_id,
|
|
a.reject_flag,
|
|
a.reject_step_id
|
|
FROM plm_change_request a
|
|
LEFT JOIN sys_user as b on a.site = b.site and a.applicant_id = b.username
|
|
left join plm_change_request_detail pcrd on a.site = pcrd.site and a.change_no = pcrd.change_no
|
|
where a.site = #{site} and a.show_in_query_flag = 'Y' and pcrd.code_no IN (SELECT code_no FROM plm_technical_specification_sheet WHERE site = #{site} AND ori_code_no = #{codeNo})
|
|
</select>
|
|
</mapper>
|