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.

901 lines
48 KiB

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