|
|
<?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">
<select id="technicalSpecificationListSearch" parameterType="PlmTechnicalSpecificationSheetData" resultType="PlmTechnicalSpecificationSheetData"> SELECT a.id,a.site,a.code_no,a.project_id,a.test_part_no,a.status,a.rev_no,a.work_center_no,a.ECN_flag,a.ECN_no,a.ori_code_no, a.ECN_address,a.remark,a.create_date,a.create_by,a.update_date,a.update_by,b.final_part_no,dbo.plm_get_projectBaseDesc(b.part_type,'part_type') partTypeDesc, b.part_type,b.part_name,b.part_desc,b.part_spec,dbo.plm_get_technicalBaseDesc(a.status,'status') statusDesc,a.proofing_no,b.bu_no,dbo.plm_get_bu_desc(a.site,b.bu_no) buDesc, dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'engineer') engineer, dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'technician') technician,process, dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'quotationOfficer') quotationOfficer,c.customer_Id ,a.picture_addess,a.customerPictureChangeRemark,a.productionFileComments,a.bom_type,a.eng_chg_level,a.bom_alternative_no,a.routing_type,a.routing_revision, a.routing_alternative_no,a.pod, a.mpOperator,dbo.get_userDisPlay(a.mpOperator) mpOperatorName , a.cqcOperator,dbo.get_userDisPlay(a.cqcOperator) cqcOperatorName , a.faiOperator,dbo.get_userDisPlay(a.faiOperator) faiOperatorName ,a.peOperater,dbo.get_userDisPlay(a.peOperater) peOperaterName ,a.csOperater,dbo.get_userDisPlay(a.csOperater) csOperaterName ,a.dccOperater,dbo.get_userDisPlay(a.dccOperater) dccOperaterName
FROM plm_technical_specification_sheet a left join view_Project_Part b on a.site=b.site and a.project_id=b.project_id and a.test_part_no=b.test_part_no left join plm_project_info c on a.site=c.site and a.project_id=c.project_id <where> <if test="query.id != null"> AND a.id = #{query.id} </if> <if test="query.site != null and query.site != ''"> AND a.site = #{query.site} </if> <if test="query.oriCodeNo != null and query.oriCodeNo != ''"> AND a.ori_code_no like #{query.oriCodeNo} </if> <if test="query.codeNo != null and query.codeNo != ''"> AND a.code_no like #{query.codeNo} </if> <if test="query.projectId != null and query.projectId != ''"> AND a.project_id like #{query.projectId} </if> <if test="query.testPartNo != null and query.testPartNo != ''"> AND a.test_part_no like #{query.testPartNo} </if> <if test="query.statusDesc != null and query.statusDesc != ''"> AND dbo.plm_get_technicalBaseDesc(a.status,'status') like #{query.statusDesc} </if> </where> order by a.code_no desc</select>
<insert id="saveTechnicalSpecificationSheet"> insert into plm_technical_specification_sheet(site,code_no,project_id,test_part_no,status,rev_no,ECN_flag,ECN_no,ECN_address,remark, create_date,create_by,proofing_no,ori_code_no,bom_type,eng_chg_level,bom_alternative_no,routing_type,routing_revision,routing_alternative_no,stage,materialType,step_id ,cqcOperator,faiOperator,peOperater,csOperater,dccOperater,mpOperator) values (#{site},#{codeNo},#{projectId},#{testPartNo},#{status},#{revNo},#{ecnFlag},#{ecnNo},#{ecnAddress} ,#{remark},GetDate(),#{createBy},#{proofingNo},#{oriCodeNo},#{bomType},#{engChgLevel,jdbcType=INTEGER},#{bomAlternativeNo},#{routingType},#{routingRevision,jdbcType=INTEGER},#{routingAlternativeNo},'Sample','Label',10 ,#{cqcOperator},#{faiOperator},#{peOperater},#{csOperater},#{dccOperater},#{mpOperator})</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>
<update id="updateTechnicalSpecificationSheet"> update plm_technical_specification_sheet set project_id=#{projectId},test_part_no=#{testPartNo},status=#{status} ,rev_no=#{revNo},ECN_no=#{ecnNo},ECN_flag=#{ecnFlag},ECN_address=#{ecnAddress},remark=#{remark},update_date=GetDate(),update_by=#{updateBy} ,cqcOperator=#{cqcOperator},faiOperator=#{faiOperator},peOperater=#{peOperater}, csOperater=#{csOperater},dccOperater=#{dccOperater},mpOperator=#{mpOperator} 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')</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="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,dbo.plm_get_projectBaseDesc(b.part_type,'part_type') partTypeDesc, b.part_type,b.part_name,b.part_desc,b.part_spec,dbo.plm_get_technicalBaseDesc(a.status,'status') statusDesc,a.proofing_no, dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'engineer') engineer,stage,dbo.plm_get_dictDataLabel('bm_process',process,a.site) process,remarkPage, dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'quotationOfficer') quotationOfficer,c.customer_Id,a.ori_code_no, a.cqcOperator, a.faiOperator,dbo.get_userDisPlay(a.cqcOperator) cqcOperatorName,dbo.get_userDisPlay(a.faiOperator) faiOperatorName ,a.overPrintOperator, a.printOperator,dbo.get_userDisPlay(a.overPrintOperator) overPrintOperatorName,dbo.get_userDisPlay(a.printOperator) printOperatorName ,a.peOperater,dbo.get_userDisPlay(a.peOperater) peOperaterName ,a.csOperater,dbo.get_userDisPlay(a.csOperater) csOperaterName ,a.dccOperater,dbo.get_userDisPlay(a.dccOperater) dccOperaterName,isnull(a.step_id,10) stepId,d.is_reject,a.pod, a.mpOperator,dbo.get_userDisPlay(a.mpOperator) mpOperatorName ,dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'technician') technician FROM plm_technical_specification_sheet a left join view_Project_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_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,dbo.plm_get_projectBaseDesc(b.part_type,'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_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_customer_desc(a.site,b.final_customer_id) finalCustomerDesc, b.project_name 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 <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},dccOperater=#{dccOperater},pod=#{pod},mpOperator=#{mpOperator} 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.final_customer_id finalCustomerNo,dbo.plm_get_customer_desc(a.site,b.final_customer_id) finalCustomerDesc, a.test_part_no as part_no,c.part_desc,c.material_number,c.part_type as part_family,b.customer_remark, b.remark projectRemark,a.remark,a.ori_code_no,a.materialType 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_Part c on a.site=c.site and a.test_part_no=c.test_part_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} where site=#{site} and code_no=#{codeNo}</update>
<select id="searchBMPackageInfo" resultType="PlmBmPackageInfoData"> select site,code_no,matrixStripped,appliedType,finalFormat,[rowCount],columnCount,missingAllowedFlag,rollPerQty,addingFilmFlag, packageRequest,coreType,coreDiameter,joinAllowedFlag,coreWidth,specialPositiorFlag,copyPosition,overprintingFlag, otherRequirement from plm_bm_packageInfo where site=#{site} and code_no=#{codeNo}</select>
<update id="updateBMPackageInfo"> update plm_bm_packageInfo set matrixStripped=#{matrixStripped},appliedType=#{appliedType},finalFormat=#{finalFormat},[rowCount]=#{rowCount,jdbcType=INTEGER},columnCount=#{columnCount,jdbcType=INTEGER}, missingAllowedFlag=#{missingAllowedFlag},rollPerQty=#{rollPerQty,jdbcType=DECIMAL},addingFilmFlag=#{addingFilmFlag}, packageRequest=#{packageRequest},coreType=#{coreType},coreDiameter=#{coreDiameter},joinAllowedFlag=#{joinAllowedFlag},coreWidth=#{coreWidth,jdbcType=DECIMAL}, specialPositiorFlag=#{specialPositiorFlag},copyPosition=#{copyPosition},overprintingFlag=#{overprintingFlag}, otherRequirement=#{otherRequirement},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}</update>
<select id="saveBMPackageInfo"> insert into plm_bm_packageInfo (site,code_no,matrixStripped,appliedType,finalFormat,[rowCount],columnCount,missingAllowedFlag,rollPerQty,addingFilmFlag,packageRequest,coreType,coreDiameter,joinAllowedFlag,coreWidth,specialPositiorFlag,copyPosition,overprintingFlag,otherRequirement,update_date,update_by) values (#{site},#{codeNo},#{matrixStripped},#{appliedType},#{finalFormat},#{rowCount,jdbcType=INTEGER},#{columnCount,jdbcType=INTEGER}, #{missingAllowedFlag},#{rollPerQty,jdbcType=DECIMAL},#{addingFilmFlag},#{packageRequest},#{coreType},#{coreDiameter},#{joinAllowedFlag},#{coreWidth,jdbcType=DECIMAL}, #{specialPositiorFlag},#{copyPosition},#{overprintingFlag},#{otherRequirement},GetDate(),#{updateBy})</select>
<select id="searchPartDataForSelect" resultType="com.spring.modules.part.vo.PartInformationVo"> select top 100 a.erp_part_no ,a.part_desc,a.family_id,a.spec,family_name from part a left join part_family b on a.site=b.site and a.family_id=b.family_id <where> and a.site=#{site} <if test="erpPartNo!= null and erpPartNo != ''"> AND a.erp_part_no like #{erpPartNo} </if> <if test="familyId!= null and familyId != ''"> AND a.family_id like #{familyId} </if> <if test="partDesc!= null and partDesc != ''"> AND a.part_desc like #{partDesc} </if> and a.erp_part_no is not null and a.erp_part_no !='' </where></select>
<insert id="saveBMBom" > insert into plm_bm_bom (Site,code_no,erp_part_no,quantity,remark,create_by,create_date) values(#{site},#{codeNo},#{erpPartNo},#{quantity},#{remark},#{username},GetDate())</insert>
<update id="updateBMBom" > update plm_bm_bom set quantity=#{quantity,jdbcType=DECIMAL} ,remark=#{remark},update_by=#{username}, update_date=GetDate() where Site=#{site} and code_no=#{codeNo} and erp_part_no=#{erpPartNo}</update>
<select id="searchBMBom" resultType="PlmBmBomData"> select a.Site,a.code_no,a.erp_part_no,a.quantity,a.remark,b.part_desc,b.spec,b.family_id,c.family_name from plm_bm_bom a left join part b on a.erp_part_no=b.erp_part_no and a.site=b.site left join part_family c on b.family_id=c.family_id and b.site=c.site <where> and a.site=#{site} <if test="erpPartNo!= null and erpPartNo != ''"> AND a.erp_part_no like #{erpPartNo} </if> <if test="codeNo!= null and codeNo != ''"> AND a.code_no like #{codeNo} </if> </where></select>
<delete id="deleteBMBom" > delete from plm_bm_bom where code_no=#{codeNo} and site=#{site} and erp_part_no=#{erpPartNo}</delete>
<select id="searchBMRoutingDetail" resultType="PlmBmRoutingData"> SELECT a.Site,a.code_no,a.processDetail,a.supplyAdhesiveTape,a.routingDrawing,a.drawingRevison,a.drawingDate,a.workInfo,a.wiRevison,a.wiDate,a.routingRemark,a.routingAction, dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'reviewEngineer') reviewEngineer, dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'peEngineer') peEngineer, dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'cqe') cqe FROM plm_bm_routing a where a.site=#{site} and a.code_no=#{codeNo}</select>
<insert id="saveBMRoutingDetail"> insert into plm_bm_routing (Site,code_no,processDetail,supplyAdhesiveTape,routingDrawing,drawingRevison,drawingDate,workInfo,wiRevison,wiDate, routingRemark,routingAction,update_by,update_date) values (#{site},#{codeNo},#{processDetail},#{supplyAdhesiveTape},#{routingDrawing},#{drawingRevison},#{drawingDate},#{workInfo},#{wiRevison},#{wiDate}, #{routingRemark},#{routingAction},#{username},GetDate())</insert>
<update id="updateBMRoutingDetail"> update plm_bm_routing set processDetail=#{processDetail},supplyAdhesiveTape=#{supplyAdhesiveTape},routingDrawing=#{routingDrawing}, drawingRevison=#{drawingRevison},drawingDate=#{drawingDate},workInfo=#{workInfo},wiRevison=#{wiRevison},wiDate=#{wiDate}, routingRemark=#{routingRemark},routingAction=#{routingAction},update_by=#{username},update_date=GetDate() where site=#{site} and code_no=#{codeNo}</update>
<select id="checkPlmBmPropertiesValueHeaderData" resultType="PlmBmPropertiesValueHeaderData"> select Site,bu_no,PartNo,CodeNo,SubCodeSeqNo,SubCodeDesc,RecordType from plm_bm_propertiesValueHeader where PartNo=#{codeNo} and site=#{site} and CodeNo=#{type} and bu_no=#{buNo}</select>
<insert id="savePlmBmPropertiesValueHeaderData"> insert into plm_bm_propertiesValueHeader(Site,bu_no,PartNo,CodeNo,SubCodeSeqNo,SubCodeDesc,RecordType ) select #{site},#{buNo},#{codeNo},#{type},1,code_desc,'BM' from plm_bm_model_header where site=#{site} and bu_no=#{buNo} and function_type='BM' and code_no=#{type}</insert>
<insert id="savePlmBmPropertiesValueData"> insert into plm_bm_propertiesValue(Site,bu_no,PartNo,CodeNo,SubCodeSeqNo,SubCodeDesc,ItemNo,PropertiesItemNo,TextValue,NumValue,RecordType,order_id) select #{site},#{buNo},#{codeNo},#{type},1,b.code_desc,a.seq_no,a.properties_item_no,c.DefaultValue,null,'BM',a.order_id from plm_bm_model_header b left join plm_properties_model_detail a on a.site=#{site} and a.function_type='BM' and a.code_no=b.properties_code_no left join plm_properties_item c on a.properties_item_no=c.ItemNo and a.site=c.site and a.function_type=c.ItemType where b.site=#{site} and b.bu_no=#{buNo} and b.function_type='BM' and b.code_no=#{type} and a.code_no is not null</insert>
<select id="searchBMPropertiesValue" resultType="PlmBmPropertiesValueData"> select a.Site,a.bu_no,a.PartNo,a.CodeNo,a.SubCodeSeqNo,a.SubCodeDesc,a.ItemNo,a.PropertiesItemNo,a.TextValue,a.NumValue,a.RecordType,a.order_id,b.itemDesc,b.ValueType_DB,b.ValueChooseFlag from plm_bm_propertiesValue a left join plm_properties_item b on a.PropertiesItemNo=b.ItemNo and a.site=b.site and a.RecordType=b.ItemType where a.site=${site} and a.bu_no=#{buNo} and a.RecordType='BM' and a.CodeNo=#{type} and a.PartNo=#{codeNo} order by a.order_id</select>
<select id="getAvailableValueList" resultType="PlmPropertiesItemAvailableData"> select ItemNo,ValueNo,AvailableValue from plm_properties_item_available where itemNo=#{propertiesItemNo} and site=#{site} and ItemType='BM'</select>
<update id="updateBMPropertiesValue"> update plm_bm_propertiesValue set NumValue=#{numValue,jdbcType=DOUBLE} ,TextValue=#{textValue} where site=#{site} and bu_no=#{buNo} and PartNo=#{partNo} and RecordType=#{recordType} and SubCodeSeqNo=#{subCodeSeqNo} and PropertiesItemNo=#{propertiesItemNo}</update>
<select id="getBMPageBase" resultType="PlmBmPageBaseData"> select bu_no,code_no from plm_bm_model_header where bu_no=#{buNo} and site=#{site} and active='Y'</select>
<select id="searchBMRoute" resultType="com.spring.modules.part.vo.RoutingComponentVo"> SELECT a.site, a.part_no, a.routing_type, a.routing_revision, a.alternative_no, a.operation_id, a.operation_no, a.operation_name, a.efficiency_factor, a.mach_run_factor, a.mach_setup_time, a.run_time_code, a.labor_run_factor, a.labor_setup_time, a.crew_size, a.setup_crew_size, a.outside_op_item, a.machine_no, a.work_center_no, dbo.get_workCenter_desc(a.site, a.work_center_no) as workCenterDesc, a.labor_class_no, a.setup_labor_class_no, a.overlap, a.note_text as componentNoteText, b.itemType
FROM plm_routing_component a left join WorkCenter_BMType b on a.site=b.site and a.work_center_no=b.workCenterNo where a.site = #{site} and a.part_no =#{partNo} and a.routing_type = #{routingType} and a.routing_revision = #{routingRevision,jdbcType=INTEGER} and a.alternative_no = #{alternativeNo} order by operation_no</select>
<insert id="saveBMRoute"> insert into plm_bm_routing_detail (site,code_no,item_no,OperationDesc,remark,create_date,create_by) values(#{site},#{codeNo},#{itemNo},#{operationDesc},#{remark},GetDate(),#{username})</insert><update id="updateBMRoute"> update plm_bm_routing_detail set item_no=#{itemNo},OperationDesc=#{operationDesc} ,remark=#{remark},update_date=GetDate(),update_by=#{username} where id=#{id}</update>
<delete id="deleteBMRoute"> delete from plm_bm_routing_detail where id=#{id}</delete>
<select id="searchBMTPInfoDetail" resultType="PlmBmTpInfoDetailData"> select site,code_no,colourMatch,environment,eordValue,customerFile,laberSize,crossNumber,hp,rowNumber,vp,remark from plm_bm_tpInfoDetail where site=#{site} and code_no=#{codeNo}</select>
<insert id="saveBMTPInfoDetail"> insert into plm_bm_tpInfoDetail (site,code_no,colourMatch,environment,eordValue,customerFile,laberSize,crossNumber,hp,rowNumber,vp,remark,update_date,update_by) values(#{site},#{codeNo},#{colourMatch},#{environment},#{eordValue},#{customerFile},#{laberSize},#{crossNumber},#{hp},#{rowNumber},#{vp},#{remark},GetDate(),#{updateBy})</insert>
<update id="updateBMTPInfoDetail"> update plm_bm_tpInfoDetail set colourMatch=#{colourMatch},environment=#{environment},eordValue=#{eordValue},customerFile=#{customerFile}, laberSize=#{laberSize},crossNumber=#{crossNumber},hp=#{hp},rowNumber=#{rowNumber},vp=#{vp}, remark=#{remark},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}</update>
<select id="searchBMTPInfoColor" resultType="PlmBmTpInfoColorData"> select site,code_no,[order],color,inkType,colorRet,colorMatch,remark,filmNo,stencilNo,update_by,update_date,id from plm_bm_tpInfoColor where site=#{site} and code_no=#{codeNo} order by [order]</select>
<insert id="saveBMTPInfoColor"> insert into plm_bm_tpInfoColor (site,code_no,[order],color,inkType,colorRet,colorMatch,remark,filmNo,stencilNo,update_by,update_date) values(#{site},#{codeNo},#{order},#{color},#{inkType},#{colorRet},#{colorMatch},#{remark},#{filmNo},#{stencilNo},#{updateBy},GetDate())</insert>
<update id="updateBMTPInfoColor"> update plm_bm_tpInfoColor set [order]=#{order},color=#{color},inkType=#{inkType},colorRet=#{colorRet}, colorMatch=#{colorMatch},remark=#{remark},filmNo=#{filmNo},stencilNo=#{stencilNo}, update_date=GetDate(),update_by=#{updateBy} where id=#{id}</update>
<delete id="deleteBMTPInfoColor"> delete from plm_bm_tpInfoColor where id=#{id}</delete>
<select id="checkPlmBmTpInfoColorOrder" resultType="PlmBmTpInfoColorData"> select site from plm_bm_tpInfoColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}</select>
<select id="searchBMTPInfoCut" resultType="PlmBmTpInfoCutData"> select site,code_no,[order],cuttingMachine,cuttingType,cutterTooling,cutterLayout,cutterCost,p2c,c2c,cutterNo,update_date,update_by,id from plm_bm_tpInfoCut where site=#{site} and code_no=#{codeNo} order by [order]</select>
<insert id="saveBMTPInfoCut"> insert into plm_bm_tpInfoCut (site,code_no,[order],cuttingMachine,cuttingType,cutterTooling,cutterLayout,cutterCost,p2c,c2c,cutterNo,update_date,update_by) values(#{site},#{codeNo},#{order},#{cuttingMachine},#{cuttingType},#{cutterTooling},#{cutterLayout},#{cutterCost},#{p2c},#{c2c},#{cutterNo},GetDate(),#{updateBy})</insert>
<update id="updateBMTPInfoCut"> update plm_bm_tpInfoCut set [order]=#{order},cuttingMachine=#{cuttingMachine},cuttingType=#{cuttingType},cutterTooling=#{cutterTooling}, cutterLayout=#{cutterLayout},cutterCost=#{cutterCost},p2c=#{p2c},c2c=#{c2c},cutterNo=#{cutterNo}, update_date=GetDate(),update_by=#{updateBy} where id=#{id}</update>
<select id="checkPlmBmTpInfoCutOrder" resultType="PlmBmTpInfoCutData"> select site from plm_bm_tpInfoCut where site=#{site} and code_no=#{codeNo} and [order]=#{order}</select>
<delete id="deleteBMTPInfoCut"> delete from plm_bm_tpInfoCut where id=#{id}</delete>
<select id="searchBMPrepressDetail" resultType="PlmBmPrepressData"> select Site,code_no,plateNo,cutterNumber,cutterLayout,[action],remark,feedback,update_by,update_date from plm_bm_prepress where site=#{site} and code_no=#{codeNo}</select>
<insert id="saveBMPrepressDetail"> insert into plm_bm_prepress (Site,code_no,plateNo,cutterNumber,cutterLayout,[action],remark,feedback,update_by,update_date) values(#{site},#{codeNo},#{plateNo},#{cutterNumber},#{cutterLayout},#{action},#{remark},#{feedback},#{updateBy},GetDate())</insert>
<update id="updateBMPrepressDetail"> update plm_bm_prepress set plateNo=#{plateNo},cutterNumber=#{cutterNumber},cutterLayout=#{cutterLayout},[action]=#{action}, remark=#{remark},feedback=#{feedback},update_by=#{updateBy},update_date=GetDate() where site=#{site} and code_no=#{codeNo}</update>
<select id="searchBMPrepressColor" resultType="PlmBmPrepressColorData"> select site,code_no,[order],meshModel,meshSize,angle,coatingType,filmNo,stencilNo,color,update_by,update_date from plm_bm_PrepressColor where site=#{site} and code_no=#{codeNo} order by [order]</select>
<insert id="saveBMPrepressColor"> insert into plm_bm_PrepressColor (site,code_no,[order],meshModel,meshSize,angle,coatingType,filmNo,stencilNo,color,update_by,update_date) values(#{site},#{codeNo},#{order},#{meshModel},#{meshSize},#{angle},#{coatingType},#{filmNo},#{stencilNo},#{color},#{updateBy},GetDate())</insert>
<update id="updateBMPrepressColor"> update plm_bm_PrepressColor set [order]=#{order},color=#{color},meshModel=#{meshModel},meshSize=#{meshSize}, angle=#{angle},coatingType=#{coatingType},filmNo=#{filmNo},stencilNo=#{stencilNo}, update_date=GetDate(),update_by=#{updateBy} where id=#{id}</update>
<delete id="deleteBMPrepressColor"> delete from plm_bm_PrepressColor where id=#{id}</delete>
<select id="checkPlmBmPrepressColorOrder" resultType="PlmBmPrepressColorData"> select site from plm_bm_PrepressColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}</select>
<select id="searchBMPrintOtherDetail" resultType="PlmBmPrintOtherData"> select site,code_no,remark,[action],update_date,update_by,id from plm_bm_PrintOther where site=#{site} and code_no=#{codeNo}</select>
<insert id="saveBMPrintOtherDetail"> insert into plm_bm_PrintOther (site,code_no,remark,[action],update_date,update_by) values(#{site},#{codeNo},#{remark},#{action},GetDate(),#{updateBy})</insert>
<update id="updateBMPrintOtherDetail"> update plm_bm_PrintOther set remark=#{remark},[action]=#{action} where site=#{site} and code_no=#{codeNo}</update>
<select id="searchBMPrintOtherColor" resultType="PlmBmPrintOtherColorData"> select site,code_no,[order],seqNo,ink,[type],otherRef,update_date,update_by from plm_bm_PrintOtherColor where site=#{site} and code_no=#{codeNo} order by [order] ,seqNo</select>
<insert id="saveBMPrintOtherColor"> insert into plm_bm_PrintOtherColor (site,code_no,[order],seqNo,ink,[type],otherRef,update_by,update_date) values(#{site},#{codeNo},#{order},#{seqNo},#{ink},#{type},#{otherRef},#{updateBy},GetDate())</insert>
<update id="updateBMPrintOtherColor"> update plm_bm_PrintOtherColor set [order]=#{order},seqNo=#{seqNo},ink=#{ink},[type]=#{type}, otherRef=#{otherRef}, update_date=GetDate(),update_by=#{updateBy} where id=#{id}</update>
<delete id="deleteBMPrintOtherColor"> delete from plm_bm_PrintOtherColor where id=#{id}</delete>
<select id="checkPlmBmPrintOtherColorOrder" resultType="PlmBmPrintOtherColorData"> select site from plm_bm_PrintOtherColor where site=#{site} and code_no=#{codeNo} and [order]=#{order} and seqNo=#{seqNo}</select>
<update id="updateBMModal"> update plm_bm_model_header set properties_code_no=#{propertiesCodeNo} ,active=#{active} where site=#{site} and bu_no=#{buNo} and code_no=#{codeNo}</update>
<select id="checkBMModelHeader" resultType="PlmBmModelHeaderData"> select properties_code_no from plm_bm_model_header where site=#{site} and bu_no=#{buNo} and code_no=#{type}</select>
<select id="searchBMPropertiesHeaderForBM" resultType="PlmBmModelHeaderData"> select properties_code_no from plm_bm_model_header where site=#{site} and bu_no=#{buNo} and code_no=#{type}</select>
<!-- Ink Mixing 油墨房-->
<select id="searchBMInkMixingDetail" resultType="PlmBmInkMixingData"> select site,code_no,colourMatch,visuallySetting,indicate,customerFile,remarks,[action],update_date,update_by from plm_bm_InkMixing where site=#{site} and code_no=#{codeNo}</select>
<insert id="saveBMInkMixingDetail"> insert into plm_bm_InkMixing (site,code_no,colourMatch,visuallySetting,indicate,customerFile,remarks,[action],update_date,update_by) values(#{site},#{codeNo},#{colourMatch},#{visuallySetting},#{indicate},#{customerFile},#{remarks},#{action},GetDate(),#{updateBy})</insert>
<update id="updateBMInkMixingDetail"> update plm_bm_InkMixing set colourMatch=#{colourMatch},visuallySetting=#{visuallySetting},indicate=#{indicate} ,customerFile=#{customerFile},[action]=#{action},remarks=#{remarks},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}</update>
<select id="searchBMInkMixingColor" resultType="PlmBmInkMixingColorData"> select site,code_no,[order],color,[type],supplier,inkUsage,mixTime,standbyTime,Viscosity,RecycleTimes,update_by,update_date,id
from plm_bm_InkMixingColor where site=#{site} and code_no=#{codeNo} order by [order]</select>
<insert id="saveBMInkMixingColor"> insert into plm_bm_InkMixingColor (site,code_no,[order],color,[type],supplier,inkUsage,mixTime,standbyTime,Viscosity,RecycleTimes,update_by,update_date) values(#{site},#{codeNo},#{order},#{color},#{type},#{supplier},#{inkUsage},#{mixTime},#{standbyTime},#{viscosity},#{recycleTimes},#{updateBy},GetDate())</insert>
<update id="updateBMInkMixingColor"> update plm_bm_InkMixingColor set [order]=#{order},color=#{color},[type]=#{type},supplier=#{supplier},inkUsage=#{inkUsage}, mixTime=#{mixTime},standbyTime=#{standbyTime},Viscosity=#{viscosity},RecycleTimes=#{recycleTimes}, update_date=GetDate(),update_by=#{updateBy} where id=#{id}</update>
<delete id="deleteBMInkMixingColor"> delete from plm_bm_InkMixingColor where id=#{id}</delete>
<select id="checkPlmBmInkMixingColorOrder" resultType="PlmBmInkMixingColorData"> select site from plm_bm_InkMixingColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}</select>
<!-- Ink Formulation 油墨配方-->
<select id="searchBMInkFormulationDetail" resultType="PlmBmInkFormulationData"> select Site,code_no,remarks,label_size,qpa,[action],[cross],row,hp,vp,update_date,update_by from plm_bm_InkFormulation where site=#{site} and code_no=#{codeNo}</select>
<insert id="saveBMInkFormulationDetail"> insert into plm_bm_InkFormulation (Site,code_no,remarks,label_size,qpa,[action],[cross],row,hp,vp,update_date,update_by) values(#{site},#{codeNo},#{remarks},#{labelSize},#{qpa},#{action},#{cross},#{row},#{hp},#{vp},GetDate(),#{updateBy})</insert>
<update id="updateBMInkFormulationDetail"> update plm_bm_InkFormulation set remarks=#{remarks},label_size=#{labelSize},qpa=#{qpa},[action]=#{action},[cross]=#{cross} ,row=#{row},[hp]=#{hp},vp=#{vp},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}</update>
<select id="searchBMInkFormulationColor" resultType="PlmBmInkFormulationColorData"> select site,code_no,[order],hardness,tartness,printingSide,energy,dry_speed,dry_time,dry_temp,dry_time2,update_date,update_by,id
from plm_bm_InkFormulationColor where site=#{site} and code_no=#{codeNo} order by [order]</select>
<insert id="saveBMInkFormulationColor"> insert into plm_bm_InkFormulationColor (site,code_no,[order],hardness,tartness,printingSide,energy,dry_speed,dry_time,dry_temp,dry_time2,update_date,update_by) values(#{site},#{codeNo},#{order},#{hardness},#{tartness},#{printingSide},#{energy},#{drySpeed},#{dryTime},#{dryTemp},#{dryTime2},GetDate(),#{updateBy})</insert>
<update id="updateBMInkFormulationColor"> update plm_bm_InkFormulationColor set [order]=#{order},hardness=#{hardness},[tartness]=#{tartness},printingSide=#{printingSide},energy=#{energy}, dry_speed=#{drySpeed},dry_time=#{dryTime},dry_temp=#{dryTemp},dry_time2=#{dryTime2}, update_date=GetDate(),update_by=#{updateBy} where id=#{id}</update>
<delete id="deleteBMInkFormulationColor"> delete from plm_bm_InkFormulationColor where id=#{id}</delete>
<select id="checkPlmBmInkFormulationColorOrder" resultType="PlmBmInkFormulationColorData"> select site from plm_bm_InkFormulationColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}</select>
<!-- Lamination 覆膜 -->
<select id="searchBMLaminationDetail" resultType="PlmBmLaminationData"> select site,code_no,[action],update_date,update_by,remark from plm_bm_Lamination where site=#{site} and code_no=#{codeNo}</select>
<insert id="saveBMLaminationDetail"> insert into plm_bm_Lamination (site,code_no,[action],update_date,update_by,remark) values(#{site},#{codeNo},#{action},GetDate(),#{updateBy},#{remark})</insert>
<update id="updateBMLaminationDetail"> update plm_bm_Lamination set remark=#{remark},[action]=#{action}, update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}</update>
<select id="searchBMLaminationCut" resultType="PlmBmLaminationCutData"> select site,code_no,[order],station,processStep,machine,laminationType,rm_partNo,rm_partNo2,film_partNo,lamination_side,remarks,update_date,update_by,id
from plm_bm_LaminationCut where site=#{site} and code_no=#{codeNo} order by [order]</select>
<insert id="saveBMLaminationCut"> insert into plm_bm_LaminationCut (site,code_no,[order],station,processStep,machine,laminationType,rm_partNo,rm_partNo2,film_partNo,lamination_side,remarks, update_date,update_by) values(#{site},#{codeNo},#{order},#{station},#{processStep},#{machine},#{laminationType},#{rmPartNo},#{rmPartNo2},#{filmPartNo},#{laminationSide},#{remarks}, GetDate(),#{updateBy})</insert>
<update id="updateBMLaminationCut"> update plm_bm_LaminationCut set [order]=#{order},station=#{station},[processStep]=#{processStep},machine=#{machine},laminationType=#{laminationType}, rm_partNo=#{rmPartNo},rm_partNo2=#{rmPartNo2},film_partNo=#{filmPartNo},lamination_side=#{laminationSide},remarks=#{remarks}, update_date=GetDate(),update_by=#{updateBy} where id=#{id}</update>
<delete id="deleteBMLaminationCut"> delete from plm_bm_LaminationCut where id=#{id}</delete>
<select id="checkPlmBmLaminationCutOrder" resultType="PlmBmLaminationCutData"> select site from plm_bm_LaminationCut where site=#{site} and code_no=#{codeNo} and [order]=#{order}</select>
<!-- Cnc -->
<select id="searchBMCncDetail" resultType="PlmBmCncData"> select site,code_no,[action],update_date,update_by from plm_bm_Cnc where site=#{site} and code_no=#{codeNo}</select>
<insert id="saveBMCncDetail"> insert into plm_bm_Cnc (site,code_no,[action],update_date,update_by) values(#{site},#{codeNo},#{action},GetDate(),#{updateBy})</insert>
<update id="updateBMCncDetail"> update plm_bm_Cnc set [action]=#{action}, update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}</update>
<select id="searchBMCncCut" resultType="PlmBmCncCutData"> select site,code_no,[order],cutting_machine,program_name,cutting_speed,spec,p2c,c2c,remarks,update_date,update_by,id
from plm_bm_CncCut where site=#{site} and code_no=#{codeNo} order by [order]</select>
<insert id="saveBMCncCut"> insert into plm_bm_CncCut (site,code_no,[order],cutting_machine,program_name,cutting_speed,spec,p2c,c2c,remarks,update_date,update_by) values(#{site},#{codeNo},#{order},#{cuttingMachine},#{programName},#{cuttingSpeed},#{spec},#{p2c},#{c2c},#{remarks}, GetDate(),#{updateBy})</insert>
<update id="updateBMCncCut"> update plm_bm_CncCut set [order]=#{order},cutting_machine=#{cuttingMachine},[program_name]=#{programName},cutting_speed=#{cuttingSpeed},spec=#{spec}, p2c=#{p2c},c2c=#{c2c},remarks=#{remarks}, update_date=GetDate(),update_by=#{updateBy} where id=#{id}</update>
<delete id="deleteBMCncCut"> delete from plm_bm_CncCut where id=#{id}</delete>
<select id="checkPlmBmCncCutOrder" resultType="PlmBmCncCutData"> select site from plm_bm_CncCut where site=#{site} and code_no=#{codeNo} and [order]=#{order}</select>
<!-- Cut -->
<select id="searchBMCutDetail" resultType="PlmBmCutData"> select site,code_no,[action],remarks,update_date,update_by from plm_bm_Cut where site=#{site} and code_no=#{codeNo}</select>
<insert id="saveBMCutDetail"> insert into plm_bm_Cut (site,code_no,[action],update_date,update_by,remarks) values(#{site},#{codeNo},#{action},GetDate(),#{updateBy},#{remarks})</insert>
<update id="updateBMCutDetail"> update plm_bm_Cut set [action]=#{action},remarks=#{remarks}, update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}</update>
<select id="searchBMCutCut" resultType="PlmBmCutCutData"> select site,code_no,[order],cutting_machine,cutting_type,cutting_tooling,cutter_no,cutter_layout,cutter_cost,program_name,program_path,p2c,c2c,update_by,update_date,id from plm_bm_CutCut where site=#{site} and code_no=#{codeNo} order by [order]</select>
<insert id="saveBMCutCut"> insert into plm_bm_CutCut (site,code_no,[order],cutting_machine,cutting_type,cutting_tooling,cutter_no,cutter_layout,cutter_cost,program_name,program_path,p2c,c2c,update_by,update_date) values(#{site},#{codeNo},#{order},#{cuttingMachine},#{cuttingType},#{cuttingTooling},#{cutterNo},#{cutterLayout},#{cutterCost},#{programName}, #{programPath},#{p2c},#{c2c},#{updateBy},GetDate())</insert>
<update id="updateBMCutCut"> update plm_bm_CutCut set [order]=#{order},cutting_machine=#{cuttingMachine},[cutting_type]=#{cuttingType},cutting_tooling=#{cuttingTooling},cutter_no=#{cutterNo}, cutter_layout=#{cutterLayout},cutter_cost=#{cutterCost},program_name=#{programName}, p2c=#{p2c},c2c=#{c2c},program_path=#{programPath}, update_date=GetDate(),update_by=#{updateBy} where id=#{id}</update>
<delete id="deleteBMCutCut"> delete from plm_bm_CutCut where id=#{id}</delete>
<select id="checkPlmBmCutCutOrder" resultType="PlmBmCutCutData"> select site from plm_bm_CutCut where site=#{site} and code_no=#{codeNo} and [order]=#{order}</select>
<!-- printing 印刷-->
<select id="searchBMPrintingDetail" resultType="PlmBmPrintingData"> select site,code_no,colour_match,conditions,colour_indicat,customer_file,glossiness_requirement,comments,repeat,vp,label_size,down,plate_distortion_rate,actual_number,print_position,goods_roll_width,update_date,update_by,printLayout from plm_bm_Printing where site=#{site} and code_no=#{codeNo}</select>
<insert id="saveBMPrintingDetail"> insert into plm_bm_Printing (site,code_no,colour_match,conditions,colour_indicat,customer_file,glossiness_requirement,comments,repeat,vp,label_size,down,plate_distortion_rate,actual_number,print_position,goods_roll_width,update_date,update_by,printLayout) values(#{site},#{codeNo},#{colourMatch},#{conditions},#{colourIndicat},#{customerFile},#{glossinessRequirement},#{comments}, #{repeat},#{vp},#{labelSize},#{down},#{plateDistortionRate},#{actualNumber},#{printPosition},#{goodsRollWidth}, GetDate(),#{updateBy},#{printLayout})</insert>
<update id="updateBMPrintingDetail"> update plm_bm_Printing set printLayout=#{printLayout},colour_match=#{colourMatch},conditions=#{conditions},colour_indicat=#{colourIndicat},customer_file=#{customerFile},glossiness_requirement=#{glossinessRequirement},comments=#{comments}, repeat=#{repeat},vp=#{vp},label_size=#{labelSize},down=#{down},plate_distortion_rate=#{plateDistortionRate},actual_number=#{actualNumber},print_position=#{printPosition},goods_roll_width=#{goodsRollWidth},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}</update>
<select id="searchBMPrintingColor" resultType="PlmBmPrintingColorData"> select site,code_no,[order],ink_type,color_reference,color_match,bcm,speed,dry,gallus,mark_andy,lp,Hexiang,update_date,update_by,id
from plm_bm_PrintingColor where site=#{site} and code_no=#{codeNo} order by [order]</select>
<insert id="saveBMPrintingColor"> insert into plm_bm_PrintingColor (site,code_no,[order],ink_type,color_reference,color_match,bcm,speed,dry,gallus,mark_andy,lp,Hexiang,update_by,update_date) values(#{site},#{codeNo},#{order},#{inkType},#{colorReference},#{colorMatch},#{bcm},#{speed},#{dry},#{gallus},#{markAndy},#{lp},#{hexiang},#{updateBy},GetDate())</insert>
<update id="updateBMPrintingColor"> update plm_bm_PrintingColor set [order]=#{order},ink_type=#{inkType},[color_reference]=#{colorReference},color_match=#{colorMatch},bcm=#{bcm}, speed=#{speed},dry=#{dry},gallus=#{gallus},mark_andy=#{markAndy},lp=#{lp},Hexiang=#{hexiang}, update_date=GetDate(),update_by=#{updateBy} where id=#{id}</update>
<delete id="deleteBMPrintingColor"> delete from plm_bm_PrintingColor where id=#{id}</delete>
<select id="checkPlmBmPrintingColorOrder" resultType="PlmBmPrintingColorData"> select site from plm_bm_PrintingColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}</select>
<select id="getBomNowRevNo" resultType="com.spring.modules.part.entity.BomHeaderEntity"> select top 1 eng_chg_level,bom_type,site,part_no from plm_bom_header where site=#{site} and part_no=#{partNo} and GetDate()>eff_phase_in_date and isnull(eff_phase_out_date, DATEADD(d, 1, GETDATE())) >GetDate()</select>
<select id="getTopOneBomAlternativeNo" resultType="com.spring.modules.part.entity.BomDetailEntity"> select top 1 site,part_no,alternative_no,alternative_description,bom_type,eng_chg_level from plm_bom_detail where site=#{site} and part_no=#{partNo} and bom_type=#{bomType} and eng_chg_level=#{engChgLevel}</select>
<select id="getRouteNowRevNo" resultType="com.spring.modules.part.entity.RoutingHeaderEntity"> select top 1 site,part_no,routing_revision,routing_type from plm_routing_header where site=#{site} and part_no=#{partNo} and GetDate()>phase_in_date and isnull(phase_out_date, DATEADD(d, 1, GETDATE())) >GetDate()</select><select id="getTopOneRouteAlternativeNo" resultType="com.spring.modules.part.entity.RoutingDetailEntity"> select top 1 site,part_no,routing_revision,routing_type,alternative_no,alternative_description from plm_routing_detail where site=#{site} and part_no=#{partNo} and routing_type=#{routingType} and routing_revision=#{routingRevision}</select><select id="getBMBomDetail" resultType="com.spring.modules.part.entity.BomDetailEntity"> select a.site,a.bom_type,a.eng_chg_level,a.bom_alternative_no alternativeNo,b.final_part_no partNo from plm_technical_specification_sheet a left join view_Project_Part b on a.site=b.site and a.test_part_no=b.test_part_no where a.site=#{site} and a.code_no=#{codeNo}</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_Part b on a.site=b.site and a.test_part_no=b.test_part_no where a.site=#{site} and a.code_no=#{codeNo}</select>
<select id="searchBMBomDetail" resultType="com.spring.modules.part.vo.BomDetailVo"> select a.site,a.part_no,a.alternative_no,a.alternative_description,a.bom_type,a.eng_chg_level,a.min_lot_qty,a.default_flag, a.note_text,a.create_date,a.create_by,a.update_date,a.update_by,a.status,a.official_flag,B.eff_phase_in_date,B.eff_phase_out_date from plm_bom_detail a left join plm_bom_header b on a.site=b.site and a.part_no=b.part_NO AND A.eng_chg_level=B.eng_chg_level where a.part_no=#{partNo} and a.site=#{site} and a.bom_type!='Repair'</select><update id="updateBMBomRev"> update plm_technical_specification_sheet set bom_type=#{bomType},eng_chg_level=#{engChgLevel,jdbcType=INTEGER}, bom_alternative_no=#{bomAlternativeNo} where site=#{site} and code_no=#{codeNo}</update><update id="updateBMRouteRev"> update plm_technical_specification_sheet set routing_type=#{routingType},routing_revision=#{routingRevision,jdbcType=INTEGER}, routing_alternative_no=#{routingAlternativeNo} where site=#{site} and code_no=#{codeNo}</update>
<select id="searchRouteDetail" resultType="com.spring.modules.part.vo.RoutingDetailVo"> select a.site,a.part_no,a.routing_revision,a.routing_type,a.alternative_no,a.alternative_description,a.status,a.official_flag,b.phase_in_date,b.phase_out_date from plm_routing_detail a left join plm_routing_header b on a.site=b.site and a.part_no=b.part_NO AND A.routing_revision=B.routing_revision where a.site=#{site} and a.part_no=#{partNo} and a.routing_type!='Repair'</select>
<select id="searchBMRemarkPage" resultType="PlmTechnicalSpecificationSheetData"> select site,remarkPage,code_no from plm_technical_specification_sheet where site=#{site} and code_no=#{codeNo}</select><update id="updateBMRemarkPage"> update plm_technical_specification_sheet set remarkPage=#{remarkPage} where site=#{site} and code_no=#{codeNo}</update>
<select id="searchPartLastQuotationNo" resultType="com.spring.modules.quotation.entity.QuotationHeader"> select top 1 a.site,a.quotation_no from quotation_header a left join quotation_detail b on a.quotation_header_id=b.quotation_header_id where b.site=#{site} and b.product_no=#{productNo} order by a.create_time desc</select>
<select id="getSysProxyAddress" resultType="SysProxyAddress"> select physicalAddress,proxyAddress,remark from sys_proxy_address
</select>
<select id="searchBMprintFlexoColor" resultType="PlmBmPrintFlexoColorData"> select id,site,codeNo,printSide,[order],colorReference,inkCode,colorMatch,lpi,bcm,openFlag,gallus,markAndy,hexiang,temperature,pressure,updateDate,updateBy from plm_bm_printFlexoColor where site=#{site} and codeNo=#{codeNo} order by printSide desc,[order]</select>
<select id="checkBMprintFlexoColorOrder" resultType="PlmBmPrintFlexoColorData"> select id,site,codeNo,printSide,[order] from plm_bm_printFlexoColor where site=#{site} and codeNo=#{codeNo} and printSide=#{printSide} and [order]=#{order}
</select>
<insert id="saveBMprintFlexoColor" > insert into plm_bm_printFlexoColor(site,codeNo,printSide,[order],colorReference,inkCode,colorMatch,lpi,bcm,openFlag,gallus,markAndy,hexiang,temperature,pressure,updateDate,updateBy,remark) values (#{site},#{codeNo},#{printSide},#{order},#{colorReference},#{inkCode},#{colorMatch},#{lpi},#{bcm},#{openFlag},#{gallus}, #{markAndy},#{hexiang},#{temperature},#{pressure},GetDate(),#{updateBy},#{remark})</insert>
<update id="updateBMprintFlexoColor" > update plm_bm_printFlexoColor set printSide=#{printSide},[order]=#{order,jdbcType=INTEGER},colorReference=#{colorReference},inkCode=#{inkCode}, colorMatch=#{colorMatch},lpi=#{lpi},bcm=#{bcm},openFlag=#{openFlag},gallus=#{gallus},markAndy=#{markAndy},hexiang=#{hexiang},temperature=#{temperature}, pressure=#{pressure},updateDate=GetDate(),updateBy=#{updateBy},remark=#{remark} where id=#{id}</update>
<delete id="deleteBMprintFlexoColor"> delete from plm_bm_printFlexoColor where id=#{id}</delete>
<select id="searchBMprintIndigoColor" resultType="PlmBmPrintIndigoColorData"> select id,code_no,site,[order],printSide,colorReference,inkCode,colorMatch,printMotion,opticalDensity,lut,lpi,screenAngle,printHits, blanketTemperture,remark,updateBy,updateDate from plm_bm_printIndigoColor where site=#{site} and code_no=#{codeNo} order by printSide desc,[order]</select>
<select id="checkBMprintIndigoColorOrder" resultType="PlmBmPrintIndigoColorData"> select id,site,code_no,printSide,[order] from plm_bm_printIndigoColor where site=#{site} and code_no=#{codeNo} and printSide=#{printSide} and [order]=#{order}</select>
<insert id="saveBMprintIndigoColor" > insert into plm_bm_printIndigoColor(site,code_no,[order],printSide,colorReference,inkCode,colorMatch,printMotion,opticalDensity,lut,lpi,screenAngle,printHits, blanketTemperture,remark,updateBy,updateDate) values (#{site},#{codeNo},#{order},#{printSide},#{colorReference},#{inkCode},#{colorMatch},#{printMotion},#{opticalDensity},#{lut},#{lpi}, #{screenAngle},#{printHits},#{blanketTemperture},#{remark},#{updateBy},GetDate())</insert>
<update id="updateBMprintIndigoColor" > update plm_bm_printIndigoColor set printSide=#{printSide},[order]=#{order,jdbcType=INTEGER},colorReference=#{colorReference},inkCode=#{inkCode}, colorMatch=#{colorMatch},printMotion=#{printMotion},opticalDensity=#{opticalDensity},lut=#{lut},lpi=#{lpi},screenAngle=#{screenAngle},printHits=#{printHits},blanketTemperture=#{blanketTemperture}, remark=#{remark},updateDate=GetDate(),updateBy=#{updateBy} where id=#{id}</update>
<delete id="deleteBMprintIndigoColor"> delete from plm_bm_printIndigoColor where id=#{id}</delete>
<select id="selectTechnicalSpecification" resultType="PlmTechnicalSpecificationSheet"> SELECT id,site,code_no,proofing_no,project_id,test_part_no,status,rev_no,work_center_no,ECN_flag,ECN_no,ECN_address,remark,create_date,create_by,update_date,update_by,picture_addess,customerPictureChangeRemark,productionFileComments,ori_code_no,bom_type,eng_chg_level,bom_alternative_no,routing_type,routing_revision,routing_alternative_no,remarkPage,process,stage,materialType,cqcOperator,faiOperator,overPrintOperator,printOperator,peOperater,csOperater,dccOperater,step_id,reject_flag,reject_step_id,mpOperator 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></mapper>
|