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.

930 lines
50 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.spring.modules.sampleManagement.dao.TechnicalSpecificationMapper">
  4. <select id="technicalSpecificationListSearch" parameterType="PlmTechnicalSpecificationSheetData" resultType="PlmTechnicalSpecificationSheetData">
  5. 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,
  6. 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,
  7. b.part_type,b.part_name,b.part_desc,b.part_spec,dbo.plm_get_technicalBaseDesc(a.status,'status') statusDesc,a.proofing_no,c.bu_no,dbo.plm_get_bu_desc(a.site,c.bu_no) buDesc,
  8. dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'engineer') engineer,
  9. dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'technician') technician,process,
  10. dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'quotationOfficer') quotationOfficer,c.customer_Id
  11. ,a.picture_addess,a.customerPictureChangeRemark,a.productionFileComments,a.bom_type,a.eng_chg_level,a.bom_alternative_no,a.routing_type,a.routing_revision,
  12. a.routing_alternative_no,a.pod,
  13. a.mpOperator,dbo.get_userDisPlay(a.mpOperator) mpOperatorName
  14. FROM plm_technical_specification_sheet a
  15. 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
  16. left join plm_project_info c on a.site=c.site and a.project_id=c.project_id
  17. <where>
  18. <if test="query.id != null">
  19. AND a.id = #{query.id}
  20. </if>
  21. <if test="query.site != null and query.site != ''">
  22. AND a.site = #{query.site}
  23. </if>
  24. <if test="query.oriCodeNo != null and query.oriCodeNo != ''">
  25. AND a.ori_code_no like #{query.oriCodeNo}
  26. </if>
  27. <if test="query.codeNo != null and query.codeNo != ''">
  28. AND a.code_no like #{query.codeNo}
  29. </if>
  30. <if test="query.projectId != null and query.projectId != ''">
  31. AND a.project_id like #{query.projectId}
  32. </if>
  33. <if test="query.testPartNo != null and query.testPartNo != ''">
  34. AND a.test_part_no like #{query.testPartNo}
  35. </if>
  36. <if test="query.statusDesc != null and query.statusDesc != ''">
  37. AND dbo.plm_get_technicalBaseDesc(a.status,'status') like #{query.statusDesc}
  38. </if>
  39. </where>
  40. order by a.code_no desc
  41. </select>
  42. <insert id="saveTechnicalSpecificationSheet">
  43. insert into plm_technical_specification_sheet(site,code_no,project_id,test_part_no,status,rev_no,ECN_flag,ECN_no,ECN_address,remark,
  44. 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) values (#{site},#{codeNo},#{projectId},#{testPartNo},#{status},#{revNo},#{ecnFlag},#{ecnNo},#{ecnAddress}
  45. ,#{remark},GetDate(),#{createBy},#{proofingNo},#{oriCodeNo},#{bomType},#{engChgLevel,jdbcType=INTEGER},#{bomAlternativeNo},#{routingType},#{routingRevision,jdbcType=INTEGER},#{routingAlternativeNo},'Sample','Label',10)
  46. </insert>
  47. <insert id="saveTechnicalSpecificationTeams">
  48. insert into plm_technicalSpecification_team (site,code_no,operator_id,type)
  49. values (#{site},#{codeNo},#{operatorId},#{type})
  50. </insert>
  51. <update id="updateTechnicalSpecificationSheet">
  52. update plm_technical_specification_sheet set project_id=#{projectId},test_part_no=#{testPartNo},status=#{status}
  53. ,rev_no=#{revNo},ECN_no=#{ecnNo},ECN_flag=#{ecnFlag},ECN_address=#{ecnAddress},remark=#{remark},update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  54. </update>
  55. <delete id="deleteTechnicalSpecificationTeamsForBase">
  56. delete from plm_technicalSpecification_team where site=#{site} and code_no=#{codeNo} and type in ('quotationOfficer','engineer','technician')
  57. </delete>
  58. <delete id="deleteTechnicalSpecificationTeamsForDetail">
  59. delete from plm_technicalSpecification_team where site=#{site} and code_no=#{codeNo} and type in ('reviewEngineer','peEngineer','cqe')
  60. </delete>
  61. <select id="searchTechnicalSpecificationTeamStr" resultType="String">
  62. select operator_id from plm_technicalSpecification_team where type=#{type} and site=#{site} and code_no=#{codeNo}
  63. </select>
  64. <select id="getTechnicalCustomerInfoData" resultType="TechnicalCustomerInfoData">
  65. select a.id,b.customer_id,c.customer_desc as customerName,c.customer_description as customerDesc ,b.customer_Remark,b.remark,
  66. a.picture_addess,a.customerPictureChangeRemark,a.productionFileComments
  67. from plm_technical_specification_sheet a
  68. left join plm_project_info b on a.site=b.site and a.project_id=b.project_id
  69. left join plm_customer_information c on b.site=c.site and b.customer_id=c.customer_no where a.id=#{id}
  70. </select>
  71. <select id="tsdBasicInformationSearch" resultType="PlmTechnicalSpecificationSheetData">
  72. 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,c.bu_no,
  73. 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,
  74. b.part_type,b.part_name,b.part_desc,b.part_spec,dbo.plm_get_technicalBaseDesc(a.status,'status') statusDesc,a.proofing_no,
  75. dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'engineer') engineer,stage,process,remarkPage,
  76. dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'quotationOfficer') quotationOfficer,c.customer_Id,a.ori_code_no,
  77. a.cqcOperator, a.faiOperator,dbo.get_userDisPlay(a.cqcOperator) cqcOperatorName,dbo.get_userDisPlay(a.faiOperator) faiOperatorName
  78. ,a.overPrintOperator, a.printOperator,dbo.get_userDisPlay(a.overPrintOperator) overPrintOperatorName,dbo.get_userDisPlay(a.printOperator) printOperatorName
  79. ,a.peOperater,dbo.get_userDisPlay(a.peOperater) peOperaterName
  80. ,a.csOperater,dbo.get_userDisPlay(a.csOperater) csOperaterName
  81. ,a.dccOperater,dbo.get_userDisPlay(a.dccOperater) dccOperaterName,isnull(a.step_id,10) stepId,d.is_reject,a.pod,
  82. a.mpOperator,dbo.get_userDisPlay(a.mpOperator) mpOperatorName
  83. ,dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'technician') technician
  84. FROM plm_technical_specification_sheet a
  85. 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
  86. left join plm_project_info c on a.site=c.site and a.project_id=c.project_id
  87. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'
  88. 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
  89. where a.site=#{site} and a.code_no=#{codeNo}
  90. </select>
  91. <delete id="deleteTechnicalSpecificationList">
  92. delete from plm_technical_specification_sheet where id=#{id}
  93. </delete>
  94. <update id="updateBMProcess">
  95. update plm_technical_specification_sheet set process=#{process},overPrintOperator=#{overPrintOperator},printOperator=#{printOperator} where site=#{site} and code_no=#{codeNo}
  96. </update>
  97. <select id="getTestPartChangeData" resultType="PlmProjectPartData">
  98. select top 1 * from view_Project_Part where site=#{site} and test_part_no=#{testPartNo}
  99. </select>
  100. <select id="BMBasicInformationSearch" resultType="PlmTechnicalSpecificationSheetData">
  101. 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,
  102. 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,
  103. b.part_type,b.part_name,b.part_desc,b.part_spec,dbo.plm_get_technicalBaseDesc(a.status,'status') statusDesc,
  104. dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'engineer') engineer,
  105. dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'technician') technician,
  106. dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'quotationOfficer') quotationOfficer,c.customer_Id,
  107. a.proofing_no,a.ori_code_no
  108. FROM plm_technical_specification_sheet a
  109. 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
  110. left join plm_project_info c on a.site=c.site and a.project_id=c.project_id
  111. where a.site=#{site} and a.code_no=#{codeNo}
  112. </select>
  113. <select id="getProofingDataByUserRole" resultType="PlmTechnicalSpecificationSheetData">
  114. 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
  115. ,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,
  116. b.project_name
  117. from plm_proofing_information a left join plm_project_info b on a.site=b.site and a.project_id=b.project_id
  118. <where>
  119. and a.site=#{site}
  120. AND a.project_id in ( select project_id from AccessProject where site=#{site} and username=#{username} and searchFlag='Y' )
  121. <if test="proofingNo!= null and proofingNo != ''">
  122. AND a.proofing_no like #{proofingNo}
  123. </if>
  124. </where>
  125. </select>
  126. <update id="updateBMBasicInformation" >
  127. update plm_technical_specification_sheet set status=#{status},stage=#{stage},remarkPage=#{remarkPage}
  128. ,rev_no=#{revNo},ECN_no=#{ecnNo},ECN_flag=#{ecnFlag},ECN_address=#{ecnAddress},cqcOperator=#{cqcOperator},update_date=GetDate(),update_by=#{updateBy}
  129. ,faiOperator=#{faiOperator},peOperater=#{peOperater},csOperater=#{csOperater},dccOperater=#{dccOperater},pod=#{pod},mpOperator=#{mpOperator}
  130. where site=#{site} and code_no=#{codeNo}
  131. </update>
  132. <select id="searchBMcustomerInfo" resultType="PlmTechnicalSpecificationSheetData">
  133. select a.site,a.code_no,a.picture_addess,a.customerPictureChangeRemark,a.productionFileComments,
  134. b.final_customer_id finalCustomerNo,dbo.plm_get_customer_desc(a.site,b.final_customer_id) finalCustomerDesc,
  135. a.test_part_no as part_no,c.part_desc,c.material_number,c.part_type as part_family,b.customer_remark,
  136. b.remark projectRemark,a.remark,a.ori_code_no,a.materialType
  137. from plm_technical_specification_sheet a
  138. left join plm_project_info b on a.site=b.site and a.project_id=b.project_id
  139. left join view_Project_Part c on a.site=c.site and a.test_part_no=c.test_part_no
  140. where a.site=#{site} and a.code_no =#{codeNo}
  141. </select>
  142. <update id="updateBMcustomerInfo">
  143. update plm_technical_specification_sheet set picture_Addess=#{pictureAddess},materialType=#{materialType},
  144. customerPictureChangeRemark=#{customerPictureChangeRemark},productionFileComments
  145. =#{productionFileComments},remark=#{remark},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
  146. </update>
  147. <select id="searchBMPackageInfo" resultType="PlmBmPackageInfoData">
  148. select site,code_no,matrixStripped,appliedType,finalFormat,[rowCount],columnCount,missingAllowedFlag,rollPerQty,addingFilmFlag,
  149. packageRequest,coreType,coreDiameter,joinAllowedFlag,coreWidth,specialPositiorFlag,copyPosition,overprintingFlag,
  150. otherRequirement from plm_bm_packageInfo
  151. where site=#{site} and code_no=#{codeNo}
  152. </select>
  153. <update id="updateBMPackageInfo">
  154. update plm_bm_packageInfo set
  155. matrixStripped=#{matrixStripped},appliedType=#{appliedType},finalFormat=#{finalFormat},[rowCount]=#{rowCount,jdbcType=INTEGER},columnCount=#{columnCount,jdbcType=INTEGER},
  156. missingAllowedFlag=#{missingAllowedFlag},rollPerQty=#{rollPerQty,jdbcType=DECIMAL},addingFilmFlag=#{addingFilmFlag},
  157. packageRequest=#{packageRequest},coreType=#{coreType},coreDiameter=#{coreDiameter},joinAllowedFlag=#{joinAllowedFlag},coreWidth=#{coreWidth,jdbcType=DECIMAL},
  158. specialPositiorFlag=#{specialPositiorFlag},copyPosition=#{copyPosition},overprintingFlag=#{overprintingFlag},
  159. otherRequirement=#{otherRequirement},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
  160. </update>
  161. <select id="saveBMPackageInfo">
  162. insert into plm_bm_packageInfo (site,code_no,matrixStripped,appliedType,finalFormat,[rowCount],columnCount,missingAllowedFlag,rollPerQty,addingFilmFlag,
  163. packageRequest,coreType,coreDiameter,joinAllowedFlag,coreWidth,specialPositiorFlag,copyPosition,overprintingFlag,
  164. otherRequirement,update_date,update_by) values
  165. (#{site},#{codeNo},#{matrixStripped},#{appliedType},#{finalFormat},#{rowCount,jdbcType=INTEGER},#{columnCount,jdbcType=INTEGER},
  166. #{missingAllowedFlag},#{rollPerQty,jdbcType=DECIMAL},#{addingFilmFlag},#{packageRequest},#{coreType},#{coreDiameter},#{joinAllowedFlag},#{coreWidth,jdbcType=DECIMAL},
  167. #{specialPositiorFlag},#{copyPosition},#{overprintingFlag},#{otherRequirement},GetDate(),#{updateBy})
  168. </select>
  169. <select id="searchPartDataForSelect" resultType="com.spring.modules.part.vo.PartInformationVo">
  170. select top 100 a.erp_part_no ,a.part_desc,a.family_id,a.spec,family_name
  171. from part a left join part_family b on a.site=b.site and a.family_id=b.family_id
  172. <where>
  173. and a.site=#{site}
  174. <if test="erpPartNo!= null and erpPartNo != ''">
  175. AND a.erp_part_no like #{erpPartNo}
  176. </if>
  177. <if test="familyId!= null and familyId != ''">
  178. AND a.family_id like #{familyId}
  179. </if>
  180. <if test="partDesc!= null and partDesc != ''">
  181. AND a.part_desc like #{partDesc}
  182. </if>
  183. and a.erp_part_no is not null and a.erp_part_no !=''
  184. </where>
  185. </select>
  186. <insert id="saveBMBom" >
  187. insert into plm_bm_bom (Site,code_no,erp_part_no,quantity,remark,create_by,create_date)
  188. values(#{site},#{codeNo},#{erpPartNo},#{quantity},#{remark},#{username},GetDate())
  189. </insert>
  190. <update id="updateBMBom" >
  191. update plm_bm_bom set quantity=#{quantity,jdbcType=DECIMAL} ,remark=#{remark},update_by=#{username},
  192. update_date=GetDate() where Site=#{site} and code_no=#{codeNo} and erp_part_no=#{erpPartNo}
  193. </update>
  194. <select id="searchBMBom" resultType="PlmBmBomData">
  195. 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
  196. from plm_bm_bom a
  197. left join part b on a.erp_part_no=b.erp_part_no and a.site=b.site
  198. left join part_family c on b.family_id=c.family_id and b.site=c.site
  199. <where>
  200. and a.site=#{site}
  201. <if test="erpPartNo!= null and erpPartNo != ''">
  202. AND a.erp_part_no like #{erpPartNo}
  203. </if>
  204. <if test="codeNo!= null and codeNo != ''">
  205. AND a.code_no like #{codeNo}
  206. </if>
  207. </where>
  208. </select>
  209. <delete id="deleteBMBom" >
  210. delete from plm_bm_bom where code_no=#{codeNo} and site=#{site} and erp_part_no=#{erpPartNo}
  211. </delete>
  212. <select id="searchBMRoutingDetail" resultType="PlmBmRoutingData">
  213. SELECT a.Site,a.code_no,a.processDetail,a.supplyAdhesiveTape,a.routingDrawing,a.drawingRevison,a.drawingDate,a.workInfo,
  214. a.wiRevison,a.wiDate,a.routingRemark,a.routingAction,
  215. dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'reviewEngineer') reviewEngineer,
  216. dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'peEngineer') peEngineer,
  217. dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'cqe') cqe
  218. FROM plm_bm_routing a
  219. where a.site=#{site} and a.code_no=#{codeNo}
  220. </select>
  221. <insert id="saveBMRoutingDetail">
  222. insert into plm_bm_routing (Site,code_no,processDetail,supplyAdhesiveTape,routingDrawing,drawingRevison,drawingDate,workInfo,wiRevison,wiDate,
  223. routingRemark,routingAction,update_by,update_date) values
  224. (#{site},#{codeNo},#{processDetail},#{supplyAdhesiveTape},#{routingDrawing},#{drawingRevison},#{drawingDate},#{workInfo},#{wiRevison},#{wiDate},
  225. #{routingRemark},#{routingAction},#{username},GetDate())
  226. </insert>
  227. <update id="updateBMRoutingDetail">
  228. update plm_bm_routing set processDetail=#{processDetail},supplyAdhesiveTape=#{supplyAdhesiveTape},routingDrawing=#{routingDrawing},
  229. drawingRevison=#{drawingRevison},drawingDate=#{drawingDate},workInfo=#{workInfo},wiRevison=#{wiRevison},wiDate=#{wiDate},
  230. routingRemark=#{routingRemark},routingAction=#{routingAction},update_by=#{username},update_date=GetDate() where site=#{site} and code_no=#{codeNo}
  231. </update>
  232. <select id="checkPlmBmPropertiesValueHeaderData" resultType="PlmBmPropertiesValueHeaderData">
  233. select Site,bu_no,PartNo,CodeNo,SubCodeSeqNo,SubCodeDesc,RecordType from plm_bm_propertiesValueHeader
  234. where PartNo=#{codeNo} and site=#{site} and CodeNo=#{type} and bu_no=#{buNo}
  235. </select>
  236. <insert id="savePlmBmPropertiesValueHeaderData">
  237. insert into plm_bm_propertiesValueHeader(Site,bu_no,PartNo,CodeNo,SubCodeSeqNo,SubCodeDesc,RecordType )
  238. select #{site},#{buNo},#{codeNo},#{type},1,code_desc,'BM' from plm_bm_model_header
  239. where site=#{site} and bu_no=#{buNo} and function_type='BM' and code_no=#{type}
  240. </insert>
  241. <insert id="savePlmBmPropertiesValueData">
  242. insert into plm_bm_propertiesValue(Site,bu_no,PartNo,CodeNo,SubCodeSeqNo,SubCodeDesc,ItemNo,PropertiesItemNo,TextValue,NumValue,RecordType,order_id)
  243. select #{site},#{buNo},#{codeNo},#{type},1,b.code_desc,a.seq_no,a.properties_item_no,c.DefaultValue,null,'BM',a.order_id
  244. from plm_bm_model_header b left join plm_properties_model_detail a on a.site=#{site} and a.function_type='BM'
  245. and a.code_no=b.properties_code_no
  246. left join plm_properties_item c on a.properties_item_no=c.ItemNo and a.site=c.site and a.function_type=c.ItemType
  247. 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
  248. </insert>
  249. <select id="searchBMPropertiesValue" resultType="PlmBmPropertiesValueData">
  250. 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
  251. 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
  252. 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
  253. </select>
  254. <select id="getAvailableValueList" resultType="PlmPropertiesItemAvailableData">
  255. select ItemNo,ValueNo,AvailableValue from plm_properties_item_available where itemNo=#{propertiesItemNo} and site=#{site} and ItemType='BM'
  256. </select>
  257. <update id="updateBMPropertiesValue">
  258. update plm_bm_propertiesValue set NumValue=#{numValue,jdbcType=DOUBLE} ,TextValue=#{textValue} where site=#{site} and bu_no=#{buNo} and PartNo=#{partNo} and RecordType=#{recordType}
  259. and SubCodeSeqNo=#{subCodeSeqNo} and PropertiesItemNo=#{propertiesItemNo}
  260. </update>
  261. <select id="getBMPageBase" resultType="PlmBmPageBaseData">
  262. select bu_no,code_no from plm_bm_model_header where bu_no=#{buNo} and site=#{site} and active='Y'
  263. </select>
  264. <select id="searchBMRoute" resultType="com.spring.modules.part.vo.RoutingComponentVo">
  265. SELECT
  266. a.site,
  267. a.part_no,
  268. a.routing_type,
  269. a.routing_revision,
  270. a.alternative_no,
  271. a.operation_id,
  272. a.operation_no,
  273. a.operation_name,
  274. a.efficiency_factor,
  275. a.mach_run_factor,
  276. a.mach_setup_time,
  277. a.run_time_code,
  278. a.labor_run_factor,
  279. a.labor_setup_time,
  280. a.crew_size,
  281. a.setup_crew_size,
  282. a.outside_op_item,
  283. a.machine_no,
  284. a.work_center_no,
  285. dbo.get_workCenter_desc(a.site, a.work_center_no) as workCenterDesc,
  286. a.labor_class_no,
  287. a.setup_labor_class_no,
  288. a.overlap,
  289. a.note_text as componentNoteText,
  290. b.itemType
  291. FROM plm_routing_component a
  292. left join WorkCenter_BMType b on a.site=b.site and a.work_center_no=b.workCenterNo
  293. 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}
  294. order by operation_no
  295. </select>
  296. <insert id="saveBMRoute">
  297. insert into plm_bm_routing_detail (site,code_no,item_no,OperationDesc,remark,create_date,create_by)
  298. values(#{site},#{codeNo},#{itemNo},#{operationDesc},#{remark},GetDate(),#{username})
  299. </insert>
  300. <update id="updateBMRoute">
  301. update plm_bm_routing_detail set item_no=#{itemNo},OperationDesc=#{operationDesc}
  302. ,remark=#{remark},update_date=GetDate(),update_by=#{username}
  303. where id=#{id}
  304. </update>
  305. <delete id="deleteBMRoute">
  306. delete from plm_bm_routing_detail where id=#{id}
  307. </delete>
  308. <select id="searchBMTPInfoDetail" resultType="PlmBmTpInfoDetailData">
  309. select site,code_no,colourMatch,environment,eordValue,customerFile,laberSize,crossNumber,hp,rowNumber,vp,remark
  310. from plm_bm_tpInfoDetail where site=#{site} and code_no=#{codeNo}
  311. </select>
  312. <insert id="saveBMTPInfoDetail">
  313. insert into plm_bm_tpInfoDetail (site,code_no,colourMatch,environment,eordValue,customerFile,laberSize,crossNumber,hp,rowNumber,vp,remark,update_date,update_by)
  314. values(#{site},#{codeNo},#{colourMatch},#{environment},#{eordValue},#{customerFile},#{laberSize},#{crossNumber},#{hp},#{rowNumber},#{vp},#{remark},GetDate(),#{updateBy})
  315. </insert>
  316. <update id="updateBMTPInfoDetail">
  317. update plm_bm_tpInfoDetail set colourMatch=#{colourMatch},environment=#{environment},eordValue=#{eordValue},customerFile=#{customerFile},
  318. laberSize=#{laberSize},crossNumber=#{crossNumber},hp=#{hp},rowNumber=#{rowNumber},vp=#{vp},
  319. remark=#{remark},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
  320. </update>
  321. <select id="searchBMTPInfoColor" resultType="PlmBmTpInfoColorData">
  322. select site,code_no,[order],color,inkType,colorRet,colorMatch,remark,filmNo,stencilNo,update_by,update_date,id
  323. from plm_bm_tpInfoColor where site=#{site} and code_no=#{codeNo} order by [order]
  324. </select>
  325. <insert id="saveBMTPInfoColor">
  326. insert into plm_bm_tpInfoColor (site,code_no,[order],color,inkType,colorRet,colorMatch,remark,filmNo,stencilNo,update_by,update_date)
  327. values(#{site},#{codeNo},#{order},#{color},#{inkType},#{colorRet},#{colorMatch},#{remark},#{filmNo},#{stencilNo},#{updateBy},GetDate())
  328. </insert>
  329. <update id="updateBMTPInfoColor">
  330. update plm_bm_tpInfoColor set [order]=#{order},color=#{color},inkType=#{inkType},colorRet=#{colorRet},
  331. colorMatch=#{colorMatch},remark=#{remark},filmNo=#{filmNo},stencilNo=#{stencilNo},
  332. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  333. </update>
  334. <delete id="deleteBMTPInfoColor">
  335. delete from plm_bm_tpInfoColor where id=#{id}
  336. </delete>
  337. <select id="checkPlmBmTpInfoColorOrder" resultType="PlmBmTpInfoColorData">
  338. select site from plm_bm_tpInfoColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  339. </select>
  340. <select id="searchBMTPInfoCut" resultType="PlmBmTpInfoCutData">
  341. select site,code_no,[order],cuttingMachine,cuttingType,cutterTooling,cutterLayout,cutterCost,p2c,c2c,cutterNo,update_date,
  342. update_by,id
  343. from plm_bm_tpInfoCut where site=#{site} and code_no=#{codeNo} order by [order]
  344. </select>
  345. <insert id="saveBMTPInfoCut">
  346. insert into plm_bm_tpInfoCut (site,code_no,[order],cuttingMachine,cuttingType,cutterTooling,cutterLayout,cutterCost,p2c,c2c,cutterNo,update_date,
  347. update_by)
  348. values(#{site},#{codeNo},#{order},#{cuttingMachine},#{cuttingType},#{cutterTooling},#{cutterLayout},#{cutterCost},#{p2c},#{c2c},#{cutterNo},GetDate(),#{updateBy})
  349. </insert>
  350. <update id="updateBMTPInfoCut">
  351. update plm_bm_tpInfoCut set [order]=#{order},cuttingMachine=#{cuttingMachine},cuttingType=#{cuttingType},cutterTooling=#{cutterTooling},
  352. cutterLayout=#{cutterLayout},cutterCost=#{cutterCost},p2c=#{p2c},c2c=#{c2c},cutterNo=#{cutterNo},
  353. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  354. </update>
  355. <select id="checkPlmBmTpInfoCutOrder" resultType="PlmBmTpInfoCutData">
  356. select site from plm_bm_tpInfoCut where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  357. </select>
  358. <delete id="deleteBMTPInfoCut">
  359. delete from plm_bm_tpInfoCut where id=#{id}
  360. </delete>
  361. <select id="searchBMPrepressDetail" resultType="PlmBmPrepressData">
  362. select Site,code_no,plateNo,cutterNumber,cutterLayout,[action],remark,feedback,update_by,update_date
  363. from plm_bm_prepress where site=#{site} and code_no=#{codeNo}
  364. </select>
  365. <insert id="saveBMPrepressDetail">
  366. insert into plm_bm_prepress (Site,code_no,plateNo,cutterNumber,cutterLayout,[action],remark,feedback,update_by,update_date)
  367. values(#{site},#{codeNo},#{plateNo},#{cutterNumber},#{cutterLayout},#{action},#{remark},#{feedback},#{updateBy},GetDate())
  368. </insert>
  369. <update id="updateBMPrepressDetail">
  370. update plm_bm_prepress set plateNo=#{plateNo},cutterNumber=#{cutterNumber},cutterLayout=#{cutterLayout},[action]=#{action},
  371. remark=#{remark},feedback=#{feedback},update_by=#{updateBy},update_date=GetDate() where site=#{site} and code_no=#{codeNo}
  372. </update>
  373. <select id="searchBMPrepressColor" resultType="PlmBmPrepressColorData">
  374. select site,code_no,[order],meshModel,meshSize,angle,coatingType,filmNo,stencilNo,color,update_by,update_date
  375. from plm_bm_PrepressColor where site=#{site} and code_no=#{codeNo} order by [order]
  376. </select>
  377. <insert id="saveBMPrepressColor">
  378. insert into plm_bm_PrepressColor (site,code_no,[order],meshModel,meshSize,angle,coatingType,filmNo,stencilNo,color,update_by,update_date)
  379. values(#{site},#{codeNo},#{order},#{meshModel},#{meshSize},#{angle},#{coatingType},#{filmNo},#{stencilNo},#{color},#{updateBy},GetDate())
  380. </insert>
  381. <update id="updateBMPrepressColor">
  382. update plm_bm_PrepressColor set [order]=#{order},color=#{color},meshModel=#{meshModel},meshSize=#{meshSize},
  383. angle=#{angle},coatingType=#{coatingType},filmNo=#{filmNo},stencilNo=#{stencilNo},
  384. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  385. </update>
  386. <delete id="deleteBMPrepressColor">
  387. delete from plm_bm_PrepressColor where id=#{id}
  388. </delete>
  389. <select id="checkPlmBmPrepressColorOrder" resultType="PlmBmPrepressColorData">
  390. select site from plm_bm_PrepressColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  391. </select>
  392. <select id="searchBMPrintOtherDetail" resultType="PlmBmPrintOtherData">
  393. select site,code_no,remark,[action],update_date,update_by,id
  394. from plm_bm_PrintOther where site=#{site} and code_no=#{codeNo}
  395. </select>
  396. <insert id="saveBMPrintOtherDetail">
  397. insert into plm_bm_PrintOther (site,code_no,remark,[action],update_date,update_by)
  398. values(#{site},#{codeNo},#{remark},#{action},GetDate(),#{updateBy})
  399. </insert>
  400. <update id="updateBMPrintOtherDetail">
  401. update plm_bm_PrintOther set remark=#{remark},[action]=#{action} where site=#{site} and code_no=#{codeNo}
  402. </update>
  403. <select id="searchBMPrintOtherColor" resultType="PlmBmPrintOtherColorData">
  404. select site,code_no,[order],seqNo,ink,[type],otherRef,update_date,update_by
  405. from plm_bm_PrintOtherColor where site=#{site} and code_no=#{codeNo} order by [order] ,seqNo
  406. </select>
  407. <insert id="saveBMPrintOtherColor">
  408. insert into plm_bm_PrintOtherColor (site,code_no,[order],seqNo,ink,[type],otherRef,update_by,update_date)
  409. values(#{site},#{codeNo},#{order},#{seqNo},#{ink},#{type},#{otherRef},#{updateBy},GetDate())
  410. </insert>
  411. <update id="updateBMPrintOtherColor">
  412. update plm_bm_PrintOtherColor set [order]=#{order},seqNo=#{seqNo},ink=#{ink},[type]=#{type},
  413. otherRef=#{otherRef},
  414. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  415. </update>
  416. <delete id="deleteBMPrintOtherColor">
  417. delete from plm_bm_PrintOtherColor where id=#{id}
  418. </delete>
  419. <select id="checkPlmBmPrintOtherColorOrder" resultType="PlmBmPrintOtherColorData">
  420. select site from plm_bm_PrintOtherColor where site=#{site} and code_no=#{codeNo} and [order]=#{order} and seqNo=#{seqNo}
  421. </select>
  422. <update id="updateBMModal">
  423. update plm_bm_model_header set properties_code_no=#{propertiesCodeNo} ,active=#{active} where site=#{site}
  424. and bu_no=#{buNo} and code_no=#{codeNo}
  425. </update>
  426. <select id="checkBMModelHeader" resultType="PlmBmModelHeaderData">
  427. select properties_code_no from plm_bm_model_header where site=#{site}
  428. and bu_no=#{buNo} and code_no=#{type}
  429. </select>
  430. <select id="searchBMPropertiesHeaderForBM" resultType="PlmBmModelHeaderData">
  431. select properties_code_no from plm_bm_model_header where site=#{site}
  432. and bu_no=#{buNo} and code_no=#{type}
  433. </select>
  434. <!-- Ink Mixing 油墨房-->
  435. <select id="searchBMInkMixingDetail" resultType="PlmBmInkMixingData">
  436. select site,code_no,colourMatch,visuallySetting,indicate,customerFile,remarks,[action],update_date,update_by
  437. from plm_bm_InkMixing where site=#{site} and code_no=#{codeNo}
  438. </select>
  439. <insert id="saveBMInkMixingDetail">
  440. insert into plm_bm_InkMixing (site,code_no,colourMatch,visuallySetting,indicate,customerFile,remarks,[action],update_date,update_by)
  441. values(#{site},#{codeNo},#{colourMatch},#{visuallySetting},#{indicate},#{customerFile},#{remarks},#{action},GetDate(),#{updateBy})
  442. </insert>
  443. <update id="updateBMInkMixingDetail">
  444. update plm_bm_InkMixing set colourMatch=#{colourMatch},visuallySetting=#{visuallySetting},indicate=#{indicate}
  445. ,customerFile=#{customerFile},[action]=#{action},remarks=#{remarks},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
  446. </update>
  447. <select id="searchBMInkMixingColor" resultType="PlmBmInkMixingColorData">
  448. select site,code_no,[order],color,[type],supplier,inkUsage,mixTime,standbyTime,Viscosity,RecycleTimes,update_by,update_date,id
  449. from plm_bm_InkMixingColor where site=#{site} and code_no=#{codeNo} order by [order]
  450. </select>
  451. <insert id="saveBMInkMixingColor">
  452. insert into plm_bm_InkMixingColor (site,code_no,[order],color,[type],supplier,inkUsage,mixTime,standbyTime,Viscosity,RecycleTimes,update_by,update_date)
  453. values(#{site},#{codeNo},#{order},#{color},#{type},#{supplier},#{inkUsage},#{mixTime},#{standbyTime},#{viscosity},#{recycleTimes},#{updateBy},GetDate())
  454. </insert>
  455. <update id="updateBMInkMixingColor">
  456. update plm_bm_InkMixingColor set [order]=#{order},color=#{color},[type]=#{type},supplier=#{supplier},inkUsage=#{inkUsage},
  457. mixTime=#{mixTime},standbyTime=#{standbyTime},Viscosity=#{viscosity},RecycleTimes=#{recycleTimes},
  458. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  459. </update>
  460. <delete id="deleteBMInkMixingColor">
  461. delete from plm_bm_InkMixingColor where id=#{id}
  462. </delete>
  463. <select id="checkPlmBmInkMixingColorOrder" resultType="PlmBmInkMixingColorData">
  464. select site from plm_bm_InkMixingColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  465. </select>
  466. <!-- Ink Formulation 油墨配方-->
  467. <select id="searchBMInkFormulationDetail" resultType="PlmBmInkFormulationData">
  468. select Site,code_no,remarks,label_size,qpa,[action],[cross],row,hp,vp,update_date,update_by
  469. from plm_bm_InkFormulation where site=#{site} and code_no=#{codeNo}
  470. </select>
  471. <insert id="saveBMInkFormulationDetail">
  472. insert into plm_bm_InkFormulation (Site,code_no,remarks,label_size,qpa,[action],[cross],row,hp,vp,update_date,update_by)
  473. values(#{site},#{codeNo},#{remarks},#{labelSize},#{qpa},#{action},#{cross},#{row},#{hp},#{vp},GetDate(),#{updateBy})
  474. </insert>
  475. <update id="updateBMInkFormulationDetail">
  476. update plm_bm_InkFormulation set remarks=#{remarks},label_size=#{labelSize},qpa=#{qpa},[action]=#{action},[cross]=#{cross}
  477. ,row=#{row},[hp]=#{hp},vp=#{vp},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
  478. </update>
  479. <select id="searchBMInkFormulationColor" resultType="PlmBmInkFormulationColorData">
  480. select site,code_no,[order],hardness,tartness,printingSide,energy,dry_speed,dry_time,dry_temp,dry_time2,update_date,update_by,
  481. id
  482. from plm_bm_InkFormulationColor where site=#{site} and code_no=#{codeNo} order by [order]
  483. </select>
  484. <insert id="saveBMInkFormulationColor">
  485. 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)
  486. values(#{site},#{codeNo},#{order},#{hardness},#{tartness},#{printingSide},#{energy},#{drySpeed},#{dryTime},#{dryTemp},#{dryTime2},GetDate(),#{updateBy})
  487. </insert>
  488. <update id="updateBMInkFormulationColor">
  489. update plm_bm_InkFormulationColor set [order]=#{order},hardness=#{hardness},[tartness]=#{tartness},printingSide=#{printingSide},energy=#{energy},
  490. dry_speed=#{drySpeed},dry_time=#{dryTime},dry_temp=#{dryTemp},dry_time2=#{dryTime2},
  491. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  492. </update>
  493. <delete id="deleteBMInkFormulationColor">
  494. delete from plm_bm_InkFormulationColor where id=#{id}
  495. </delete>
  496. <select id="checkPlmBmInkFormulationColorOrder" resultType="PlmBmInkFormulationColorData">
  497. select site from plm_bm_InkFormulationColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  498. </select>
  499. <!-- Lamination 覆膜 -->
  500. <select id="searchBMLaminationDetail" resultType="PlmBmLaminationData">
  501. select site,code_no,[action],update_date,update_by,remark
  502. from plm_bm_Lamination where site=#{site} and code_no=#{codeNo}
  503. </select>
  504. <insert id="saveBMLaminationDetail">
  505. insert into plm_bm_Lamination (site,code_no,[action],update_date,update_by,remark)
  506. values(#{site},#{codeNo},#{action},GetDate(),#{updateBy},#{remark})
  507. </insert>
  508. <update id="updateBMLaminationDetail">
  509. update plm_bm_Lamination set remark=#{remark},[action]=#{action},
  510. update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
  511. </update>
  512. <select id="searchBMLaminationCut" resultType="PlmBmLaminationCutData">
  513. select site,code_no,[order],station,processStep,machine,laminationType,rm_partNo,rm_partNo2,film_partNo,lamination_side,remarks,
  514. update_date,update_by,id
  515. from plm_bm_LaminationCut where site=#{site} and code_no=#{codeNo} order by [order]
  516. </select>
  517. <insert id="saveBMLaminationCut">
  518. insert into plm_bm_LaminationCut (site,code_no,[order],station,processStep,machine,laminationType,rm_partNo,rm_partNo2,film_partNo,lamination_side,remarks,
  519. update_date,update_by)
  520. values(#{site},#{codeNo},#{order},#{station},#{processStep},#{machine},#{laminationType},#{rmPartNo},#{rmPartNo2},#{filmPartNo},#{laminationSide},#{remarks},
  521. GetDate(),#{updateBy})
  522. </insert>
  523. <update id="updateBMLaminationCut">
  524. update plm_bm_LaminationCut set [order]=#{order},station=#{station},[processStep]=#{processStep},machine=#{machine},laminationType=#{laminationType},
  525. rm_partNo=#{rmPartNo},rm_partNo2=#{rmPartNo2},film_partNo=#{filmPartNo},lamination_side=#{laminationSide},remarks=#{remarks},
  526. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  527. </update>
  528. <delete id="deleteBMLaminationCut">
  529. delete from plm_bm_LaminationCut where id=#{id}
  530. </delete>
  531. <select id="checkPlmBmLaminationCutOrder" resultType="PlmBmLaminationCutData">
  532. select site from plm_bm_LaminationCut where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  533. </select>
  534. <!-- Cnc -->
  535. <select id="searchBMCncDetail" resultType="PlmBmCncData">
  536. select site,code_no,[action],update_date,update_by
  537. from plm_bm_Cnc where site=#{site} and code_no=#{codeNo}
  538. </select>
  539. <insert id="saveBMCncDetail">
  540. insert into plm_bm_Cnc (site,code_no,[action],update_date,update_by)
  541. values(#{site},#{codeNo},#{action},GetDate(),#{updateBy})
  542. </insert>
  543. <update id="updateBMCncDetail">
  544. update plm_bm_Cnc set [action]=#{action},
  545. update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
  546. </update>
  547. <select id="searchBMCncCut" resultType="PlmBmCncCutData">
  548. select site,code_no,[order],cutting_machine,program_name,cutting_speed,spec,p2c,c2c,remarks,update_date,update_by,id
  549. from plm_bm_CncCut where site=#{site} and code_no=#{codeNo} order by [order]
  550. </select>
  551. <insert id="saveBMCncCut">
  552. insert into plm_bm_CncCut (site,code_no,[order],cutting_machine,program_name,cutting_speed,spec,p2c,c2c,remarks,update_date,update_by)
  553. values(#{site},#{codeNo},#{order},#{cuttingMachine},#{programName},#{cuttingSpeed},#{spec},#{p2c},#{c2c},#{remarks},
  554. GetDate(),#{updateBy})
  555. </insert>
  556. <update id="updateBMCncCut">
  557. update plm_bm_CncCut set [order]=#{order},cutting_machine=#{cuttingMachine},[program_name]=#{programName},cutting_speed=#{cuttingSpeed},spec=#{spec},
  558. p2c=#{p2c},c2c=#{c2c},remarks=#{remarks},
  559. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  560. </update>
  561. <delete id="deleteBMCncCut">
  562. delete from plm_bm_CncCut where id=#{id}
  563. </delete>
  564. <select id="checkPlmBmCncCutOrder" resultType="PlmBmCncCutData">
  565. select site from plm_bm_CncCut where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  566. </select>
  567. <!-- Cut -->
  568. <select id="searchBMCutDetail" resultType="PlmBmCutData">
  569. select site,code_no,[action],remarks,update_date,update_by
  570. from plm_bm_Cut where site=#{site} and code_no=#{codeNo}
  571. </select>
  572. <insert id="saveBMCutDetail">
  573. insert into plm_bm_Cut (site,code_no,[action],update_date,update_by,remarks)
  574. values(#{site},#{codeNo},#{action},GetDate(),#{updateBy},#{remarks})
  575. </insert>
  576. <update id="updateBMCutDetail">
  577. update plm_bm_Cut set [action]=#{action},remarks=#{remarks},
  578. update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
  579. </update>
  580. <select id="searchBMCutCut" resultType="PlmBmCutCutData">
  581. select site,code_no,[order],cutting_machine,cutting_type,cutting_tooling,cutter_no,cutter_layout,cutter_cost,program_name,
  582. program_path,p2c,c2c,update_by,update_date,id
  583. from plm_bm_CutCut where site=#{site} and code_no=#{codeNo} order by [order]
  584. </select>
  585. <insert id="saveBMCutCut">
  586. insert into plm_bm_CutCut (site,code_no,[order],cutting_machine,cutting_type,cutting_tooling,cutter_no,cutter_layout,cutter_cost,program_name,
  587. program_path,p2c,c2c,update_by,update_date)
  588. values(#{site},#{codeNo},#{order},#{cuttingMachine},#{cuttingType},#{cuttingTooling},#{cutterNo},#{cutterLayout},#{cutterCost},#{programName},
  589. #{programPath},#{p2c},#{c2c},#{updateBy},GetDate())
  590. </insert>
  591. <update id="updateBMCutCut">
  592. update plm_bm_CutCut set [order]=#{order},cutting_machine=#{cuttingMachine},[cutting_type]=#{cuttingType},cutting_tooling=#{cuttingTooling},cutter_no=#{cutterNo},
  593. cutter_layout=#{cutterLayout},cutter_cost=#{cutterCost},program_name=#{programName}, p2c=#{p2c},c2c=#{c2c},program_path=#{programPath},
  594. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  595. </update>
  596. <delete id="deleteBMCutCut">
  597. delete from plm_bm_CutCut where id=#{id}
  598. </delete>
  599. <select id="checkPlmBmCutCutOrder" resultType="PlmBmCutCutData">
  600. select site from plm_bm_CutCut where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  601. </select>
  602. <!-- printing 印刷-->
  603. <select id="searchBMPrintingDetail" resultType="PlmBmPrintingData">
  604. select site,code_no,colour_match,conditions,colour_indicat,customer_file,glossiness_requirement,comments,repeat,vp,label_size,
  605. down,plate_distortion_rate,actual_number,print_position,goods_roll_width,update_date,update_by,printLayout
  606. from plm_bm_Printing where site=#{site} and code_no=#{codeNo}
  607. </select>
  608. <insert id="saveBMPrintingDetail">
  609. insert into plm_bm_Printing (site,code_no,colour_match,conditions,colour_indicat,customer_file,glossiness_requirement,comments,repeat,vp,label_size,
  610. down,plate_distortion_rate,actual_number,print_position,goods_roll_width,update_date,update_by,printLayout)
  611. values(#{site},#{codeNo},#{colourMatch},#{conditions},#{colourIndicat},#{customerFile},#{glossinessRequirement},#{comments},
  612. #{repeat},#{vp},#{labelSize},#{down},#{plateDistortionRate},#{actualNumber},#{printPosition},#{goodsRollWidth},
  613. GetDate(),#{updateBy},#{printLayout})
  614. </insert>
  615. <update id="updateBMPrintingDetail">
  616. update plm_bm_Printing set printLayout=#{printLayout},colour_match=#{colourMatch},conditions=#{conditions},colour_indicat=#{colourIndicat},customer_file=#{customerFile},glossiness_requirement=#{glossinessRequirement},comments=#{comments},
  617. 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}
  618. </update>
  619. <select id="searchBMPrintingColor" resultType="PlmBmPrintingColorData">
  620. select site,code_no,[order],ink_type,color_reference,color_match,bcm,speed,dry,gallus,mark_andy,lp,Hexiang,update_date,update_by,
  621. id
  622. from plm_bm_PrintingColor where site=#{site} and code_no=#{codeNo} order by [order]
  623. </select>
  624. <insert id="saveBMPrintingColor">
  625. 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)
  626. values(#{site},#{codeNo},#{order},#{inkType},#{colorReference},#{colorMatch},#{bcm},#{speed},#{dry},#{gallus},#{markAndy},#{lp},#{hexiang},#{updateBy},GetDate())
  627. </insert>
  628. <update id="updateBMPrintingColor">
  629. update plm_bm_PrintingColor set [order]=#{order},ink_type=#{inkType},[color_reference]=#{colorReference},color_match=#{colorMatch},bcm=#{bcm},
  630. speed=#{speed},dry=#{dry},gallus=#{gallus},mark_andy=#{markAndy},lp=#{lp},Hexiang=#{hexiang},
  631. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  632. </update>
  633. <delete id="deleteBMPrintingColor">
  634. delete from plm_bm_PrintingColor where id=#{id}
  635. </delete>
  636. <select id="checkPlmBmPrintingColorOrder" resultType="PlmBmPrintingColorData">
  637. select site from plm_bm_PrintingColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  638. </select>
  639. <select id="getBomNowRevNo" resultType="com.spring.modules.part.entity.BomHeaderEntity">
  640. select top 1 eng_chg_level,bom_type,site,part_no
  641. from plm_bom_header
  642. where site=#{site} and part_no=#{partNo}
  643. and GetDate()>eff_phase_in_date and isnull(eff_phase_out_date, DATEADD(d, 1, GETDATE())) >GetDate()
  644. </select>
  645. <select id="getTopOneBomAlternativeNo" resultType="com.spring.modules.part.entity.BomDetailEntity">
  646. select top 1 site,part_no,alternative_no,alternative_description,bom_type,eng_chg_level
  647. from plm_bom_detail where site=#{site} and part_no=#{partNo} and bom_type=#{bomType} and eng_chg_level=#{engChgLevel}
  648. </select>
  649. <select id="getRouteNowRevNo" resultType="com.spring.modules.part.entity.RoutingHeaderEntity">
  650. select top 1 site,part_no,routing_revision,routing_type
  651. from plm_routing_header
  652. where site=#{site} and part_no=#{partNo} and GetDate()>phase_in_date and isnull(phase_out_date, DATEADD(d, 1, GETDATE())) >GetDate()
  653. </select>
  654. <select id="getTopOneRouteAlternativeNo" resultType="com.spring.modules.part.entity.RoutingDetailEntity">
  655. select top 1 site,part_no,routing_revision,routing_type,alternative_no,alternative_description
  656. from plm_routing_detail
  657. where site=#{site} and part_no=#{partNo} and routing_type=#{routingType} and routing_revision=#{routingRevision}
  658. </select>
  659. <select id="getBMBomDetail" resultType="com.spring.modules.part.entity.BomDetailEntity">
  660. select a.site,a.bom_type,a.eng_chg_level,a.bom_alternative_no alternativeNo,b.final_part_no partNo
  661. 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
  662. where a.site=#{site} and a.code_no=#{codeNo}
  663. </select>
  664. <select id="getBMRouteDetail" resultType="com.spring.modules.part.entity.RoutingDetailEntity">
  665. select a.site,a.routing_type,a.routing_revision,
  666. a.routing_alternative_no alternativeNo,b.final_part_no partNo
  667. 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
  668. where a.site=#{site} and a.code_no=#{codeNo}
  669. </select>
  670. <select id="searchBMBomDetail" resultType="com.spring.modules.part.vo.BomDetailVo">
  671. 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,
  672. 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
  673. 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
  674. where a.part_no=#{partNo} and a.site=#{site} and a.bom_type!='Repair'
  675. </select>
  676. <update id="updateBMBomRev">
  677. update plm_technical_specification_sheet set bom_type=#{bomType},eng_chg_level=#{engChgLevel,jdbcType=INTEGER},
  678. bom_alternative_no=#{bomAlternativeNo} where site=#{site} and code_no=#{codeNo}
  679. </update>
  680. <update id="updateBMRouteRev">
  681. update plm_technical_specification_sheet set routing_type=#{routingType},routing_revision=#{routingRevision,jdbcType=INTEGER},
  682. routing_alternative_no=#{routingAlternativeNo} where site=#{site} and code_no=#{codeNo}
  683. </update>
  684. <select id="searchRouteDetail" resultType="com.spring.modules.part.vo.RoutingDetailVo">
  685. 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
  686. 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
  687. where a.site=#{site} and a.part_no=#{partNo} and a.routing_type!='Repair'
  688. </select>
  689. <select id="searchBMRemarkPage" resultType="PlmTechnicalSpecificationSheetData">
  690. select site,remarkPage,code_no from plm_technical_specification_sheet where site=#{site} and code_no=#{codeNo}
  691. </select>
  692. <update id="updateBMRemarkPage">
  693. update plm_technical_specification_sheet set remarkPage=#{remarkPage} where site=#{site} and code_no=#{codeNo}
  694. </update>
  695. <select id="searchPartLastQuotationNo" resultType="com.spring.modules.quotation.entity.QuotationHeader">
  696. select top 1 a.site,a.quotation_no
  697. from quotation_header a left join quotation_detail b on a.quotation_header_id=b.quotation_header_id
  698. where b.site=#{site} and b.product_no=#{productNo} order by a.create_time desc
  699. </select>
  700. <select id="getSysProxyAddress" resultType="SysProxyAddress">
  701. select physicalAddress,proxyAddress,remark from sys_proxy_address
  702. </select>
  703. <select id="searchBMprintFlexoColor" resultType="PlmBmPrintFlexoColorData">
  704. select id,site,codeNo,printSide,[order],colorReference,inkCode,colorMatch,lpi,bcm,openFlag,gallus,markAndy,hexiang,temperature,
  705. pressure,updateDate,updateBy from plm_bm_printFlexoColor
  706. where site=#{site} and codeNo=#{codeNo}
  707. order by printSide desc,[order]
  708. </select>
  709. <select id="checkBMprintFlexoColorOrder" resultType="PlmBmPrintFlexoColorData">
  710. select id,site,codeNo,printSide,[order] from plm_bm_printFlexoColor
  711. where site=#{site} and codeNo=#{codeNo} and printSide=#{printSide} and [order]=#{order}
  712. </select>
  713. <insert id="saveBMprintFlexoColor" >
  714. insert into plm_bm_printFlexoColor(site,codeNo,printSide,[order],colorReference,inkCode,colorMatch,lpi,bcm,openFlag,gallus,markAndy,hexiang,temperature,
  715. pressure,updateDate,updateBy,remark) values
  716. (#{site},#{codeNo},#{printSide},#{order},#{colorReference},#{inkCode},#{colorMatch},#{lpi},#{bcm},#{openFlag},#{gallus},
  717. #{markAndy},#{hexiang},#{temperature},#{pressure},GetDate(),#{updateBy},#{remark})
  718. </insert>
  719. <update id="updateBMprintFlexoColor" >
  720. update plm_bm_printFlexoColor set printSide=#{printSide},[order]=#{order,jdbcType=INTEGER},colorReference=#{colorReference},inkCode=#{inkCode},
  721. colorMatch=#{colorMatch},lpi=#{lpi},bcm=#{bcm},openFlag=#{openFlag},gallus=#{gallus},markAndy=#{markAndy},hexiang=#{hexiang},temperature=#{temperature},
  722. pressure=#{pressure},updateDate=GetDate(),updateBy=#{updateBy},remark=#{remark} where id=#{id}
  723. </update>
  724. <delete id="deleteBMprintFlexoColor">
  725. delete from plm_bm_printFlexoColor where id=#{id}
  726. </delete>
  727. <select id="searchBMprintIndigoColor" resultType="PlmBmPrintIndigoColorData">
  728. select id,code_no,site,[order],printSide,colorReference,inkCode,colorMatch,printMotion,opticalDensity,lut,lpi,screenAngle,printHits,
  729. blanketTemperture,remark,updateBy,updateDate from plm_bm_printIndigoColor
  730. where site=#{site} and code_no=#{codeNo}
  731. order by printSide desc,[order]
  732. </select>
  733. <select id="checkBMprintIndigoColorOrder" resultType="PlmBmPrintIndigoColorData">
  734. select id,site,code_no,printSide,[order] from plm_bm_printIndigoColor
  735. where site=#{site} and code_no=#{codeNo} and printSide=#{printSide} and [order]=#{order}
  736. </select>
  737. <insert id="saveBMprintIndigoColor" >
  738. insert into plm_bm_printIndigoColor(site,code_no,[order],printSide,colorReference,inkCode,colorMatch,printMotion,opticalDensity,lut,lpi,screenAngle,printHits,
  739. blanketTemperture,remark,updateBy,updateDate) values
  740. (#{site},#{codeNo},#{order},#{printSide},#{colorReference},#{inkCode},#{colorMatch},#{printMotion},#{opticalDensity},#{lut},#{lpi},
  741. #{screenAngle},#{printHits},#{blanketTemperture},#{remark},#{updateBy},GetDate())
  742. </insert>
  743. <update id="updateBMprintIndigoColor" >
  744. update plm_bm_printIndigoColor set printSide=#{printSide},[order]=#{order,jdbcType=INTEGER},colorReference=#{colorReference},inkCode=#{inkCode},
  745. colorMatch=#{colorMatch},printMotion=#{printMotion},opticalDensity=#{opticalDensity},lut=#{lut},lpi=#{lpi},screenAngle=#{screenAngle},printHits=#{printHits},blanketTemperture=#{blanketTemperture},
  746. remark=#{remark},updateDate=GetDate(),updateBy=#{updateBy} where id=#{id}
  747. </update>
  748. <delete id="deleteBMprintIndigoColor">
  749. delete from plm_bm_printIndigoColor where id=#{id}
  750. </delete>
  751. <select id="selectTechnicalSpecification" parameterType="string" resultType="PlmTechnicalSpecificationSheet">
  752. SELECT
  753. id,site,code_no,proofing_no,project_id,test_part_no,status,rev_no,work_center_no,ECN_flag,ECN_no,ECN_address,remark,
  754. create_date,create_by,update_date,update_by,picture_addess,customerPictureChangeRemark,productionFileComments,
  755. ori_code_no,bom_type,eng_chg_level,bom_alternative_no,routing_type,routing_revision,routing_alternative_no,remarkPage,
  756. process,stage,materialType,cqcOperator,faiOperator,overPrintOperator,printOperator,peOperater,csOperater,dccOperater,
  757. step_id,reject_flag,reject_step_id
  758. FROM plm_technical_specification_sheet a
  759. where a.site = #{site} and a.code_no = #{codeNo}
  760. </select>
  761. <update id="updateStatus" parameterType="PlmTechnicalSpecificationSheetData">
  762. update plm_technical_specification_sheet
  763. set status = #{status},
  764. update_date = getDate(),
  765. update_by = #{userName}
  766. where site = #{site} and code_no = #{codeNo}
  767. </update>
  768. </mapper>