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.

814 lines
43 KiB

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