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.

1114 lines
58 KiB

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