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.

985 lines
52 KiB

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