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.

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