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.
 
 
 
 
 
 

3400 lines
145 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,
a.url_file
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, remarkPage,
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, document_source)
values
(#{site}, #{codeNo}, #{projectId}, #{testPartNo}, #{status}, #{revNo}, #{ecnFlag}, #{ecnNo}, #{ecnAddress}, #{remarkPage},
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},
remarkPage = #{remarkPage},
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', 'cs', 'mp', 'plan', 'qualityEngineer')
</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,
stage,
dbo.plm_get_dictDataLabel('bm_process', process, a.site) process,
remarkPage,
c.customer_Id,
a.ori_code_no,
a.overPrintOperator,
a.printOperator,
dbo.get_userDisPlay(a.overPrintOperator) overPrintOperatorName,
dbo.get_userDisPlay(a.printOperator) printOperatorName,
isnull(a.step_id, 10) stepId,
d.is_reject,
a.pod,
d.node_id,
d.node_name,
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'cs') csOperater,
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'cs') csOperaterName,
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'engineer') engineerNo,
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'engineer') engineer,
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'technician') technicianNo,
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'technician') technician,
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'qualityEngineer') qualityEngineerNo,
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'qualityEngineer') qualityEngineer,
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'mp') mpOperator,
dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'mp') mpOperatorName,
dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'dcc') dcc,
dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'cqc') cqcOperatorName,
dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'fai') faiOperatorName,
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'plan') planOperator,
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'plan') planOperatorName,
a.rev,
a.customer_rev,
relevance_part_no,
a.ecn_upgrade_version,
a.ecn_upgrade_flag,
a.ecn_need_change_drawing,
a.document_source,
a.shop_order,
a.copy_flag,
a.simplex_duplex,
a.repeat,
a.hp,
a.across,
a.print_copy_position,
a.label_size,
a.label_width,
a.label_length,
a.vp,
a.down,
a.actual_number,
a.goods_roll_width,
a.new_cutter,
a.p2c_tolerance,
a.dimension_tolerance,
a.slitting_tolerance,
a.url_file,
a.radius,
a.sheet,
a.partCategory
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},
ecn_need_change_drawing = #{ecnNeedChangeDrawing},
shop_order = #{shopOrder},
copy_flag = #{copyFlag},
partCategory = #{partCategory}
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.otherCertification,
a.customerRemark,
a.projectRemark,
b.project_id,
pcpi.customer_part_no,
a.direct_customer
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},
otherCertification=#{otherCertification},
customerRevNo=#{customerRevNo},
materialNumber=#{materialNumber},
customerRemark=#{customerRemark},
projectRemark=#{projectRemark},
direct_customer=#{directCustomer}
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,
operation_no
from plm_bm_propertiesValueHeader
where PartNo = #{codeNo} and site = #{site} and CodeNo = #{type} and bu_no = #{buNo} and operation_no = #{operationNo}
</select>
<insert id="savePlmBmPropertiesValueHeaderData">
insert into plm_bm_propertiesValueHeader(Site, bu_no, PartNo, CodeNo, SubCodeSeqNo, SubCodeDesc, RecordType, operation_no)
select
#{site},
#{buNo},
#{codeNo},
#{type},
1,
code_desc,
'BM',
#{operationNo}
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, operation_no)
select #{site},
#{buNo},
#{codeNo},
#{type},
ROW_NUMBER() OVER (ORDER BY b.code_desc) AS SubCodeSeqNo,
b.code_desc,
a.seq_no,
a.properties_item_no,
c.DefaultValue,
null,
'BM',
a.order_id,
#{operationNo}
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,
a.operation_no
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}
and a.operation_no = #{operationNo}
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}
and operation_no = #{operationNo}
</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 a.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,
operation_no
from plm_bm_prepress
where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
</select>
<insert id="saveBMPrepressDetail">
insert into plm_bm_prepress (Site, code_no, plateNo, cutterNumber, cutterLayout, [action], remark, feedback, update_by, update_date, operation_no)
values (#{site}, #{codeNo}, #{plateNo}, #{cutterNumber}, #{cutterLayout}, #{action}, #{remark}, #{feedback}, #{updateBy}, GetDate(), #{operationNo})
</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} and operation_no = #{operationNo}
</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,
operation_no
from plm_bm_PrintOther
where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
</select>
<insert id="saveBMPrintOtherDetail">
insert into plm_bm_PrintOther (site, code_no, remark, [action], update_date, update_by, operation_no)
values (#{site}, #{codeNo}, #{remark}, #{action}, GetDate(), #{updateBy}, #{operationNo})
</insert>
<update id="updateBMPrintOtherDetail">
update plm_bm_PrintOther
set remark = #{remark},
[action] = #{action}
where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
</update>
<select id="searchBMPrintOtherColor" resultType="PlmBmPrintOtherColorData">
select site,
code_no,
[order],
seqNo,
ink,
[type],
otherRef,
update_date,
update_by,
operation_no
from plm_bm_PrintOtherColor
where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
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 operation_no 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,
operation_no
from plm_bm_InkMixing
where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
</select>
<insert id="saveBMInkMixingDetail">
insert into plm_bm_InkMixing (site, code_no, colourMatch, visuallySetting, indicate, customerFile, remarks,
[action], update_date, update_by, operation_no)
values (#{site}, #{codeNo}, #{colourMatch}, #{visuallySetting}, #{indicate}, #{customerFile}, #{remarks},
#{action}, GetDate(), #{updateBy}, #{operationNo})
</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} and operation_no = #{operationNo}
</update>
<select id="searchBMInkMixingColor" resultType="PlmBmInkMixingColorData">
select
site,
code_no,
[order],
color,
[type],
supplier,
inkUsage,
mixTime,
standbyTime,
Viscosity,
RecycleTimes,
update_by,
update_date,
id,
operation_no
from plm_bm_InkMixingColor
where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
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, operation_no)
values (#{site}, #{codeNo}, #{order}, #{color}, #{type}, #{supplier}, #{inkUsage}, #{mixTime}, #{standbyTime},
#{viscosity}, #{recycleTimes}, #{updateBy}, GetDate(), #{operationNo})
</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} and operation_no = #{operationNo}
</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,
operation_no
from plm_bm_InkFormulation
where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
</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, operation_no)
values (#{site}, #{codeNo}, #{remarks}, #{labelSize}, #{qpa}, #{action}, #{cross}, #{row}, #{hp}, #{vp},
GetDate(), #{updateBy}, #{operationNo})
</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}
and operation_no = #{operationNo}
</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,
operation_no
from plm_bm_InkFormulationColor
where site = #{site}
and code_no = #{codeNo}
and operation_no = #{operationNo}
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, operation_no)
values (#{site}, #{codeNo}, #{order}, #{hardness}, #{tartness}, #{printingSide}, #{energy}, #{drySpeed},
#{dryTime}, #{dryTemp}, #{dryTime2}, GetDate(), #{updateBy}, #{operationNo})
</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}
and operation_no = #{operationNo}
</select>
<!-- Lamination 覆膜 -->
<select id="searchBMLaminationDetail" resultType="PlmBmLaminationData">
select
site,
code_no,
[action],
update_date,
update_by,
remark,
operation_no
from plm_bm_Lamination
where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
</select>
<insert id="saveBMLaminationDetail">
insert into plm_bm_Lamination (site, code_no, [action], update_date, update_by, remark, operation_no)
values (#{site}, #{codeNo}, #{action}, GetDate(), #{updateBy}, #{remark}, #{operationNo})
</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}
and operation_no = #{operationNo}
</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,
operation_no
from plm_bm_LaminationCut
where site = #{site}
and code_no = #{codeNo}
and operation_no = #{operationNo}
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, operation_no)
values (#{site}, #{codeNo}, #{order}, #{station}, #{processStep}, #{machine}, #{laminationType}, #{rmPartNo},
#{rmPartNo2}, #{filmPartNo}, #{laminationSide}, #{remarks},
GetDate(), #{updateBy}, #{operationNo})
</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}
and operation_no = #{operationNo}
</select>
<!-- Cnc -->
<select id="searchBMCncDetail" resultType="PlmBmCncData">
select
site,
code_no,
[action],
update_date,
update_by,
operation_no
from plm_bm_Cnc
where site = #{site}
and code_no = #{codeNo}
and operation_no = #{operationNo}
</select>
<insert id="saveBMCncDetail">
insert into plm_bm_Cnc (site, code_no, [action], update_date, update_by, operation_no)
values (#{site}, #{codeNo}, #{action}, GetDate(), #{updateBy}, #{operationNo})
</insert>
<update id="updateBMCncDetail">
update plm_bm_Cnc
set [action]=#{action},
update_date=GetDate(),
update_by=#{updateBy}
where site = #{site}
and code_no = #{codeNo}
and operation_no = #{operationNo}
</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,
operation_no
from plm_bm_CncCut
where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
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, operation_no)
values (#{site}, #{codeNo}, #{order}, #{cuttingMachine}, #{programName}, #{cuttingSpeed}, #{spec}, #{p2c},
#{c2c}, #{remarks}, GetDate(), #{updateBy}, #{operationNo})
</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}
and operation_no = #{operationNo}
</select>
<!-- Cut -->
<select id="searchBMCutDetail" resultType="PlmBmCutData">
select site, code_no, [action], remarks, update_date, update_by, operation_no
from plm_bm_Cut
where site = #{site}
and code_no = #{codeNo}
and operation_no = #{operationNo}
</select>
<insert id="saveBMCutDetail">
insert into plm_bm_Cut (site, code_no, [action], update_date, update_by, remarks, operation_no)
values (#{site}, #{codeNo}, #{action}, GetDate(), #{updateBy}, #{remarks}, #{operationNo})
</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}
and operation_no = #{operationNo}
</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,
operation_no
from plm_bm_CutCut
where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
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, operation_no)
values (#{site}, #{codeNo}, #{order}, #{cuttingMachine}, #{cuttingType}, #{cuttingTooling}, #{cutterNo},
#{cutterLayout}, #{cutterCost}, #{programName},
#{programPath}, #{p2c}, #{c2c}, #{updateBy}, GetDate(), #{operationNo})
</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}
and operation_no = #{operationNo}
</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,
resource_no,
operation_no
from plm_bm_PrintingColor
where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
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, resource_no, operation_no)
values
(#{site}, #{codeNo}, #{order}, #{inkType}, #{colorReference}, #{colorMatch}, #{bcm}, #{speed},
#{dry}, #{gallus}, #{markAndy}, #{lp}, #{hexiang}, #{updateBy}, GetDate(), #{resourceNo}, #{operationNo})
</insert>
<insert id="saveBMPrintingColors">
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, resource_no, operation_no)
values
<foreach collection="list" item="item" index="index" separator=",">
(#{item.site}, #{item.codeNo}, #{item.order}, #{item.inkType}, #{item.colorReference}, #{item.colorMatch}, #{item.bcm}, #{item.speed},
#{item.dry}, #{item.gallus}, #{item.markAndy}, #{item.lp}, #{item.hexiang}, #{item.updateBy}, GetDate(), #{item.resourceNo}, #{item.operationNo})
</foreach>
</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},
resource_no = #{resourceNo}
where id = #{id}
</update>
<delete id="deleteBMPrintingColor">
delete from plm_bm_PrintingColor
where id = #{id}
</delete>
<delete id="deleteBMPrintingColorByCodeNo">
delete from plm_bm_PrintingColor
where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
</delete>
<select id="checkPlmBmPrintingColorOrder" resultType="PlmBmPrintingColorData">
select site
from plm_bm_PrintingColor
where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo} 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,
a.url_file
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="updateBMProcessBom">
update plm_technical_specification_sheet
set url_file = #{urlFile}
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
a.id,
a.site,
a.codeNo,
a.printSide,
[order],
a.colorReference,
a.inkCode,
p.part_desc as inkDesc,
a.colorMatch,
a.lpi,
a.bcm,
a.openFlag,
a.gallus,
a.markAndy,
a.hexiang,
a.temperature,
a.pressure,
a.updateDate,
a.updateBy,
a.resource_no,
a.speed,
a.show_order,
a.operation_no,
a.remark
from plm_bm_printFlexoColor as a
left join part as p on a.site = p.site and a.inkCode = p.part_no
where a.site = #{site} and a.codeNo = #{codeNo} and a.operation_no = #{operationNo}
order by a.show_order
</select>
<select id="checkBMprintFlexoColorOrder" resultType="PlmBmPrintFlexoColorData">
select id, site, codeNo, printSide, [order], operation_no
from plm_bm_printFlexoColor
where site = #{site}
and codeNo = #{codeNo}
and printSide = #{printSide}
and [order] = #{order}
and operation_no = #{operationNo}
</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, resource_no, speed, show_order, operation_no)
values
(#{site}, #{codeNo}, #{printSide}, #{order}, #{colorReference}, #{inkCode}, #{colorMatch}, #{lpi},
#{bcm}, #{openFlag}, #{gallus}, #{markAndy}, #{hexiang}, #{temperature}, #{pressure}, GetDate(), #{updateBy}, #{remark}, #{resourceNo}, #{speed}, #{showOrder}, #{operationNo})
</insert>
<insert id="saveBMPrintFlexoColors">
insert into plm_bm_printFlexoColor
(site, codeNo, printSide, [order], colorReference, inkCode, colorMatch, lpi,
bcm, openFlag, gallus, markAndy, hexiang, temperature, pressure, updateDate,
updateBy, remark, resource_no, speed, show_order, operation_no)
values
<foreach collection="list" item="item" index="index" separator=",">
(#{item.site}, #{item.codeNo}, #{item.printSide}, #{item.order}, #{item.colorReference}, #{item.inkCode}, #{item.colorMatch}, #{item.lpi},
#{item.bcm}, #{item.openFlag}, #{item.gallus}, #{item.markAndy}, #{item.hexiang}, #{item.temperature}, #{item.pressure}, GetDate(),
#{item.updateBy}, #{item.remark}, #{item.resourceNo}, #{item.speed}, #{item.showOrder}, #{item.operationNo})
</foreach>
</insert>
<update id="updateBMprintFlexoColor">
update plm_bm_printFlexoColor
set printSide = #{printSide},
[order] = #{order,jdbcType=INTEGER},
show_order = #{showOrder},
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},
resource_no = #{resourceNo},
speed = #{speed}
where id = #{id}
</update>
<delete id="deleteBMprintFlexoColor">
delete from plm_bm_printFlexoColor
where id = #{id}
</delete>
<delete id="deleteBMPrintFlexoColorByCodeNo">
delete from plm_bm_printFlexoColor
where site = #{site} and codeNo = #{codeNo} and operation_no = #{operationNo}
</delete>
<select id="searchBMprintIndigoColor" resultType="PlmBmPrintIndigoColorData">
select
a.id,
a.code_no,
a.site,
[order],
a.printSide,
a.colorReference,
a.inkCode,
p.part_desc as inkDesc,
a.colorMatch,
a.printMotion,
a.opticalDensity,
a.lut,
a.lpi,
a.screenAngle,
a.printHits,
a.blanketTemperture,
a.remark,
a.updateBy,
a.updateDate,
a.show_order,
a.operation_no
from plm_bm_printIndigoColor as a
left join part as p on a.site = p.site and a.inkCode = p.part_no
where a.site = #{site} and a.code_no = #{codeNo} and a.operation_no = #{operationNo}
order by a.show_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, show_order, operation_no)
values
(#{site}, #{codeNo}, #{order}, #{printSide}, #{colorReference}, #{inkCode}, #{colorMatch},
#{printMotion}, #{opticalDensity}, #{lut}, #{lpi}, #{screenAngle}, #{printHits}, #{blanketTemperture},
#{remark}, #{updateBy}, GetDate(), #{showOrder}, #{operationNo})
</insert>
<insert id="saveBMPrintIndigoColors">
insert into plm_bm_printIndigoColor
(site, code_no, [order], printSide, colorReference, inkCode, colorMatch,
printMotion, opticalDensity, lut, lpi, screenAngle, printHits, blanketTemperture,
remark, updateBy, updateDate, show_order, operation_no)
values
<foreach collection="list" item="item" index="index" separator=",">
(#{item.site}, #{item.codeNo}, #{item.order}, #{item.printSide}, #{item.colorReference}, #{item.inkCode}, #{item.colorMatch},
#{item.printMotion}, #{item.opticalDensity}, #{item.lut}, #{item.lpi}, #{item.screenAngle}, #{item.printHits}, #{item.blanketTemperture},
#{item.remark}, #{item.updateBy}, GetDate(), #{item.showOrder}, #{item.operationNo})
</foreach>
</insert>
<update id="updateBMprintIndigoColor">
update plm_bm_printIndigoColor
set printSide=#{printSide},
[order]=#{order,jdbcType=INTEGER},
show_order= #{showOrder},
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>
<delete id="deleteBMPrintIndigoColorByCodeNo">
delete from plm_bm_printIndigoColor
where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
</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,
relevance_part_no,
ecn_upgrade_version,
ecn_need_change_drawing,
ecn_upgrade_flag,
url_file,
copy_flag,
shop_order
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 as a
left join plm_project_info as c on a.site = c.site and a.project_id = c.project_id
left join plm_customer_part_info as pcpi on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no
left join plm_technical_specification_sheet d on a.site = d.site and a.test_part_no = d.test_part_no
<where>
and d.test_part_no is null
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,
a.url_file
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.site = #{query.site}
<if test = "query.buNo != null and query.buNo != ''">
AND a.bu_no = #{query.buNo}
</if>
<if test = "query.finalPartNo != null and query.finalPartNo != ''">
AND a.Final_Part_No LIKE #{query.finalPartNo}
</if>
<if test = "query.testPartNo != null and query.testPartNo != ''">
AND a.Test_Part_No LIKE #{query.testPartNo}
</if>
<if test = "query.projectId != null and query.projectId != ''">
AND a.project_id LIKE #{query.projectId}
</if>
<if test = "query.customerPartNo != null and query.customerPartNo != ''">
AND pcpi.customer_part_no LIKE #{query.customerPartNo}
</if>
and a.realFlag = 'Y'
and ps.Test_part_no is null
and dbo.Get_PartHasRealBOMRoute(a.site, a.Final_Part_No) = 'Y'
</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,
process,
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,
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'cs') csOperater,
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'cs') csOperaterName,
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'engineer') engineerNo,
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'engineer') engineer,
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'technician') technicianNo,
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'technician') technician,
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'qualityEngineer') qualityEngineerNo,
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'qualityEngineer') qualityEngineer,
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'mp') mpOperator,
dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'mp') mpOperatorName,
dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'dcc') dccOperaterName,
dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'cqc') cqcOperatorName,
dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'fai') faiOperatorName,
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'plan') planOperator,
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'plan') planOperatorName,
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,
a.document_source as documentSource,
a.url_file,
a.stage,
a.label_length,
a.label_width,
a.radius
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 (
SELECT SITE,code_no
FROM plm_bm_prepress
WHERE plateNo LIKE #{cutterNumber}
UNION ALL
SELECT SITE,code_no
FROM plm_bm_prepress_tool
WHERE tool_id LIKE #{cutterNumber}
OR tool_desc LIKE #{cutterNumber}
) AS pbp_bpt ON pbp_bpt.Site = a.site AND pbp_bpt.code_no = a.code_no
</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}+'%' or
b.part_desc 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="statusDesc == null or statusDesc == ''">
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>
<if test="nodeId != null and nodeId != ''">
AND d.node_id = #{nodeId}
</if>
<if test="sp != null and sp != ''">
AND dbo.get_plm_Approval_username(a.site, prh.workflow_id, d.node_id, a.code_no) like #{sp}
</if>
<if test="documentSource != null and documentSource != ''">
AND a.document_source = #{documentSource}
</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 or statusDesc == ''">
and a.status != 'death'
</if>
<if test="statusDesc != null and statusDesc != ''">
AND a.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>
<if test="nodeId != null and nodeId != ''">
AND d.node_id = #{nodeId}
</if>
<if test="sp != null and sp != ''">
AND dbo.get_plm_Approval_username(a.site, prh.workflow_id, d.node_id, a.code_no) like #{sp}
</if>
<if test="documentSource != null and documentSource != ''">
AND a.document_source = #{documentSource}
</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">
WITH SpecCode AS (SELECT ori_code_no
FROM plm_technical_specification_sheet
WHERE site = #{site}
AND code_no = #{codeNo}),
TargetCode AS (SELECT code_no
FROM plm_technical_specification_sheet
WHERE ori_code_no IN (SELECT ori_code_no FROM SpecCode))
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 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 TargetCode)
</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>-->
<update id="updateBMStepId" parameterType="PlmTechnicalSpecificationSheetData">
update plm_technical_specification_sheet
set step_id = #{stepId}
where site = #{site} and code_no = #{codeNo}
</update>
<update id="bmStatusToCg" parameterType="PlmTechnicalSpecificationSheetData">
update plm_technical_specification_sheet
set step_id = #{stepId},
status = #{status},
update_date = getDate(),
update_by = #{userName},
ECN_flag = 'N',
stage = 'Sample'
where site = #{site} and code_no = #{codeNo}
</update>
<update id="updateBMIsRemark" parameterType="PlmTechnicalSpecificationSheetData">
update plm_process_form
set is_remark = 1
where site = #{site} and document_no = #{codeNo} and document_type = 'BM' and is_remark = 0
</update>
<update id="updateBMProcessInfo" parameterType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
UPDATE plm_technical_specification_sheet
SET simplex_duplex = #{simplexDuplex},
repeat = #{repeat},
hp = #{hp},
across = #{across},
print_copy_position = #{printCopyPosition},
label_size = #{labelSize},
vp = #{vp},
down = #{down},
actual_number = #{actualNumber},
goods_roll_width = #{goodsRollWidth},
new_cutter = #{newCutter},
p2c_tolerance = #{p2cTolerance},
dimension_tolerance = #{dimensionTolerance},
slitting_tolerance = #{slittingTolerance},
label_length = #{labelLength},
label_width = #{labelWidth},
radius = #{radius},
sheet = #{sheet}
where site = #{site} and code_no = #{codeNo}
</update>
<select id="nodeList" resultType="com.spring.modules.sampleManagement.entity.NodeVo" parameterType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
SELECT
d.node_id AS nodeId,
d.node_name AS nodeName
FROM
plm_request_header AS prh
LEFT JOIN plm_request_node AS d ON prh.site = d.site and prh.classification_no = d.classification_no
AND prh.workflow_id = d.workflow_id AND prh.menu_id = #{menuId}
WHERE
d.site = #{site}
order by seq_no
</select>
<select id="queryTechnicalSpecificationCountByAnyField" resultType="java.lang.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
left join plm_customer_information as pci on pcpi.site = pci.site and pcpi.customer_no = pci.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>
<if test="whereClause != null and whereClause != ''">
WHERE ${whereClause}
</if>
</select>
<select id="technicalSpecificationListByAnyField"
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,
process,
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,
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'cs') csOperater,
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'cs') csOperaterName,
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'engineer') engineerNo,
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'engineer') engineer,
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'technician') technicianNo,
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'technician') technician,
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'qualityEngineer') qualityEngineerNo,
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'qualityEngineer') qualityEngineer,
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'mp') mpOperator,
dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'mp') mpOperatorName,
dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'dcc') dccOperaterName,
dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'cqc') cqcOperatorName,
dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'fai') faiOperatorName,
dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'plan') planOperator,
dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'plan') planOperatorName,
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,
a.document_source as documentSource,
a.url_file,
a.stage,
a.label_length,
a.label_width,
a.radius
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
left join plm_customer_information as pci on pcpi.site = pci.site and pcpi.customer_no = pci.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
(pbp.plateNo like #{cutterNumber} or
pbp.cutterNumber like #{cutterNumber})
</if>
<if test="whereClause != null and whereClause != ''">
WHERE ${whereClause}
</if>
<if test="orderClause != null and orderClause != ''">
ORDER BY ${orderClause}
</if>
<if test="orderClause == null or orderClause == ''">
ORDER BY a.ori_code_no desc, a.rev_no desc
</if>
</select>
<select id="urlFileSearch" resultType="com.spring.modules.sys.entity.DictData">
select sdd.dict_label as dictLabel,
sdd.dict_value as dictValue
from sys_dict_type as sdt
left join sys_dict_data as sdd on sdt.dict_type = sdd.dict_type and sdt.site = sdd.site
where sdd.site = #{query.site}
and sdd.dict_type = #{query.dictType}
and sdt.status = 'Y'
and sdd.status = 'Y'
<if test="query.dictLabel != null and query.dictLabel != ''">
and sdd.dict_label like #{query.dictLabel}
</if>
</select>
<select id="TechnicalSpecificationCount" resultType="java.lang.Long"
parameterType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
EXEC dbo.getTechnicalSpecificationPageWithSqlCount #{sql}
</select>
<select id="technicalSpecificationListSearchInPane" resultType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
SELECT
A.project_id,
a.id,
a.site,
a.code_no as codeNo,
a.test_part_no as testPartNo,
a.status,
a.rev_no as revNo,
a.ECN_flag as ecnFlag,
a.ECN_no as ecnNo,
a.ori_code_no as oriCodeNo,
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_plm_Approval_username(a.site, prh.workflow_id, d.node_id, a.code_no) as sp,
a.remarkPage,
a.rev,
b.plm_part_no as plmPartNo,
a.document_source as documentSource,
a.url_file
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_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>
<if test="query.site != null and query.site != ''">
AND a.site = #{query.site}
</if>
<if test="query.site != null and query.site != '' and query.userName != null and query.userName != ''">
AND b.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(#{query.site}, #{query.userName}))
</if>
<if test="query.projectId != null and query.projectId != ''">
and b.project_id = #{query.projectId}
</if>
<if test="query.projectId == null">
and a.id IS NULL
</if>
</where>
order by a.ori_code_no desc, a.rev_no desc
</select>
<update id="updateBMInfo">
update plm_technical_specification_sheet
set status = #{status},
step_id = #{stepId},
stage = #{stage},
update_date = getDate(),
update_by = #{userName}
where site = #{site} and code_no = #{codeNo}
</update>
<select id="searchBMPrepressToolList" resultType="com.spring.modules.sampleManagement.entity.PlmBmPrepressTool">
select
site,
code_no,
item_no,
seq_no,
tool_id,
tool_desc,
number_across,
number_down,
create_date,
create_by,
update_date,
update_by,
operation_no,
remark
from plm_bm_prepress_tool
where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
order by seq_no
</select>
<select id="checkPlmBmPrepressToolItemNo" resultType="com.spring.modules.sampleManagement.entity.PlmBmPrepressTool">
select
site,
code_no,
operation_no,
item_no,
seq_no,
remark
from plm_bm_prepress_tool
where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
order by item_no desc
</select>
<insert id="saveBMPrepressTool">
insert into plm_bm_prepress_tool
(site, code_no, item_no, seq_no, tool_id, tool_desc, number_across, number_down, create_date, create_by, operation_no, remark)
values
(#{site}, #{codeNo}, #{itemNo}, #{seqNo}, #{toolId}, #{toolDesc}, #{numberAcross}, #{numberDown}, getDate(), #{createBy}, #{operationNo}, #{remark})
</insert>
<update id="updateBMPrepressTool">
update plm_bm_prepress_tool
set seq_no = #{seqNo},
tool_id = #{toolId},
tool_desc = #{toolDesc},
number_across = #{numberAcross},
number_down = #{numberDown},
update_date = getDate(),
update_by = #{updateBy},
remark = #{remark}
where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo} and item_no = #{itemNo}
</update>
<delete id="deleteBMPrepressTool">
delete from plm_bm_prepress_tool
where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo} and item_no = #{itemNo}
</delete>
<select id="getBMToolByRoutingAlt" resultType="com.spring.modules.sampleManagement.entity.PlmBmPrepressTool">
select
rt.site,
#{codeNo} as codeNo,
rt.tool_id,
th.tool_description as toolDesc,
rt.remark
from routing_tool as rt
left join tool_header as th on rt.site = th.site and rt.tool_id = th.tool_id
where rt.site = #{site} and rt.part_no = #{partNo} and rt.routing_revision = #{routingRevision} and rt.routing_type = #{routingType} and rt.alternative_no = #{alternativeNo}
</select>
<insert id="saveBMToolBatch">
insert into plm_bm_prepress_tool
(site, code_no, item_no, seq_no, tool_id, tool_desc, number_across, number_down, create_date, create_by, operation_no, remark) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{item.site}, #{item.codeNo}, #{item.itemNo}, #{item.seqNo}, #{item.toolId}, #{item.toolDesc}, #{item.numberAcross}, #{item.numberDown}, getDate(), #{item.createBy}, #{item.operationNo}, #{item.remark})
</foreach>
</insert>
<select id="selectDictData" resultType="com.spring.modules.sys.entity.DictData">
SELECT
dict_label,
dict_value,
is_default
FROM sys_dict_data
<where>
site = #{site}
and dict_type = #{dictType}
and status = 'Y'
<if test="isDefault != null and isDefault != ''">
and is_default = #{isDefault}
</if>
</where>
</select>
<select id="getToolPropertiesValue" resultType="com.spring.modules.base.data.PartSubPropertiesValueData">
select
TextValue,
NumValue
from PartSubPropertiesValue
where site = #{site} and PartNo = #{toolId} and RecordType = #{recordType} and PropertiesItemNo = #{dictValue}
</select>
<delete id="deleteBMPrepressToolByCodeNo">
delete from plm_bm_prepress_tool
where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
</delete>
<select id="getTechnicalSpecificationByPart" resultType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
SELECT
a.project_id,
a.id,
a.site,
a.code_no as codeNo,
a.test_part_no,
b.final_part_no
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
where a.site = #{site}
<if test = "buNo != null and buNo != ''">
AND b.bu_no = #{buNo}
</if>
<if test="testPartNo != null and testPartNo != ''">
and b.test_part_no = #{testPartNo}
</if>
<if test="finalPartNo != null and finalPartNo != ''">
and b.final_part_no = #{finalPartNo}
</if>
<if test="projectId != null and projectId != ''">
and a.project_id = #{projectId}
</if>
</select>
<delete id="deleteBmBom">
delete from plm_bm_bom
where site = #{site} and code_no = #{codeNo}
</delete>
<insert id="saveBmBom">
insert into plm_bm_bom
(site, code_no, part_no, eng_chg_level, bom_type, alternative_no, component_part, component_part_desc, print_unit, print_unit_name, qty_per_assembly,
component_scrap, shrinkage_factor, issue_type, line_item_no, line_sequence, operation_no, issue_to_loc, issue_to_loc_name, note_text, Levels,
planning_method, comp_eng_chg_level, comp_bom_type, comp_alternative_no, sort_seq_no, create_date, create_by)
values
(#{site}, #{codeNo}, #{partNo}, #{engChgLevel}, #{bomType}, #{alternativeNo}, #{componentPart}, #{componentPartDesc}, #{printUnit}, #{printUnitName}, #{qtyPerAssembly},
#{componentScrap}, #{shrinkageFactor}, #{issueType}, #{lineItemNo}, #{lineSequence}, #{operationNo}, #{issueToLoc}, #{issueToLocName}, #{noteText}, #{levels},
#{planningMethod}, #{compEngChgLevel}, #{compBomType}, #{compAlternativeNo}, #{sortSeqNo}, getDate(), #{createBy})
</insert>
<delete id="deleteBmRouting">
delete from plm_bm_routing
where site = #{site} and code_no = #{codeNo}
</delete>
<insert id="saveBmRouting">
insert into plm_bm_routing
(site, code_no, part_no, routing_revision, routing_type, alternative_no, operation_no, efficiency_factor, mach_run_factor, mach_setup_time,
run_time_code, labor_run_factor, labor_setup_time, crew_size, setup_crew_size, outside_op_item, machine_no, work_center_no, labor_class_no,
setup_labor_class_no, overlap, note_text, create_date, create_by, operation_name)
select
site, #{codeNo}, part_no, routing_revision, routing_type, alternative_no, operation_no, efficiency_factor, mach_run_factor, mach_setup_time,
run_time_code, labor_run_factor, labor_setup_time, crew_size, setup_crew_size, outside_op_item, machine_no, work_center_no, labor_class_no,
setup_labor_class_no, overlap, note_text, getDate(), #{createBy}, operation_name
from plm_routing_component
where site = #{site} and part_no = #{partNo} and routing_revision = #{routingRevision} and routing_type = #{routingType} and alternative_no = #{alternativeNo}
order by operation_no
</insert>
<select id="selectBmRouting" resultType="com.spring.modules.part.vo.RoutingComponentVo">
SELECT
a.site,
a.code_no,
a.part_no,
a.routing_revision,
a.routing_type,
a.alternative_no,
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_bm_routing as a
left join WorkCenter_BMType b on a.site = b.site and a.work_center_no = b.workCenterNo
WHERE a.site = #{site} AND a.code_no = #{codeNo}
order by a.operation_no
</select>
<update id="updateBMBasicInfoEntry">
update plm_technical_specification_sheet
set remarkPage = #{remarkPage},
relevance_part_no = #{relevancePartNo},
update_date = GetDate(),
update_by = #{updateBy}
where site = #{site} and code_no = #{codeNo}
</update>
<select id="searchBMSilkScreenColor" resultType="com.spring.modules.sampleManagement.data.PlmBmSilkScreenColorData">
select
a.id,
a.site,
a.codeNo,
a.printSide,
[order],
a.colorReference,
a.inkCode,
p.part_desc as inkDesc,
a.colorMatch,
a.lpi,
a.bcm,
a.openFlag,
a.gallus,
a.markAndy,
a.hexiang,
a.temperature,
a.pressure,
a.updateDate,
a.updateBy,
a.resource_no,
a.speed,
a.show_order,
a.operation_no,
a.remark
from plm_bm_silkScreenColor as a
left join part as p on a.site = p.site and a.inkCode = p.part_no
where a.site = #{site} and a.codeNo = #{codeNo} and a.operation_no = #{operationNo}
order by a.show_order
</select>
<insert id="saveBMSilkScreenColor">
insert into plm_bm_silkScreenColor
(site, codeNo, printSide, [order], colorReference, inkCode, colorMatch, lpi,
bcm, openFlag, gallus, markAndy, hexiang, temperature, pressure, updateDate, updateBy, remark, resource_no, speed, show_order, operation_no)
values
(#{site}, #{codeNo}, #{printSide}, #{order}, #{colorReference}, #{inkCode}, #{colorMatch}, #{lpi},
#{bcm}, #{openFlag}, #{gallus}, #{markAndy}, #{hexiang}, #{temperature}, #{pressure}, GetDate(), #{updateBy}, #{remark}, #{resourceNo}, #{speed}, #{showOrder}, #{operationNo})
</insert>
<update id="updateBMSilkScreenColor">
update plm_bm_silkScreenColor
set printSide = #{printSide},
[order] = #{order,jdbcType=INTEGER},
show_order = #{showOrder},
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},
resource_no = #{resourceNo},
speed = #{speed}
where id = #{id}
</update>
<delete id="deleteBMSilkScreenColor">
delete from plm_bm_silkScreenColor
where id = #{id}
</delete>
<delete id="deleteBMSilkScreenColorByCodeNo">
delete from plm_bm_silkScreenColor
where site = #{site} and codeNo = #{codeNo} and operation_no = #{operationNo}
</delete>
<insert id="saveBMSilkScreenColors">
insert into plm_bm_silkScreenColor
(site, codeNo, printSide, [order], colorReference, inkCode, colorMatch, lpi,
bcm, openFlag, gallus, markAndy, hexiang, temperature, pressure, updateDate,
updateBy, remark, resource_no, speed, show_order, operation_no)
values
<foreach collection="list" item="item" index="index" separator=",">
(#{item.site}, #{item.codeNo}, #{item.printSide}, #{item.order}, #{item.colorReference}, #{item.inkCode}, #{item.colorMatch}, #{item.lpi},
#{item.bcm}, #{item.openFlag}, #{item.gallus}, #{item.markAndy}, #{item.hexiang}, #{item.temperature}, #{item.pressure}, GetDate(),
#{item.updateBy}, #{item.remark}, #{item.resourceNo}, #{item.speed}, #{item.showOrder}, #{item.operationNo})
</foreach>
</insert>
<update id="updateProcessForm"
parameterType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
UPDATE a
SET a.update_by = #{username},
a.update_date = GETDATE(),
node_conclusion = #{nodeConclusion},
is_remark = 2
FROM plm_process_form a
LEFT JOIN plm_technical_specification_sheet b ON a.site = b.site
AND a.document_no = b.code_no
AND a.step_id = b.step_id
WHERE
a.site = b.site
AND a.document_no = b.code_no
AND a.step_id = b.step_id
AND a.site = #{site}
AND a.document_no = #{codeNo}
AND a.is_remark = 0
</update>
<update id="updateBMPrepressDetailPlateNo">
update plm_bm_prepress
set plateNo = #{plateNo},
update_by = #{updateBy},
update_date = GetDate()
where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
</update>
<select id="getRoutingGuideLineByLineDesc" resultType="com.spring.modules.part.vo.WorkGuidelineVo">
SELECT
id,
site,
part_no,
routing_revision,
routing_type,
alternative_no,
operation_id,
guideline_seq,
guideline_desc,
guideline_text,
guideline_type
FROM plm_routing_work_guide
where site = #{site} and part_no = #{partNo} and routing_revision = #{routingRevision} and routing_type = #{routingType}
and alternative_no = #{alternativeNo} and operation_id = #{operationId} and guideline_desc = #{dictLabel}
</select>
</mapper>