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.

981 lines
52 KiB

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