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.

1648 lines
81 KiB

2 years ago
9 months ago
9 months ago
1 year ago
9 months ago
1 year ago
9 months ago
1 year ago
9 months ago
1 year ago
9 months ago
1 year ago
9 months ago
1 year ago
9 months ago
1 year ago
9 months ago
1 year ago
9 months ago
1 year ago
9 months ago
1 year ago
9 months ago
9 months ago
9 months ago
10 months ago
9 months ago
1 year ago
9 months ago
1 year ago
11 months ago
1 year ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
9 months ago
1 year ago
1 year ago
2 years ago
2 years ago
10 months ago
2 years ago
2 years ago
1 year ago
2 years ago
9 months ago
2 years ago
2 years ago
1 year ago
10 months ago
1 year ago
2 years ago
2 years ago
9 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
10 months ago
8 months ago
8 months ago
8 months ago
8 months ago
10 months ago
1 year ago
2 years ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
10 months ago
2 years ago
2 years ago
10 months ago
9 months ago
10 months ago
2 years ago
10 months ago
2 years ago
2 years ago
2 years ago
10 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
8 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
8 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
10 months ago
2 years ago
2 years ago
10 months ago
2 years ago
2 years ago
2 years ago
10 months ago
2 years ago
2 years ago
2 years ago
10 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
11 months ago
1 year ago
1 year ago
9 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
9 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
10 months ago
9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
8 months ago
8 months 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. <resultMap id="getTechnicalSpecificationSheetData" type="PlmTechnicalSpecificationSheetData">
  5. <result column="id" property="id"/>
  6. <result column="site" property="site"/>
  7. <result column="code_no" property="codeNo"/>
  8. <result column="project_id" property="projectId"/>
  9. <result column="test_part_no" property="testPartNo"/>
  10. <result column="status" property="status"/>
  11. <result column="rev_no" property="revNo"/>
  12. <result column="work_center_no" property="workCenterNo"/>
  13. <result column="ECN_flag" property="ecnFlag"/>
  14. <result column="ECN_no" property="ecnNo"/>
  15. <result column="ori_code_no" property="oriCodeNo"/>
  16. <result column="ECN_address" property="ecnAddress"/>
  17. <result column="remark" property="remark"/>
  18. <result column="create_date" property="createDate"/>
  19. <result column="create_by" property="createBy"/>
  20. <result column="update_date" property="updateDate"/>
  21. <result column="update_by" property="updateBy"/>
  22. <result column="final_part_no" property="finalPartNo"/>
  23. <result column="partTypeDesc" property="partTypeDesc"/>
  24. <result column="partType" property="partType"/>
  25. <result column="part_name" property="partName"/>
  26. <result column="part_desc" property="partDesc"/>
  27. <result column="part_spec" property="partSpec"/>
  28. <result column="statusDesc" property="statusDesc"/>
  29. <result column="proofing_no" property="proofingNo"/>
  30. <result column="bu_no" property="buNo"/>
  31. <result column="buDesc" property="buDesc"/>
  32. <result column="engineer" property="engineer"/>
  33. <result column="technician" property="technician"/>
  34. <result column="process" property="process"/>
  35. <result column="quotationOfficer" property="quotationOfficer"/>
  36. <result column="engineerNo" property="engineerNo"/>
  37. <result column="technicianNo" property="technicianNo"/>
  38. <result column="customer_Id" property="customerId"/>
  39. <result column="picture_addess" property="pictureAddess"/>
  40. <result column="customerPictureChangeRemark" property="customerPictureChangeRemark"/>
  41. <result column="productionFileComments" property="productionFileComments"/>
  42. <result column="bom_type" property="bomType"/>
  43. <result column="eng_chg_level" property="engChgLevel"/>
  44. <result column="bom_alternative_no" property="bomAlternativeNo"/>
  45. <result column="routing_type" property="routingType"/>
  46. <result column="routing_revision" property="routingRevision"/>
  47. <result column="routing_alternative_no" property="routingAlternativeNo"/>
  48. <result column="pod" property="pod"/>
  49. <result column="mpOperator" property="mpOperator"/>
  50. <result column="mpOperatorName" property="mpOperatorName"/>
  51. <result column="cqcOperator" property="cqcOperator"/>
  52. <result column="cqcOperatorName" property="cqcOperatorName"/>
  53. <result column="faiOperator" property="faiOperator"/>
  54. <result column="faiOperatorName" property="faiOperatorName"/>
  55. <result column="peOperater" property="peOperater"/>
  56. <result column="peOperaterName" property="peOperaterName"/>
  57. <result column="csOperater" property="csOperater"/>
  58. <result column="dccOperater" property="dccOperater"/>
  59. <result column="dccOperaterName" property="dccOperaterName"/>
  60. <result column="is_reject" property="isReject"/>
  61. <result column="node_id" property="nodeId"/>
  62. <result column="node_name" property="nodeName"/>
  63. <result column="customer_part_no" property="customerPartNo"/>
  64. <result column="sp" property="sp"/>
  65. <result column="remarkPage" property="remarkPage"/>
  66. <result column="rev" property="rev"/>
  67. <result column="customer_rev" property="customerRev"/>
  68. <result column="plm_part_no" property="plmPartNo"/>
  69. <result column="project_name" property="projectName"/>
  70. </resultMap>
  71. <select id="technicalSpecificationListSearch" parameterType="PlmTechnicalSpecificationSheetData" resultType="PlmTechnicalSpecificationSheetData">
  72. SELECT a.id,
  73. a.site,
  74. a.code_no as codeNo,
  75. a.project_id as projectId,
  76. a.test_part_no as testPartNo,
  77. a.status,
  78. a.rev_no as revNo,
  79. a.work_center_no as workCenterNo,
  80. a.ECN_flag as ecnFlag,
  81. a.ECN_no as ecnNo,
  82. a.ori_code_no as oriCodeNo,
  83. a.ECN_address as ecnAddress,
  84. a.remark,
  85. a.create_date as createDate,
  86. a.create_by as createBy,
  87. a.update_date as updateDate,
  88. a.update_by as updateBy,
  89. b.final_part_no as finalPartNo,
  90. b.part_type as partTypeDesc,
  91. b.part_type as partType,
  92. b.part_name as partName,
  93. b.part_desc as partDesc,
  94. b.part_spec as partSpec,
  95. dbo.plm_get_technicalBaseDesc(a.status, 'status') as statusDesc,
  96. a.proofing_no as proofingNo,
  97. b.bu_no as buNo,
  98. dbo.plm_get_bu_desc(a.site, b.bu_no) as buDesc,
  99. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'engineer') as engineer,
  100. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'technician') as technician,
  101. process,
  102. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'quotationOfficer') as quotationOfficer,
  103. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'engineer') as engineerNo,
  104. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'technician') as technicianNo,
  105. c.customer_Id as customerId,
  106. a.picture_addess as pictureAddess,
  107. a.customerPictureChangeRemark,
  108. a.productionFileComments,
  109. a.bom_type as bomType,
  110. a.eng_chg_level as engChgLevel,
  111. a.bom_alternative_no as bomAlternativeNo,
  112. a.routing_type as routingType,
  113. a.routing_revision as routingRevision,
  114. a.routing_alternative_no as routingAlternativeNo,
  115. a.pod,
  116. a.mpOperator,
  117. dbo.get_userDisPlay(a.mpOperator) as mpOperatorName,
  118. a.cqcOperator,
  119. dbo.get_userDisPlay(a.cqcOperator) as cqcOperatorName,
  120. a.faiOperator,
  121. dbo.get_userDisPlay(a.faiOperator) as faiOperatorName,
  122. a.peOperater,
  123. dbo.get_userDisPlay(a.peOperater) as peOperaterName,
  124. a.csOperater,
  125. dbo.get_userDisPlay(a.csOperater) as csOperaterName,
  126. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'dcc') as dccOperater,
  127. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'dcc') as dccOperaterName,
  128. d.is_reject as isReject,
  129. d.node_id as nodeId,
  130. d.node_name as nodeName,
  131. pcpi.customer_part_no as customerPartNo,
  132. dbo.get_plm_Approval_username(a.site, prh.workflow_id, d.node_id, a.code_no) as sp,
  133. a.remarkPage,
  134. a.rev,
  135. a.customer_rev as customerRev,
  136. b.plm_part_no as plmPartNo,
  137. c.project_name as projectName
  138. FROM plm_technical_specification_sheet a
  139. left join view_Project_final_Part b
  140. on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no
  141. left join plm_project_info c on a.site = c.site and a.project_id = c.project_id
  142. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'
  143. left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and
  144. prh.workflow_id = d.workflow_id and a.step_id = d.step_id
  145. left join plm_customer_part_info pcpi
  146. on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no
  147. <if test="query.cutterNumber != null and query.cutterNumber != ''">
  148. inner join plm_bm_prepress pbp on pbp.Site = a.site and pbp.code_no = a.code_no and
  149. (plateNo like #{query.cutterNumber} or
  150. cutterNumber like #{query.cutterNumber})
  151. </if>
  152. <where>
  153. <if test="query.id != null">
  154. AND a.id = #{query.id}
  155. </if>
  156. <if test="query.site != null and query.site != ''">
  157. AND a.site = #{query.site}
  158. </if>
  159. <if test="query.ecnFlag != null and query.ecnFlag != ''">
  160. AND a.ecn_flag = #{query.ecnFlag}
  161. </if>
  162. <if test="query.oriCodeNo != null and query.oriCodeNo != ''">
  163. AND a.ori_code_no like #{query.oriCodeNo}
  164. </if>
  165. <if test="query.codeNo != null and query.codeNo != ''">
  166. AND a.code_no like #{query.codeNo}
  167. </if>
  168. <if test="query.projectId != null and query.projectId != ''">
  169. AND a.project_id like #{query.projectId}
  170. </if>
  171. <if test="query.testPartNo != null and query.testPartNo != ''">
  172. AND (
  173. a.test_part_no like #{query.testPartNo} or
  174. b.final_part_no like #{query.testPartNo} or
  175. a.relevance_part_no like #{query.testPartNo} or
  176. pcpi.customer_part_no like #{query.testPartNo}
  177. )
  178. </if>
  179. <if test="query.customerDesc != null and query.customerDesc != ''">
  180. AND (
  181. dbo.plm_get_customer_desc(c.site, c.customer_id) like #{query.customerDesc} or
  182. dbo.plm_get_dictDataLabel('finalCustomer', c.final_customer_id, c.site) like #{query.customerDesc}
  183. )
  184. </if>
  185. <if test="query.statusDesc != null and query.statusDesc != ''">
  186. AND dbo.plm_get_technicalBaseDesc(a.status, 'status') like #{query.statusDesc}
  187. </if>
  188. <if test="query.buNo == null || query.buNo == ''">
  189. AND b.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(#{query.site}, #{query.userName}))
  190. </if>
  191. <if test="query.buNo != null and query.buNo != ''">
  192. AND b.bu_no like #{query.buNo}
  193. </if>
  194. </where>
  195. order by a.ori_code_no desc, a.rev_no desc
  196. </select>
  197. <insert id="saveTechnicalSpecificationSheet">
  198. insert into plm_technical_specification_sheet(site, code_no, project_id, test_part_no, status, rev_no, ECN_flag,
  199. ECN_no, ECN_address, remark,
  200. create_date, create_by, proofing_no, ori_code_no, bom_type,
  201. eng_chg_level, bom_alternative_no, routing_type, routing_revision,
  202. routing_alternative_no, stage, materialType, step_id
  203. , cqcOperator, faiOperator, peOperater, csOperater, mpOperator, rev, customer_rev,certification)
  204. values ( #{site}, #{codeNo}, #{projectId}, #{testPartNo}, #{status}, #{revNo}, #{ecnFlag}, #{ecnNo}, #{ecnAddress}
  205. , #{remark}, GetDate(), #{createBy}, #{proofingNo}, #{oriCodeNo}, #{bomType}, #{engChgLevel,jdbcType=INTEGER}
  206. , #{bomAlternativeNo}, #{routingType}, #{routingRevision,jdbcType=INTEGER}, #{routingAlternativeNo}, 'Sample'
  207. , 'Label', 10
  208. , #{cqcOperator}, #{faiOperator}, #{peOperater}, #{csOperater}, #{mpOperator}, #{rev}, #{customerRev},'RoHs')
  209. </insert>
  210. <update id="updateProjectPartNowBm">
  211. update plm_project_part set now_bm=#{codeNo} where site=#{site} and project_id=#{projectId} and test_part_no=#{testPartNo}
  212. </update>
  213. <insert id="saveTechnicalSpecificationTeams">
  214. insert into plm_technicalSpecification_team (site,code_no,operator_id,type)
  215. values (#{site},#{codeNo},#{operatorId},#{type})
  216. </insert>
  217. <insert id="saveBatchTechnicalSpecificationTeams" >
  218. insert into plm_technicalSpecification_team (site,code_no,operator_id,type)
  219. values
  220. <foreach collection="list" item="item" separator=",">
  221. (#{item.site},#{item.codeNo},#{item.operatorId},#{item.type})
  222. </foreach>
  223. </insert>
  224. <update id="updateTechnicalSpecificationSheet">
  225. update plm_technical_specification_sheet set project_id=#{projectId},test_part_no=#{testPartNo},status=#{status}
  226. ,rev_no=#{revNo},ECN_no=#{ecnNo},ECN_flag=#{ecnFlag},ECN_address=#{ecnAddress},remark=#{remark},update_date=GetDate(),update_by=#{updateBy}
  227. ,cqcOperator=#{cqcOperator},faiOperator=#{faiOperator},peOperater=#{peOperater},
  228. csOperater=#{csOperater},mpOperator=#{mpOperator},rev=#{rev},customer_rev=#{customerRev}
  229. where id=#{id}
  230. </update>
  231. <delete id="deleteTechnicalSpecificationTeamsForBase">
  232. delete from plm_technicalSpecification_team where site=#{site} and code_no=#{codeNo} and type in ('quotationOfficer','engineer','technician','dcc','cqc','fai')
  233. </delete>
  234. <delete id="deleteTechnicalSpecificationTeamsForDetail">
  235. delete from plm_technicalSpecification_team where site=#{site} and code_no=#{codeNo} and type in ('reviewEngineer','peEngineer','cqe')
  236. </delete>
  237. <select id="searchTechnicalSpecificationTeamStr" resultType="String">
  238. select operator_id from plm_technicalSpecification_team where type=#{type} and site=#{site} and code_no=#{codeNo}
  239. </select>
  240. <select id="getTechnicalCustomerInfoData" resultType="TechnicalCustomerInfoData">
  241. select a.id,b.customer_id,c.customer_desc as customerName,c.customer_description as customerDesc ,b.customer_Remark,b.remark,
  242. a.picture_addess,a.customerPictureChangeRemark,a.productionFileComments
  243. from plm_technical_specification_sheet a
  244. left join plm_project_info b on a.site=b.site and a.project_id=b.project_id
  245. left join plm_customer_information c on b.site=c.site and b.customer_id=c.customer_no where a.id=#{id}
  246. </select>
  247. <select id="searchBMUser" resultType="PlmOperatorData">
  248. select a.username operator_id, a.user_display operator_name, b.site, b.bu_no as buNo
  249. from sys_user a
  250. left join AccessBu b on a.username = b.username
  251. <if test="roleNo != null and roleNo != ''">
  252. inner join AccessRole r on r.username = a.username and r.role_no = #{roleNo}
  253. </if>
  254. where b.bu_no = #{buNo}
  255. <if test="roleNo != null and roleNo != ''">
  256. and r.site = #{site}
  257. </if>
  258. and b.site = #{site}
  259. order by a.username desc
  260. </select>
  261. <select id="tsdBasicInformationSearch" resultType="PlmTechnicalSpecificationSheetData">
  262. SELECT top 1 a.id,
  263. a.site,
  264. a.code_no,
  265. a.project_id,
  266. a.test_part_no,
  267. a.status,
  268. a.rev_no,
  269. a.work_center_no,
  270. a.ECN_flag,
  271. a.ECN_no,
  272. b.bu_no,
  273. a.ECN_address,
  274. a.remark,
  275. a.create_date,
  276. a.create_by,
  277. a.update_date,
  278. a.update_by,
  279. b.final_part_no,
  280. b.part_type partTypeDesc,
  281. b.part_type,
  282. b.part_name,
  283. b.part_desc,
  284. b.part_spec,
  285. dbo.plm_get_technicalBaseDesc(a.status, 'status') statusDesc,
  286. a.proofing_no,
  287. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'engineer') engineer,
  288. stage,
  289. dbo.plm_get_dictDataLabel('bm_process', process, a.site) process,
  290. remarkPage,
  291. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'quotationOfficer') quotationOfficer,
  292. c.customer_Id,
  293. a.ori_code_no,
  294. a.overPrintOperator,
  295. a.printOperator,
  296. dbo.get_userDisPlay(a.overPrintOperator) overPrintOperatorName,
  297. dbo.get_userDisPlay(a.printOperator) printOperatorName,
  298. a.peOperater,
  299. dbo.get_userDisPlay(a.peOperater) peOperaterName,
  300. a.csOperater,
  301. dbo.get_userDisPlay(a.csOperater) csOperaterName,
  302. isnull(a.step_id, 10) stepId,
  303. d.is_reject,
  304. a.pod,
  305. d.node_id,
  306. d.node_name,
  307. a.mpOperator,
  308. dbo.get_userDisPlay(a.mpOperator) mpOperatorName,
  309. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'technician') technician,
  310. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'engineer') engineerNo,
  311. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'dcc') dcc,
  312. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'technician') technicianNo,
  313. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'cqc') cqcOperatorName,
  314. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'fai') faiOperatorName,
  315. <!-- a.cqcOperator,-->
  316. <!-- a.faiOperator,-->
  317. <!-- dbo.get_userDisPlay(a.cqcOperator) cqcOperatorName,-->
  318. <!-- dbo.get_userDisPlay(a.faiOperator) faiOperatorName,-->
  319. a.rev,
  320. a.customer_rev,
  321. relevance_part_no
  322. FROM plm_technical_specification_sheet a
  323. left join view_Project_final_Part b
  324. on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no
  325. left join plm_project_info c on a.site = c.site and a.project_id = c.project_id
  326. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'
  327. left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and
  328. prh.workflow_id = d.workflow_id and isnull(a.step_id, 10) = d.step_id
  329. where a.site = #{site}
  330. and a.code_no = #{codeNo}
  331. </select>
  332. <delete id="deleteTechnicalSpecificationList">
  333. delete from plm_technical_specification_sheet where id=#{id}
  334. </delete>
  335. <update id="updateBMProcess">
  336. update plm_technical_specification_sheet set process=#{process},overPrintOperator=#{overPrintOperator},printOperator=#{printOperator} where site=#{site} and code_no=#{codeNo}
  337. </update>
  338. <select id="getTestPartChangeData" resultType="PlmProjectPartData">
  339. select top 1 * from view_Project_final_Part where site=#{site} and test_part_no=#{testPartNo}
  340. </select>
  341. <select id="BMBasicInformationSearch" resultType="PlmTechnicalSpecificationSheetData">
  342. 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,
  343. a.ECN_address,a.remark,a.create_date,a.create_by,a.update_date,a.update_by,b.final_part_no,b.part_type partTypeDesc,
  344. b.part_type,b.part_name,b.part_desc,b.part_spec,dbo.plm_get_technicalBaseDesc(a.status,'status') statusDesc,
  345. dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'engineer') engineer,
  346. dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'technician') technician,
  347. dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'quotationOfficer') quotationOfficer,c.customer_Id,
  348. a.proofing_no,a.ori_code_no
  349. FROM plm_technical_specification_sheet a
  350. left join view_Project_final_Part b on a.site=b.site and a.project_id=b.project_id and a.test_part_no=b.test_part_no
  351. left join plm_project_info c on a.site=c.site and a.project_id=c.project_id
  352. where a.site=#{site} and a.code_no=#{codeNo}
  353. </select>
  354. <select id="getProofingDataByUserRole" resultType="PlmTechnicalSpecificationSheetData">
  355. SELECT
  356. a.site,
  357. a.proofing_no,
  358. a.project_id,
  359. a.test_part_no,
  360. dbo.plm_get_test_part_name(a.site,a.test_part_no) partName,
  361. dbo.plm_get_test_part_desc(a.site, a.test_part_no) partDesc,
  362. b.customer_id,
  363. b.final_customer_id,
  364. dbo.plm_get_customer_desc(a.site,b.customer_id) CustomerDesc,
  365. dbo.plm_get_dictDataLabel('finalCustomer',b.final_customer_id,a.site) finalCustomerDesc,
  366. b.project_name,d.bu_no
  367. from plm_proofing_information a
  368. left join plm_project_info b on a.site = b.site and a.project_id = b.project_id
  369. left join part as c on a.site = c.site and a.test_part_no = c.part_no
  370. left join plm_project_part d on a.site = d.site and a.test_part_no = d.test_part_no
  371. <where>
  372. and a.site=#{site}
  373. AND a.project_id in ( select project_id from AccessProject where site=#{site} and username=#{username} and searchFlag='Y' )
  374. <if test="proofingNo!= null and proofingNo != ''">
  375. AND a.proofing_no like #{proofingNo}
  376. </if>
  377. <if test="projectId!= null and projectId != ''">
  378. AND a.project_id like #{projectId}
  379. </if>
  380. <if test="customerId!= null and customerId != ''">
  381. AND b.customer_id like #{customerId}
  382. </if>
  383. <if test="finalCustomerId!= null and finalCustomerId != ''">
  384. AND b.final_customer_id like #{finalCustomerId}
  385. </if>
  386. and c.status = 'Y'
  387. </where>
  388. </select>
  389. <update id="updateBMBasicInformation" >
  390. update plm_technical_specification_sheet
  391. set status=#{status}
  392. , stage=#{stage}
  393. , remarkPage=#{remarkPage}
  394. , rev_no=#{revNo}
  395. , ECN_no=#{ecnNo}
  396. , ECN_flag=#{ecnFlag}
  397. , ECN_address=#{ecnAddress}
  398. , cqcOperator=#{cqcOperator}
  399. , update_date=GetDate()
  400. , update_by=#{updateBy}
  401. , faiOperator=#{faiOperator}
  402. , peOperater=#{peOperater}
  403. , csOperater=#{csOperater}
  404. , pod=#{pod}
  405. , mpOperator=#{mpOperator}
  406. , relevance_part_no=#{relevancePartNo}
  407. where site = #{site}
  408. and code_no = #{codeNo}
  409. </update>
  410. <select id="searchBMcustomerInfo" resultType="PlmTechnicalSpecificationSheetData">
  411. select a.site,
  412. a.code_no,
  413. a.picture_addess,
  414. a.customerPictureChangeRemark,
  415. a.productionFileComments,
  416. b.customer_id,
  417. dbo.plm_get_customer_desc(b.site, b.customer_id) CustomerDesc,
  418. b.final_customer_id finalCustomerNo,
  419. dbo.plm_get_dictDataLabel('finalCustomer', b.final_customer_id, a.site) finalCustomerDesc,
  420. c.final_part_no as part_no,
  421. c.part_desc,
  422. c.material_number,
  423. c.part_type as part_family,
  424. b.customer_remark,
  425. a.remark,
  426. a.ori_code_no,
  427. a.materialType,
  428. a.customerRevNo,
  429. a.materialNumber,
  430. a.certification,
  431. a.customerRemark,
  432. a.projectRemark,
  433. b.project_id,
  434. pcpi.customer_part_no
  435. from plm_technical_specification_sheet a
  436. left join plm_project_info b on a.site = b.site and a.project_id = b.project_id
  437. left join view_Project_final_Part c
  438. on a.site = c.site and a.test_part_no = c.test_part_no and a.project_id = c.project_id
  439. left join plm_customer_part_info pcpi
  440. on a.site = pcpi.site and a.test_part_no = pcpi.part_no and b.customer_id = pcpi.customer_no
  441. where a.site = #{site}
  442. and a.code_no = #{codeNo}
  443. </select>
  444. <update id="updateBMcustomerInfo">
  445. update plm_technical_specification_sheet
  446. set picture_Addess=#{pictureAddess},
  447. materialType=#{materialType},
  448. customerPictureChangeRemark=#{customerPictureChangeRemark},
  449. productionFileComments =#{productionFileComments},
  450. remark=#{remark},
  451. update_date=GetDate(),
  452. update_by=#{updateBy},
  453. certification=#{certification},
  454. customerRevNo=#{customerRevNo},
  455. materialNumber=#{materialNumber},
  456. customerRemark=#{customerRemark},
  457. projectRemark=#{projectRemark}
  458. where site = #{site}
  459. and code_no = #{codeNo}
  460. </update>
  461. <select id="searchBMPackageInfo" resultType="PlmBmPackageInfoData">
  462. select site,code_no,matrixStripped,appliedType,finalFormat,[rowCount],columnCount,missingAllowedFlag,rollPerQty,addingFilmFlag,
  463. packageRequest,coreType,coreDiameter,joinAllowedFlag,coreWidth,specialPositiorFlag,copyPosition,overprintingFlag,
  464. otherRequirement from plm_bm_packageInfo
  465. where site=#{site} and code_no=#{codeNo}
  466. </select>
  467. <update id="updateBMPackageInfo">
  468. update plm_bm_packageInfo set
  469. matrixStripped=#{matrixStripped},appliedType=#{appliedType},finalFormat=#{finalFormat},[rowCount]=#{rowCount,jdbcType=INTEGER},columnCount=#{columnCount,jdbcType=INTEGER},
  470. missingAllowedFlag=#{missingAllowedFlag},rollPerQty=#{rollPerQty,jdbcType=DECIMAL},addingFilmFlag=#{addingFilmFlag},
  471. packageRequest=#{packageRequest},coreType=#{coreType},coreDiameter=#{coreDiameter},joinAllowedFlag=#{joinAllowedFlag},coreWidth=#{coreWidth,jdbcType=DECIMAL},
  472. specialPositiorFlag=#{specialPositiorFlag},copyPosition=#{copyPosition},overprintingFlag=#{overprintingFlag},
  473. otherRequirement=#{otherRequirement},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
  474. </update>
  475. <select id="saveBMPackageInfo">
  476. insert into plm_bm_packageInfo (site,code_no,matrixStripped,appliedType,finalFormat,[rowCount],columnCount,missingAllowedFlag,rollPerQty,addingFilmFlag,
  477. packageRequest,coreType,coreDiameter,joinAllowedFlag,coreWidth,specialPositiorFlag,copyPosition,overprintingFlag,
  478. otherRequirement,update_date,update_by) values
  479. (#{site},#{codeNo},#{matrixStripped},#{appliedType},#{finalFormat},#{rowCount,jdbcType=INTEGER},#{columnCount,jdbcType=INTEGER},
  480. #{missingAllowedFlag},#{rollPerQty,jdbcType=DECIMAL},#{addingFilmFlag},#{packageRequest},#{coreType},#{coreDiameter},#{joinAllowedFlag},#{coreWidth,jdbcType=DECIMAL},
  481. #{specialPositiorFlag},#{copyPosition},#{overprintingFlag},#{otherRequirement},GetDate(),#{updateBy})
  482. </select>
  483. <select id="searchPartDataForSelect" resultType="com.spring.modules.part.vo.PartInformationVo">
  484. select top 100 a.erp_part_no ,a.part_desc,a.family_id,a.spec,family_name
  485. from part a left join part_family b on a.site=b.site and a.family_id=b.family_id
  486. <where>
  487. and a.site=#{site}
  488. <if test="erpPartNo!= null and erpPartNo != ''">
  489. AND a.erp_part_no like #{erpPartNo}
  490. </if>
  491. <if test="familyId!= null and familyId != ''">
  492. AND a.family_id like #{familyId}
  493. </if>
  494. <if test="partDesc!= null and partDesc != ''">
  495. AND a.part_desc like #{partDesc}
  496. </if>
  497. and a.erp_part_no is not null and a.erp_part_no !=''
  498. </where>
  499. </select>
  500. <insert id="saveBMBom" >
  501. insert into plm_bm_bom (Site,code_no,erp_part_no,quantity,remark,create_by,create_date)
  502. values(#{site},#{codeNo},#{erpPartNo},#{quantity},#{remark},#{username},GetDate())
  503. </insert>
  504. <update id="updateBMBom" >
  505. update plm_bm_bom set quantity=#{quantity,jdbcType=DECIMAL} ,remark=#{remark},update_by=#{username},
  506. update_date=GetDate() where Site=#{site} and code_no=#{codeNo} and erp_part_no=#{erpPartNo}
  507. </update>
  508. <select id="searchBMBom" resultType="PlmBmBomData">
  509. 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
  510. from plm_bm_bom a
  511. left join part b on a.erp_part_no=b.erp_part_no and a.site=b.site
  512. left join part_family c on b.family_id=c.family_id and b.site=c.site
  513. <where>
  514. and a.site=#{site}
  515. <if test="erpPartNo!= null and erpPartNo != ''">
  516. AND a.erp_part_no like #{erpPartNo}
  517. </if>
  518. <if test="codeNo!= null and codeNo != ''">
  519. AND a.code_no like #{codeNo}
  520. </if>
  521. </where>
  522. </select>
  523. <delete id="deleteBMBom" >
  524. delete from plm_bm_bom where code_no=#{codeNo} and site=#{site} and erp_part_no=#{erpPartNo}
  525. </delete>
  526. <select id="searchBMRoutingDetail" resultType="PlmBmRoutingData">
  527. SELECT a.Site,a.code_no,a.processDetail,a.supplyAdhesiveTape,a.routingDrawing,a.drawingRevison,a.drawingDate,a.workInfo,
  528. a.wiRevison,a.wiDate,a.routingRemark,a.routingAction,
  529. dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'reviewEngineer') reviewEngineer,
  530. dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'peEngineer') peEngineer,
  531. dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'cqe') cqe
  532. FROM plm_bm_routing a
  533. where a.site=#{site} and a.code_no=#{codeNo}
  534. </select>
  535. <insert id="saveBMRoutingDetail">
  536. insert into plm_bm_routing (Site,code_no,processDetail,supplyAdhesiveTape,routingDrawing,drawingRevison,drawingDate,workInfo,wiRevison,wiDate,
  537. routingRemark,routingAction,update_by,update_date) values
  538. (#{site},#{codeNo},#{processDetail},#{supplyAdhesiveTape},#{routingDrawing},#{drawingRevison},#{drawingDate},#{workInfo},#{wiRevison},#{wiDate},
  539. #{routingRemark},#{routingAction},#{username},GetDate())
  540. </insert>
  541. <update id="updateBMRoutingDetail">
  542. update plm_bm_routing set processDetail=#{processDetail},supplyAdhesiveTape=#{supplyAdhesiveTape},routingDrawing=#{routingDrawing},
  543. drawingRevison=#{drawingRevison},drawingDate=#{drawingDate},workInfo=#{workInfo},wiRevison=#{wiRevison},wiDate=#{wiDate},
  544. routingRemark=#{routingRemark},routingAction=#{routingAction},update_by=#{username},update_date=GetDate() where site=#{site} and code_no=#{codeNo}
  545. </update>
  546. <select id="checkPlmBmPropertiesValueHeaderData" resultType="PlmBmPropertiesValueHeaderData">
  547. select Site,bu_no,PartNo,CodeNo,SubCodeSeqNo,SubCodeDesc,RecordType from plm_bm_propertiesValueHeader
  548. where PartNo=#{codeNo} and site=#{site} and CodeNo=#{type} and bu_no=#{buNo}
  549. </select>
  550. <insert id="savePlmBmPropertiesValueHeaderData">
  551. insert into plm_bm_propertiesValueHeader(Site,bu_no,PartNo,CodeNo,SubCodeSeqNo,SubCodeDesc,RecordType )
  552. select #{site},#{buNo},#{codeNo},#{type},1,code_desc,'BM' from plm_bm_model_header
  553. where site=#{site} and bu_no=#{buNo} and function_type='BM' and code_no=#{type}
  554. </insert>
  555. <insert id="savePlmBmPropertiesValueData">
  556. insert into plm_bm_propertiesValue(Site,bu_no,PartNo,CodeNo,SubCodeSeqNo,SubCodeDesc,ItemNo,PropertiesItemNo,TextValue,NumValue,RecordType,order_id)
  557. select #{site},#{buNo},#{codeNo},#{type},1,b.code_desc,a.seq_no,a.properties_item_no,c.DefaultValue,null,'BM',a.order_id
  558. from plm_bm_model_header b left join plm_properties_model_detail a on a.site=#{site} and a.function_type='BM'
  559. and a.code_no=b.properties_code_no
  560. left join plm_properties_item c on a.properties_item_no=c.ItemNo and a.site=c.site and a.function_type=c.ItemType
  561. 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
  562. </insert>
  563. <select id="searchBMPropertiesValue" resultType="PlmBmPropertiesValueData">
  564. 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
  565. 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
  566. 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
  567. </select>
  568. <select id="getAvailableValueList" resultType="PlmPropertiesItemAvailableData">
  569. select ItemNo,ValueNo,AvailableValue from plm_properties_item_available where itemNo=#{propertiesItemNo} and site=#{site} and ItemType='BM'
  570. </select>
  571. <update id="updateBMPropertiesValue">
  572. update plm_bm_propertiesValue set NumValue=#{numValue,jdbcType=DOUBLE} ,TextValue=#{textValue} where site=#{site} and bu_no=#{buNo} and PartNo=#{partNo} and RecordType=#{recordType}
  573. and SubCodeSeqNo=#{subCodeSeqNo} and CodeNo = #{codeNo} and ItemNo=#{itemNo}
  574. </update>
  575. <select id="getBMPageBase" resultType="PlmBmPageBaseData">
  576. select bu_no,code_no from plm_bm_model_header where bu_no=#{buNo} and site=#{site} and active='Y'
  577. </select>
  578. <select id="searchBMRoute" resultType="com.spring.modules.part.vo.RoutingComponentVo">
  579. SELECT
  580. a.site,
  581. a.part_no,
  582. a.routing_type,
  583. a.routing_revision,
  584. a.alternative_no,
  585. a.operation_id,
  586. a.operation_no,
  587. a.operation_name,
  588. a.efficiency_factor,
  589. a.mach_run_factor,
  590. a.mach_setup_time,
  591. a.run_time_code,
  592. a.labor_run_factor,
  593. a.labor_setup_time,
  594. a.crew_size,
  595. a.setup_crew_size,
  596. a.outside_op_item,
  597. a.machine_no,
  598. a.work_center_no,
  599. dbo.get_workCenter_desc(a.site, a.work_center_no) as workCenterDesc,
  600. a.labor_class_no,
  601. a.setup_labor_class_no,
  602. a.overlap,
  603. a.note_text as componentNoteText,
  604. b.itemType
  605. FROM plm_routing_component a
  606. left join WorkCenter_BMType b on a.site=b.site and a.work_center_no=b.workCenterNo
  607. 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}
  608. order by operation_no
  609. </select>
  610. <insert id="saveBMRoute">
  611. insert into plm_bm_routing_detail (site,code_no,item_no,OperationDesc,remark,create_date,create_by)
  612. values(#{site},#{codeNo},#{itemNo},#{operationDesc},#{remark},GetDate(),#{username})
  613. </insert>
  614. <update id="updateBMRoute">
  615. update plm_bm_routing_detail set item_no=#{itemNo},OperationDesc=#{operationDesc}
  616. ,remark=#{remark},update_date=GetDate(),update_by=#{username}
  617. where id=#{id}
  618. </update>
  619. <delete id="deleteBMRoute">
  620. delete from plm_bm_routing_detail where id=#{id}
  621. </delete>
  622. <select id="searchBMTPInfoDetail" resultType="PlmBmTpInfoDetailData">
  623. select site,code_no,colourMatch,environment,eordValue,customerFile,laberSize,crossNumber,hp,rowNumber,vp,remark
  624. from plm_bm_tpInfoDetail where site=#{site} and code_no=#{codeNo}
  625. </select>
  626. <insert id="saveBMTPInfoDetail">
  627. insert into plm_bm_tpInfoDetail (site,code_no,colourMatch,environment,eordValue,customerFile,laberSize,crossNumber,hp,rowNumber,vp,remark,update_date,update_by)
  628. values(#{site},#{codeNo},#{colourMatch},#{environment},#{eordValue},#{customerFile},#{laberSize},#{crossNumber},#{hp},#{rowNumber},#{vp},#{remark},GetDate(),#{updateBy})
  629. </insert>
  630. <update id="updateBMTPInfoDetail">
  631. update plm_bm_tpInfoDetail set colourMatch=#{colourMatch},environment=#{environment},eordValue=#{eordValue},customerFile=#{customerFile},
  632. laberSize=#{laberSize},crossNumber=#{crossNumber},hp=#{hp},rowNumber=#{rowNumber},vp=#{vp},
  633. remark=#{remark},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
  634. </update>
  635. <select id="searchBMTPInfoColor" resultType="PlmBmTpInfoColorData">
  636. select site,code_no,[order],color,inkType,colorRet,colorMatch,remark,filmNo,stencilNo,update_by,update_date,id
  637. from plm_bm_tpInfoColor where site=#{site} and code_no=#{codeNo} order by [order]
  638. </select>
  639. <insert id="saveBMTPInfoColor">
  640. insert into plm_bm_tpInfoColor (site,code_no,[order],color,inkType,colorRet,colorMatch,remark,filmNo,stencilNo,update_by,update_date)
  641. values(#{site},#{codeNo},#{order},#{color},#{inkType},#{colorRet},#{colorMatch},#{remark},#{filmNo},#{stencilNo},#{updateBy},GetDate())
  642. </insert>
  643. <update id="updateBMTPInfoColor">
  644. update plm_bm_tpInfoColor set [order]=#{order},color=#{color},inkType=#{inkType},colorRet=#{colorRet},
  645. colorMatch=#{colorMatch},remark=#{remark},filmNo=#{filmNo},stencilNo=#{stencilNo},
  646. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  647. </update>
  648. <delete id="deleteBMTPInfoColor">
  649. delete from plm_bm_tpInfoColor where id=#{id}
  650. </delete>
  651. <select id="checkPlmBmTpInfoColorOrder" resultType="PlmBmTpInfoColorData">
  652. select site from plm_bm_tpInfoColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  653. </select>
  654. <select id="searchBMTPInfoCut" resultType="PlmBmTpInfoCutData">
  655. select site,code_no,[order],cuttingMachine,cuttingType,cutterTooling,cutterLayout,cutterCost,p2c,c2c,cutterNo,update_date,
  656. update_by,id
  657. from plm_bm_tpInfoCut where site=#{site} and code_no=#{codeNo} order by [order]
  658. </select>
  659. <insert id="saveBMTPInfoCut">
  660. insert into plm_bm_tpInfoCut (site,code_no,[order],cuttingMachine,cuttingType,cutterTooling,cutterLayout,cutterCost,p2c,c2c,cutterNo,update_date,
  661. update_by)
  662. values(#{site},#{codeNo},#{order},#{cuttingMachine},#{cuttingType},#{cutterTooling},#{cutterLayout},#{cutterCost},#{p2c},#{c2c},#{cutterNo},GetDate(),#{updateBy})
  663. </insert>
  664. <update id="updateBMTPInfoCut">
  665. update plm_bm_tpInfoCut set [order]=#{order},cuttingMachine=#{cuttingMachine},cuttingType=#{cuttingType},cutterTooling=#{cutterTooling},
  666. cutterLayout=#{cutterLayout},cutterCost=#{cutterCost},p2c=#{p2c},c2c=#{c2c},cutterNo=#{cutterNo},
  667. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  668. </update>
  669. <select id="checkPlmBmTpInfoCutOrder" resultType="PlmBmTpInfoCutData">
  670. select site from plm_bm_tpInfoCut where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  671. </select>
  672. <delete id="deleteBMTPInfoCut">
  673. delete from plm_bm_tpInfoCut where id=#{id}
  674. </delete>
  675. <select id="searchBMPrepressDetail" resultType="PlmBmPrepressData">
  676. select Site,code_no,plateNo,cutterNumber,cutterLayout,[action],remark,feedback,update_by,update_date
  677. from plm_bm_prepress where site=#{site} and code_no=#{codeNo}
  678. </select>
  679. <insert id="saveBMPrepressDetail">
  680. insert into plm_bm_prepress (Site,code_no,plateNo,cutterNumber,cutterLayout,[action],remark,feedback,update_by,update_date)
  681. values(#{site},#{codeNo},#{plateNo},#{cutterNumber},#{cutterLayout},#{action},#{remark},#{feedback},#{updateBy},GetDate())
  682. </insert>
  683. <update id="updateBMPrepressDetail">
  684. update plm_bm_prepress
  685. set plateNo=#{plateNo},
  686. cutterNumber=#{cutterNumber},
  687. cutterLayout=#{cutterLayout},
  688. [action]=#{action},
  689. remark=#{remark},
  690. feedback=#{feedback},
  691. update_by=#{updateBy},
  692. update_date=GetDate()
  693. where site = #{site}
  694. and code_no = #{codeNo}
  695. </update>
  696. <select id="searchBMPrepressColor" resultType="PlmBmPrepressColorData">
  697. select site,code_no,[order],meshModel,meshSize,angle,coatingType,filmNo,stencilNo,color,update_by,update_date
  698. from plm_bm_PrepressColor where site=#{site} and code_no=#{codeNo} order by [order]
  699. </select>
  700. <insert id="saveBMPrepressColor">
  701. insert into plm_bm_PrepressColor (site,code_no,[order],meshModel,meshSize,angle,coatingType,filmNo,stencilNo,color,update_by,update_date)
  702. values(#{site},#{codeNo},#{order},#{meshModel},#{meshSize},#{angle},#{coatingType},#{filmNo},#{stencilNo},#{color},#{updateBy},GetDate())
  703. </insert>
  704. <update id="updateBMPrepressColor">
  705. update plm_bm_PrepressColor set [order]=#{order},color=#{color},meshModel=#{meshModel},meshSize=#{meshSize},
  706. angle=#{angle},coatingType=#{coatingType},filmNo=#{filmNo},stencilNo=#{stencilNo},
  707. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  708. </update>
  709. <delete id="deleteBMPrepressColor">
  710. delete from plm_bm_PrepressColor where id=#{id}
  711. </delete>
  712. <select id="checkPlmBmPrepressColorOrder" resultType="PlmBmPrepressColorData">
  713. select site from plm_bm_PrepressColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  714. </select>
  715. <select id="searchBMPrintOtherDetail" resultType="PlmBmPrintOtherData">
  716. select site,code_no,remark,[action],update_date,update_by,id
  717. from plm_bm_PrintOther where site=#{site} and code_no=#{codeNo}
  718. </select>
  719. <insert id="saveBMPrintOtherDetail">
  720. insert into plm_bm_PrintOther (site,code_no,remark,[action],update_date,update_by)
  721. values(#{site},#{codeNo},#{remark},#{action},GetDate(),#{updateBy})
  722. </insert>
  723. <update id="updateBMPrintOtherDetail">
  724. update plm_bm_PrintOther set remark=#{remark},[action]=#{action} where site=#{site} and code_no=#{codeNo}
  725. </update>
  726. <select id="searchBMPrintOtherColor" resultType="PlmBmPrintOtherColorData">
  727. select site,code_no,[order],seqNo,ink,[type],otherRef,update_date,update_by
  728. from plm_bm_PrintOtherColor where site=#{site} and code_no=#{codeNo} order by [order] ,seqNo
  729. </select>
  730. <insert id="saveBMPrintOtherColor">
  731. insert into plm_bm_PrintOtherColor (site,code_no,[order],seqNo,ink,[type],otherRef,update_by,update_date)
  732. values(#{site},#{codeNo},#{order},#{seqNo},#{ink},#{type},#{otherRef},#{updateBy},GetDate())
  733. </insert>
  734. <update id="updateBMPrintOtherColor">
  735. update plm_bm_PrintOtherColor set [order]=#{order},seqNo=#{seqNo},ink=#{ink},[type]=#{type},
  736. otherRef=#{otherRef},
  737. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  738. </update>
  739. <delete id="deleteBMPrintOtherColor">
  740. delete from plm_bm_PrintOtherColor where id=#{id}
  741. </delete>
  742. <select id="checkPlmBmPrintOtherColorOrder" resultType="PlmBmPrintOtherColorData">
  743. select site from plm_bm_PrintOtherColor where site=#{site} and code_no=#{codeNo} and [order]=#{order} and seqNo=#{seqNo}
  744. </select>
  745. <update id="updateBMModal">
  746. update plm_bm_model_header set properties_code_no=#{propertiesCodeNo} ,active=#{active} where site=#{site}
  747. and bu_no=#{buNo} and code_no=#{codeNo}
  748. </update>
  749. <select id="checkBMModelHeader" resultType="PlmBmModelHeaderData">
  750. select properties_code_no from plm_bm_model_header where site=#{site}
  751. and bu_no=#{buNo} and code_no=#{type}
  752. </select>
  753. <select id="searchBMPropertiesHeaderForBM" resultType="PlmBmModelHeaderData">
  754. select properties_code_no from plm_bm_model_header where site=#{site}
  755. and bu_no=#{buNo} and code_no=#{type}
  756. </select>
  757. <!-- Ink Mixing 油墨房-->
  758. <select id="searchBMInkMixingDetail" resultType="PlmBmInkMixingData">
  759. select site,code_no,colourMatch,visuallySetting,indicate,customerFile,remarks,[action],update_date,update_by
  760. from plm_bm_InkMixing where site=#{site} and code_no=#{codeNo}
  761. </select>
  762. <insert id="saveBMInkMixingDetail">
  763. insert into plm_bm_InkMixing (site,code_no,colourMatch,visuallySetting,indicate,customerFile,remarks,[action],update_date,update_by)
  764. values(#{site},#{codeNo},#{colourMatch},#{visuallySetting},#{indicate},#{customerFile},#{remarks},#{action},GetDate(),#{updateBy})
  765. </insert>
  766. <update id="updateBMInkMixingDetail">
  767. update plm_bm_InkMixing set colourMatch=#{colourMatch},visuallySetting=#{visuallySetting},indicate=#{indicate}
  768. ,customerFile=#{customerFile},[action]=#{action},remarks=#{remarks},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
  769. </update>
  770. <select id="searchBMInkMixingColor" resultType="PlmBmInkMixingColorData">
  771. select site,code_no,[order],color,[type],supplier,inkUsage,mixTime,standbyTime,Viscosity,RecycleTimes,update_by,update_date,id
  772. from plm_bm_InkMixingColor where site=#{site} and code_no=#{codeNo} order by [order]
  773. </select>
  774. <insert id="saveBMInkMixingColor">
  775. insert into plm_bm_InkMixingColor (site,code_no,[order],color,[type],supplier,inkUsage,mixTime,standbyTime,Viscosity,RecycleTimes,update_by,update_date)
  776. values(#{site},#{codeNo},#{order},#{color},#{type},#{supplier},#{inkUsage},#{mixTime},#{standbyTime},#{viscosity},#{recycleTimes},#{updateBy},GetDate())
  777. </insert>
  778. <update id="updateBMInkMixingColor">
  779. update plm_bm_InkMixingColor set [order]=#{order},color=#{color},[type]=#{type},supplier=#{supplier},inkUsage=#{inkUsage},
  780. mixTime=#{mixTime},standbyTime=#{standbyTime},Viscosity=#{viscosity},RecycleTimes=#{recycleTimes},
  781. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  782. </update>
  783. <delete id="deleteBMInkMixingColor">
  784. delete from plm_bm_InkMixingColor where id=#{id}
  785. </delete>
  786. <select id="checkPlmBmInkMixingColorOrder" resultType="PlmBmInkMixingColorData">
  787. select site from plm_bm_InkMixingColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  788. </select>
  789. <!-- Ink Formulation 油墨配方-->
  790. <select id="searchBMInkFormulationDetail" resultType="PlmBmInkFormulationData">
  791. select Site,code_no,remarks,label_size,qpa,[action],[cross],row,hp,vp,update_date,update_by
  792. from plm_bm_InkFormulation where site=#{site} and code_no=#{codeNo}
  793. </select>
  794. <insert id="saveBMInkFormulationDetail">
  795. insert into plm_bm_InkFormulation (Site,code_no,remarks,label_size,qpa,[action],[cross],row,hp,vp,update_date,update_by)
  796. values(#{site},#{codeNo},#{remarks},#{labelSize},#{qpa},#{action},#{cross},#{row},#{hp},#{vp},GetDate(),#{updateBy})
  797. </insert>
  798. <update id="updateBMInkFormulationDetail">
  799. update plm_bm_InkFormulation set remarks=#{remarks},label_size=#{labelSize},qpa=#{qpa},[action]=#{action},[cross]=#{cross}
  800. ,row=#{row},[hp]=#{hp},vp=#{vp},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
  801. </update>
  802. <select id="searchBMInkFormulationColor" resultType="PlmBmInkFormulationColorData">
  803. select site,code_no,[order],hardness,tartness,printingSide,energy,dry_speed,dry_time,dry_temp,dry_time2,update_date,update_by,
  804. id
  805. from plm_bm_InkFormulationColor where site=#{site} and code_no=#{codeNo} order by [order]
  806. </select>
  807. <insert id="saveBMInkFormulationColor">
  808. 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)
  809. values(#{site},#{codeNo},#{order},#{hardness},#{tartness},#{printingSide},#{energy},#{drySpeed},#{dryTime},#{dryTemp},#{dryTime2},GetDate(),#{updateBy})
  810. </insert>
  811. <update id="updateBMInkFormulationColor">
  812. update plm_bm_InkFormulationColor set [order]=#{order},hardness=#{hardness},[tartness]=#{tartness},printingSide=#{printingSide},energy=#{energy},
  813. dry_speed=#{drySpeed},dry_time=#{dryTime},dry_temp=#{dryTemp},dry_time2=#{dryTime2},
  814. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  815. </update>
  816. <delete id="deleteBMInkFormulationColor">
  817. delete from plm_bm_InkFormulationColor where id=#{id}
  818. </delete>
  819. <select id="checkPlmBmInkFormulationColorOrder" resultType="PlmBmInkFormulationColorData">
  820. select site from plm_bm_InkFormulationColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  821. </select>
  822. <!-- Lamination 覆膜 -->
  823. <select id="searchBMLaminationDetail" resultType="PlmBmLaminationData">
  824. select site,code_no,[action],update_date,update_by,remark
  825. from plm_bm_Lamination where site=#{site} and code_no=#{codeNo}
  826. </select>
  827. <insert id="saveBMLaminationDetail">
  828. insert into plm_bm_Lamination (site,code_no,[action],update_date,update_by,remark)
  829. values(#{site},#{codeNo},#{action},GetDate(),#{updateBy},#{remark})
  830. </insert>
  831. <update id="updateBMLaminationDetail">
  832. update plm_bm_Lamination set remark=#{remark},[action]=#{action},
  833. update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
  834. </update>
  835. <select id="searchBMLaminationCut" resultType="PlmBmLaminationCutData">
  836. select site,code_no,[order],station,processStep,machine,laminationType,rm_partNo,rm_partNo2,film_partNo,lamination_side,remarks,
  837. update_date,update_by,id
  838. from plm_bm_LaminationCut where site=#{site} and code_no=#{codeNo} order by [order]
  839. </select>
  840. <insert id="saveBMLaminationCut">
  841. insert into plm_bm_LaminationCut (site,code_no,[order],station,processStep,machine,laminationType,rm_partNo,rm_partNo2,film_partNo,lamination_side,remarks,
  842. update_date,update_by)
  843. values(#{site},#{codeNo},#{order},#{station},#{processStep},#{machine},#{laminationType},#{rmPartNo},#{rmPartNo2},#{filmPartNo},#{laminationSide},#{remarks},
  844. GetDate(),#{updateBy})
  845. </insert>
  846. <update id="updateBMLaminationCut">
  847. update plm_bm_LaminationCut set [order]=#{order},station=#{station},[processStep]=#{processStep},machine=#{machine},laminationType=#{laminationType},
  848. rm_partNo=#{rmPartNo},rm_partNo2=#{rmPartNo2},film_partNo=#{filmPartNo},lamination_side=#{laminationSide},remarks=#{remarks},
  849. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  850. </update>
  851. <delete id="deleteBMLaminationCut">
  852. delete from plm_bm_LaminationCut where id=#{id}
  853. </delete>
  854. <select id="checkPlmBmLaminationCutOrder" resultType="PlmBmLaminationCutData">
  855. select site from plm_bm_LaminationCut where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  856. </select>
  857. <!-- Cnc -->
  858. <select id="searchBMCncDetail" resultType="PlmBmCncData">
  859. select site,code_no,[action],update_date,update_by
  860. from plm_bm_Cnc where site=#{site} and code_no=#{codeNo}
  861. </select>
  862. <insert id="saveBMCncDetail">
  863. insert into plm_bm_Cnc (site,code_no,[action],update_date,update_by)
  864. values(#{site},#{codeNo},#{action},GetDate(),#{updateBy})
  865. </insert>
  866. <update id="updateBMCncDetail">
  867. update plm_bm_Cnc set [action]=#{action},
  868. update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
  869. </update>
  870. <select id="searchBMCncCut" resultType="PlmBmCncCutData">
  871. select site,code_no,[order],cutting_machine,program_name,cutting_speed,spec,p2c,c2c,remarks,update_date,update_by,id
  872. from plm_bm_CncCut where site=#{site} and code_no=#{codeNo} order by [order]
  873. </select>
  874. <insert id="saveBMCncCut">
  875. insert into plm_bm_CncCut (site,code_no,[order],cutting_machine,program_name,cutting_speed,spec,p2c,c2c,remarks,update_date,update_by)
  876. values(#{site},#{codeNo},#{order},#{cuttingMachine},#{programName},#{cuttingSpeed},#{spec},#{p2c},#{c2c},#{remarks},
  877. GetDate(),#{updateBy})
  878. </insert>
  879. <update id="updateBMCncCut">
  880. update plm_bm_CncCut set [order]=#{order},cutting_machine=#{cuttingMachine},[program_name]=#{programName},cutting_speed=#{cuttingSpeed},spec=#{spec},
  881. p2c=#{p2c},c2c=#{c2c},remarks=#{remarks},
  882. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  883. </update>
  884. <delete id="deleteBMCncCut">
  885. delete from plm_bm_CncCut where id=#{id}
  886. </delete>
  887. <select id="checkPlmBmCncCutOrder" resultType="PlmBmCncCutData">
  888. select site from plm_bm_CncCut where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  889. </select>
  890. <!-- Cut -->
  891. <select id="searchBMCutDetail" resultType="PlmBmCutData">
  892. select site,code_no,[action],remarks,update_date,update_by
  893. from plm_bm_Cut where site=#{site} and code_no=#{codeNo}
  894. </select>
  895. <insert id="saveBMCutDetail">
  896. insert into plm_bm_Cut (site,code_no,[action],update_date,update_by,remarks)
  897. values(#{site},#{codeNo},#{action},GetDate(),#{updateBy},#{remarks})
  898. </insert>
  899. <update id="updateBMCutDetail">
  900. update plm_bm_Cut set [action]=#{action},remarks=#{remarks},
  901. update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
  902. </update>
  903. <select id="searchBMCutCut" resultType="PlmBmCutCutData">
  904. select site,code_no,[order],cutting_machine,cutting_type,cutting_tooling,cutter_no,cutter_layout,cutter_cost,program_name,
  905. program_path,p2c,c2c,update_by,update_date,id
  906. from plm_bm_CutCut where site=#{site} and code_no=#{codeNo} order by [order]
  907. </select>
  908. <insert id="saveBMCutCut">
  909. insert into plm_bm_CutCut (site,code_no,[order],cutting_machine,cutting_type,cutting_tooling,cutter_no,cutter_layout,cutter_cost,program_name,
  910. program_path,p2c,c2c,update_by,update_date)
  911. values(#{site},#{codeNo},#{order},#{cuttingMachine},#{cuttingType},#{cuttingTooling},#{cutterNo},#{cutterLayout},#{cutterCost},#{programName},
  912. #{programPath},#{p2c},#{c2c},#{updateBy},GetDate())
  913. </insert>
  914. <update id="updateBMCutCut">
  915. update plm_bm_CutCut set [order]=#{order},cutting_machine=#{cuttingMachine},[cutting_type]=#{cuttingType},cutting_tooling=#{cuttingTooling},cutter_no=#{cutterNo},
  916. cutter_layout=#{cutterLayout},cutter_cost=#{cutterCost},program_name=#{programName}, p2c=#{p2c},c2c=#{c2c},program_path=#{programPath},
  917. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  918. </update>
  919. <delete id="deleteBMCutCut">
  920. delete from plm_bm_CutCut where id=#{id}
  921. </delete>
  922. <select id="checkPlmBmCutCutOrder" resultType="PlmBmCutCutData">
  923. select site from plm_bm_CutCut where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  924. </select>
  925. <!-- printing 印刷-->
  926. <select id="searchBMPrintingDetail" resultType="PlmBmPrintingData">
  927. select site,code_no,colour_match,conditions,colour_indicat,customer_file,glossiness_requirement,comments,repeat,vp,label_size,
  928. down,plate_distortion_rate,actual_number,print_position,goods_roll_width,update_date,update_by,printLayout
  929. from plm_bm_Printing where site=#{site} and code_no=#{codeNo}
  930. </select>
  931. <insert id="saveBMPrintingDetail">
  932. insert into plm_bm_Printing (site,code_no,colour_match,conditions,colour_indicat,customer_file,glossiness_requirement,comments,repeat,vp,label_size,
  933. down,plate_distortion_rate,actual_number,print_position,goods_roll_width,update_date,update_by,printLayout)
  934. values(#{site},#{codeNo},#{colourMatch},#{conditions},#{colourIndicat},#{customerFile},#{glossinessRequirement},#{comments},
  935. #{repeat},#{vp},#{labelSize},#{down},#{plateDistortionRate},#{actualNumber},#{printPosition},#{goodsRollWidth},
  936. GetDate(),#{updateBy},#{printLayout})
  937. </insert>
  938. <update id="updateBMPrintingDetail">
  939. update plm_bm_Printing set printLayout=#{printLayout},colour_match=#{colourMatch},conditions=#{conditions},colour_indicat=#{colourIndicat},customer_file=#{customerFile},glossiness_requirement=#{glossinessRequirement},comments=#{comments},
  940. 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}
  941. </update>
  942. <select id="searchBMPrintingColor" resultType="PlmBmPrintingColorData">
  943. select site,code_no,[order],ink_type,color_reference,color_match,bcm,speed,dry,gallus,mark_andy,lp,Hexiang,update_date,update_by,
  944. id
  945. from plm_bm_PrintingColor where site=#{site} and code_no=#{codeNo} order by [order]
  946. </select>
  947. <insert id="saveBMPrintingColor">
  948. 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)
  949. values(#{site},#{codeNo},#{order},#{inkType},#{colorReference},#{colorMatch},#{bcm},#{speed},#{dry},#{gallus},#{markAndy},#{lp},#{hexiang},#{updateBy},GetDate())
  950. </insert>
  951. <update id="updateBMPrintingColor">
  952. update plm_bm_PrintingColor set [order]=#{order},ink_type=#{inkType},[color_reference]=#{colorReference},color_match=#{colorMatch},bcm=#{bcm},
  953. speed=#{speed},dry=#{dry},gallus=#{gallus},mark_andy=#{markAndy},lp=#{lp},Hexiang=#{hexiang},
  954. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  955. </update>
  956. <delete id="deleteBMPrintingColor">
  957. delete from plm_bm_PrintingColor where id=#{id}
  958. </delete>
  959. <select id="checkPlmBmPrintingColorOrder" resultType="PlmBmPrintingColorData">
  960. select site from plm_bm_PrintingColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  961. </select>
  962. <select id="getBomNowRevNo" resultType="com.spring.modules.part.entity.BomHeaderEntity">
  963. select top 1 eng_chg_level,bom_type,site,part_no
  964. from plm_bom_header
  965. where site=#{site} and part_no=#{partNo}
  966. and GetDate()>eff_phase_in_date and isnull(eff_phase_out_date, DATEADD(d, 1, GETDATE())) >GetDate()
  967. </select>
  968. <select id="getTopOneBomAlternativeNo" resultType="com.spring.modules.part.entity.BomDetailEntity">
  969. select top 1 site,part_no,alternative_no,alternative_description,bom_type,eng_chg_level
  970. from plm_bom_detail where site=#{site} and part_no=#{partNo} and bom_type=#{bomType} and eng_chg_level=#{engChgLevel}
  971. </select>
  972. <select id="getRouteNowRevNo" resultType="com.spring.modules.part.entity.RoutingHeaderEntity">
  973. select top 1 site,part_no,routing_revision,routing_type
  974. from plm_routing_header
  975. where site=#{site} and part_no=#{partNo} and GetDate()>phase_in_date and isnull(phase_out_date, DATEADD(d, 1, GETDATE())) >GetDate()
  976. </select>
  977. <select id="getTopOneRouteAlternativeNo" resultType="com.spring.modules.part.entity.RoutingDetailEntity">
  978. select top 1 site,part_no,routing_revision,routing_type,alternative_no,alternative_description
  979. from plm_routing_detail
  980. where site=#{site} and part_no=#{partNo} and routing_type=#{routingType} and routing_revision=#{routingRevision}
  981. </select>
  982. <select id="getBMBomDetail" resultType="com.spring.modules.part.entity.BomDetailEntity">
  983. select a.site, a.bom_type, a.eng_chg_level, a.bom_alternative_no alternativeNo, b.final_part_no partNo
  984. from plm_technical_specification_sheet a
  985. left join view_Project_final_Part b on a.site = b.site and a.test_part_no = b.test_part_no
  986. left join plm_bom_detail c
  987. on a.site = c.site and b.final_part_no = c.part_no and a.eng_chg_level = c.eng_chg_level
  988. and a.bom_alternative_no = c.alternative_no and a.bom_type = c.bom_type
  989. where a.site = #{site}
  990. and a.code_no = #{codeNo}
  991. and a.project_id = b.project_id
  992. and c.status = 'Buildable'
  993. </select>
  994. <select id="getBMRouteDetail" resultType="com.spring.modules.part.entity.RoutingDetailEntity">
  995. select a.site, a.routing_type, a.routing_revision, a.routing_alternative_no alternativeNo, b.final_part_no partNo
  996. from plm_technical_specification_sheet a
  997. left join view_Project_final_Part b on a.site = b.site and a.test_part_no = b.test_part_no
  998. left join plm_routing_detail c
  999. on a.site = c.site and b.final_part_no = c.part_no AND a.routing_revision = c.routing_revision
  1000. and a.routing_alternative_no = c.alternative_no and a.routing_type = c.routing_type
  1001. where a.site = #{site}
  1002. and a.code_no = #{codeNo}
  1003. and a.project_id = b.project_id
  1004. and c.status = 'Buildable'
  1005. </select>
  1006. <select id="searchBMBomDetail" resultType="com.spring.modules.part.vo.BomDetailVo">
  1007. select a.site,
  1008. a.part_no,
  1009. b.alternative_no,
  1010. b.alternative_description,
  1011. a.bom_type,
  1012. a.eng_chg_level,
  1013. b.min_lot_qty,
  1014. b.default_flag,
  1015. a.note_text,
  1016. a.create_date,
  1017. a.create_by,
  1018. a.update_date,
  1019. a.update_by,
  1020. b.status,
  1021. a.official_flag,
  1022. a.eff_phase_in_date,
  1023. a.eff_phase_out_date
  1024. from plm_bom_header a
  1025. left join plm_bom_detail b
  1026. on a.site = b.site and a.part_no = b.part_NO and a.bom_type = b.bom_type AND A.eng_chg_level = B.eng_chg_level
  1027. where a.part_no = #{partNo}
  1028. and a.site = #{site}
  1029. and a.bom_type != 'Repair'
  1030. and b.status = 'Buildable'
  1031. </select>
  1032. <update id="updateBMBomRev">
  1033. update plm_technical_specification_sheet set bom_type=#{bomType},eng_chg_level=#{engChgLevel,jdbcType=INTEGER},
  1034. bom_alternative_no=#{bomAlternativeNo} where site=#{site} and code_no=#{codeNo}
  1035. </update>
  1036. <update id="updateBMRouteRev">
  1037. update plm_technical_specification_sheet set routing_type=#{routingType},routing_revision=#{routingRevision,jdbcType=INTEGER},
  1038. routing_alternative_no=#{routingAlternativeNo} where site=#{site} and code_no=#{codeNo}
  1039. </update>
  1040. <select id="searchRouteDetail" resultType="com.spring.modules.part.vo.RoutingDetailVo">
  1041. select a.site,
  1042. a.part_no,
  1043. a.routing_revision,
  1044. a.routing_type,
  1045. b.alternative_no,
  1046. b.alternative_description,
  1047. b.status,
  1048. a.official_flag,
  1049. a.phase_in_date,
  1050. a.phase_out_date
  1051. from plm_routing_header a
  1052. left join plm_routing_detail b
  1053. on a.site = b.site and a.part_no = b.part_NO and a.routing_type = b.routing_type AND A.routing_revision = B.routing_revision
  1054. where a.site = #{site}
  1055. and a.part_no = #{partNo}
  1056. and a.routing_type != 'Repair'
  1057. and b.status = 'Buildable'
  1058. </select>
  1059. <select id="searchBMRemarkPage" resultType="PlmTechnicalSpecificationSheetData">
  1060. select site,remarkPage,code_no from plm_technical_specification_sheet where site=#{site} and code_no=#{codeNo}
  1061. </select>
  1062. <update id="updateBMRemarkPage">
  1063. update plm_technical_specification_sheet set remarkPage=#{remarkPage} where site=#{site} and code_no=#{codeNo}
  1064. </update>
  1065. <select id="searchPartLastQuotationNo" resultType="com.spring.modules.quotation.entity.QuotationHeader">
  1066. select top 1 a.site,a.quotation_no
  1067. from quotation_header a left join quotation_detail b on a.quotation_header_id=b.quotation_header_id
  1068. where b.site=#{site} and b.product_no=#{productNo} order by a.create_time desc
  1069. </select>
  1070. <select id="getSysProxyAddress" resultType="SysProxyAddress">
  1071. select physicalAddress,proxyAddress,remark from sys_proxy_address
  1072. </select>
  1073. <select id="searchBMprintFlexoColor" resultType="PlmBmPrintFlexoColorData">
  1074. select id,site,codeNo,printSide,[order],colorReference,inkCode,colorMatch,lpi,bcm,openFlag,gallus,markAndy,hexiang,temperature,
  1075. pressure,updateDate,updateBy from plm_bm_printFlexoColor
  1076. where site=#{site} and codeNo=#{codeNo}
  1077. order by printSide desc,[order]
  1078. </select>
  1079. <select id="checkBMprintFlexoColorOrder" resultType="PlmBmPrintFlexoColorData">
  1080. select id,site,codeNo,printSide,[order] from plm_bm_printFlexoColor
  1081. where site=#{site} and codeNo=#{codeNo} and printSide=#{printSide} and [order]=#{order}
  1082. </select>
  1083. <insert id="saveBMprintFlexoColor" >
  1084. insert into plm_bm_printFlexoColor(site,codeNo,printSide,[order],colorReference,inkCode,colorMatch,lpi,bcm,openFlag,gallus,markAndy,hexiang,temperature,
  1085. pressure,updateDate,updateBy,remark) values
  1086. (#{site},#{codeNo},#{printSide},#{order},#{colorReference},#{inkCode},#{colorMatch},#{lpi},#{bcm},#{openFlag},#{gallus},
  1087. #{markAndy},#{hexiang},#{temperature},#{pressure},GetDate(),#{updateBy},#{remark})
  1088. </insert>
  1089. <update id="updateBMprintFlexoColor" >
  1090. update plm_bm_printFlexoColor set printSide=#{printSide},[order]=#{order,jdbcType=INTEGER},colorReference=#{colorReference},inkCode=#{inkCode},
  1091. colorMatch=#{colorMatch},lpi=#{lpi},bcm=#{bcm},openFlag=#{openFlag},gallus=#{gallus},markAndy=#{markAndy},hexiang=#{hexiang},temperature=#{temperature},
  1092. pressure=#{pressure},updateDate=GetDate(),updateBy=#{updateBy},remark=#{remark} where id=#{id}
  1093. </update>
  1094. <delete id="deleteBMprintFlexoColor">
  1095. delete from plm_bm_printFlexoColor where id=#{id}
  1096. </delete>
  1097. <select id="searchBMprintIndigoColor" resultType="PlmBmPrintIndigoColorData">
  1098. select id,code_no,site,[order],printSide,colorReference,inkCode,colorMatch,printMotion,opticalDensity,lut,lpi,screenAngle,printHits,
  1099. blanketTemperture,remark,updateBy,updateDate from plm_bm_printIndigoColor
  1100. where site=#{site} and code_no=#{codeNo}
  1101. order by printSide desc,[order]
  1102. </select>
  1103. <select id="checkBMprintIndigoColorOrder" resultType="PlmBmPrintIndigoColorData">
  1104. select id,site,code_no,printSide,[order] from plm_bm_printIndigoColor
  1105. where site=#{site} and code_no=#{codeNo} and printSide=#{printSide} and [order]=#{order}
  1106. </select>
  1107. <insert id="saveBMprintIndigoColor" >
  1108. insert into plm_bm_printIndigoColor(site,code_no,[order],printSide,colorReference,inkCode,colorMatch,printMotion,opticalDensity,lut,lpi,screenAngle,printHits,
  1109. blanketTemperture,remark,updateBy,updateDate) values
  1110. (#{site},#{codeNo},#{order},#{printSide},#{colorReference},#{inkCode},#{colorMatch},#{printMotion},#{opticalDensity},#{lut},#{lpi},
  1111. #{screenAngle},#{printHits},#{blanketTemperture},#{remark},#{updateBy},GetDate())
  1112. </insert>
  1113. <update id="updateBMprintIndigoColor" >
  1114. update plm_bm_printIndigoColor set printSide=#{printSide},[order]=#{order,jdbcType=INTEGER},colorReference=#{colorReference},inkCode=#{inkCode},
  1115. colorMatch=#{colorMatch},printMotion=#{printMotion},opticalDensity=#{opticalDensity},lut=#{lut},lpi=#{lpi},screenAngle=#{screenAngle},printHits=#{printHits},blanketTemperture=#{blanketTemperture},
  1116. remark=#{remark},updateDate=GetDate(),updateBy=#{updateBy} where id=#{id}
  1117. </update>
  1118. <delete id="deleteBMprintIndigoColor">
  1119. delete from plm_bm_printIndigoColor where id=#{id}
  1120. </delete>
  1121. <select id="selectTechnicalSpecification" resultType="PlmTechnicalSpecificationSheet">
  1122. SELECT
  1123. id,site,code_no,proofing_no,project_id,test_part_no,status,rev_no,work_center_no,ECN_flag,ECN_no,ECN_address,remark,
  1124. create_date,create_by,update_date,update_by,picture_addess,customerPictureChangeRemark,productionFileComments,
  1125. ori_code_no,bom_type,eng_chg_level,bom_alternative_no,routing_type,routing_revision,routing_alternative_no,remarkPage,
  1126. process,stage,materialType,cqcOperator,faiOperator,overPrintOperator,printOperator,peOperater,csOperater,
  1127. step_id,reject_flag,reject_step_id,mpOperator,pod
  1128. FROM plm_technical_specification_sheet a
  1129. where a.site = #{site} and a.code_no = #{codeNo}
  1130. </select>
  1131. <update id="updateStatus" parameterType="PlmTechnicalSpecificationSheetData">
  1132. update plm_technical_specification_sheet
  1133. set status = #{status},
  1134. update_date = getDate(),
  1135. update_by = #{userName}
  1136. where site = #{site} and code_no = #{codeNo}
  1137. </update>
  1138. <select id="selectTechnicalSpecificationTeam" parameterType="string" resultType="PlmTechnicalSpecificationTeamData">
  1139. SELECT
  1140. a.site,
  1141. a.code_no,
  1142. a.operator_id,
  1143. a.type,
  1144. b.domain_control_account
  1145. FROM plm_technicalSpecification_team as a
  1146. left join sys_user as b on a.operator_id = b.username
  1147. where a.site = #{site} and a.code_no = #{codeNo}
  1148. </select>
  1149. <select id="getBMStatusDesc" resultType="PlmTechnicalSpecificationSheetData">
  1150. SELECT
  1151. id,site,code_no,dbo.plm_get_technicalBaseDesc(a.status,'status') statusDesc
  1152. FROM plm_technical_specification_sheet a
  1153. where a.site = #{site} and a.code_no = #{codeNo}
  1154. </select>
  1155. <select id="getFinalPartData" resultType="PlmProjectPartData">
  1156. Select
  1157. a.Final_Part_No,
  1158. a.Test_part_no,
  1159. a.Active,
  1160. a.Part_desc,
  1161. a.project_id,
  1162. pcpi.customer_part_no,
  1163. a.bu_no
  1164. from view_Project_final_Part a
  1165. left join plm_project_info c on a.site = c.site and a.project_id = c.project_id
  1166. left join plm_customer_part_info pcpi on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no
  1167. <where>
  1168. and a.site = #{query.site}
  1169. <if test="query.projectId!= null and query.projectId != ''">
  1170. AND a.project_id like #{query.projectId}
  1171. </if>
  1172. <if test="query.finalPartNo != null and query.finalPartNo != ''">
  1173. AND a.Final_Part_No like #{query.finalPartNo}
  1174. </if>
  1175. <if test="query.customerPartNo!= null and query.customerPartNo != ''">
  1176. AND pcpi.customer_part_no like #{query.customerPartNo}
  1177. </if>
  1178. <if test="query.testPartNo != null and query.testPartNo != ''">
  1179. AND a.Test_part_no like #{query.testPartNo}
  1180. </if>
  1181. <if test="query.partDesc!= null and query.partDesc != ''">
  1182. AND a.Part_desc like #{query.partDesc}
  1183. </if>
  1184. and a.RealFlag = 'Y'
  1185. </where>
  1186. </select>
  1187. <select id="getOADetailForBM" resultType="PlmTechnicalSpecificationSheetData">
  1188. select
  1189. top 1
  1190. d.is_reject,
  1191. d.node_id,
  1192. d.node_name,
  1193. dbo.get_plm_Approval_username (a.site, prh.workflow_id,d.node_id,a.code_no) as sp
  1194. from plm_technical_specification_sheet a
  1195. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'
  1196. left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and prh.workflow_id = d.workflow_id and a.step_id = d.step_id
  1197. where a.site=#{site} and a.code_no=#{codeNo}
  1198. </select>
  1199. <select id="searchCopyPart" resultType="PlmProjectPartData">
  1200. Select a.Final_Part_No,a.Test_part_no,a.Active, a.Part_desc ,a.project_id,pcpi.customer_part_no,a.bu_no
  1201. from plm_project_info c
  1202. left join view_Project_Part a on a.site = c.site and a.project_id = c.project_id
  1203. left join plm_customer_part_info pcpi on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no
  1204. left join part p on a.Final_Part_No = p.part_no
  1205. left join plm_technical_specification_sheet ps on a.site=ps.site and a.Test_part_no=ps.Test_part_no
  1206. where a.project_id=#{projectId} and a.site=#{site} and a.Test_part_no!=#{testPartNo} and a.realFlag='Y' and ps.Test_part_no is null
  1207. and dbo.Get_PartHasRealBOMRoute(a.site,a.Final_Part_No) ='Y'
  1208. </select>
  1209. <select id="queryCustomerPartNo" resultType="java.lang.String">
  1210. select top 1 pcpi.customer_part_no
  1211. from plm_customer_part_info pcpi
  1212. where pcpi.site = #{site}
  1213. and pcpi.customer_no = #{customerId}
  1214. and pcpi.part_no = #{partNo}
  1215. </select>
  1216. <insert id="saveCustomerPartNo">
  1217. insert into plm_customer_part_info(site, customer_no, part_no, customer_part_no, create_date, create_by)
  1218. values (#{site},#{customerId},#{partNo},#{customerPartNo},getdate(),#{username})
  1219. </insert>
  1220. <update id="updateCustomerPartNo">
  1221. update plm_customer_part_info
  1222. set customer_part_no = #{customerPartNo},
  1223. update_by = #{username},
  1224. update_date = getdate()
  1225. where site = #{site}
  1226. and customer_no = #{customerId}
  1227. and part_no = #{partNo}
  1228. </update>
  1229. <select id="technicalSpecificationList"
  1230. resultType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
  1231. SELECT a.id,
  1232. a.site,
  1233. a.code_no as codeNo,
  1234. a.project_id as projectId,
  1235. a.test_part_no as testPartNo,
  1236. a.status,
  1237. a.rev_no as revNo,
  1238. a.work_center_no as workCenterNo,
  1239. a.ECN_flag as ecnFlag,
  1240. a.ECN_no as ecnNo,
  1241. a.ori_code_no as oriCodeNo,
  1242. a.ECN_address as ecnAddress,
  1243. a.remark,
  1244. a.create_date as createDate,
  1245. a.create_by as createBy,
  1246. a.update_date as updateDate,
  1247. a.update_by as updateBy,
  1248. b.final_part_no as finalPartNo,
  1249. b.part_type as partTypeDesc,
  1250. b.part_type as partType,
  1251. b.part_name as partName,
  1252. b.part_desc as partDesc,
  1253. b.part_spec as partSpec,
  1254. dbo.plm_get_technicalBaseDesc(a.status, 'status') as statusDesc,
  1255. a.proofing_no as proofingNo,
  1256. b.bu_no as buNo,
  1257. dbo.plm_get_bu_desc(a.site, b.bu_no) as buDesc,
  1258. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'engineer') as engineer,
  1259. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'technician') as technician,
  1260. process,
  1261. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'quotationOfficer') as quotationOfficer,
  1262. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'engineer') as engineerNo,
  1263. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'technician') as technicianNo,
  1264. c.customer_Id as customerId,
  1265. a.picture_addess as pictureAddess,
  1266. a.customerPictureChangeRemark,
  1267. a.productionFileComments,
  1268. a.bom_type as bomType,
  1269. a.eng_chg_level as engChgLevel,
  1270. a.bom_alternative_no as bomAlternativeNo,
  1271. a.routing_type as routingType,
  1272. a.routing_revision as routingRevision,
  1273. a.routing_alternative_no as routingAlternativeNo,
  1274. a.pod,
  1275. a.mpOperator,
  1276. dbo.get_userDisPlay(a.mpOperator) as mpOperatorName,
  1277. a.peOperater,
  1278. dbo.get_userDisPlay(a.peOperater) as peOperaterName,
  1279. a.csOperater,
  1280. dbo.get_userDisPlay(a.csOperater) as csOperaterName,
  1281. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'dcc') as dccOperaterName,
  1282. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'cqc') as cqcOperatorName,
  1283. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'fai') as faiOperatorName,
  1284. <!-- a.cqcOperator,-->
  1285. <!-- dbo.get_userDisPlay(a.cqcOperator) as cqcOperatorName,-->
  1286. <!-- a.faiOperator,-->
  1287. <!-- dbo.get_userDisPlay(a.faiOperator) as faiOperatorName,-->
  1288. d.is_reject as isReject,
  1289. d.node_id as nodeId,
  1290. d.node_name as nodeName,
  1291. pcpi.customer_part_no as customerPartNo,
  1292. dbo.get_plm_Approval_username(a.site, prh.workflow_id, d.node_id, a.code_no) as sp,
  1293. a.remarkPage,
  1294. a.rev,
  1295. a.customer_rev as customerRev,
  1296. b.plm_part_no as plmPartNo,
  1297. c.project_name as projectName
  1298. FROM plm_technical_specification_sheet a
  1299. left join view_Project_final_Part b
  1300. on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no
  1301. left join plm_project_info c on a.site = c.site and a.project_id = c.project_id
  1302. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'
  1303. left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and
  1304. prh.workflow_id = d.workflow_id and a.step_id = d.step_id
  1305. left join plm_customer_part_info pcpi
  1306. on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no
  1307. <if test="cutterNumber != null and cutterNumber != ''">
  1308. inner join plm_bm_prepress pbp on pbp.Site = a.site and pbp.code_no = a.code_no and
  1309. (plateNo like #{cutterNumber} or
  1310. cutterNumber like #{cutterNumber})
  1311. </if>
  1312. <where>
  1313. <if test="id != null">
  1314. AND a.id = #{id}
  1315. </if>
  1316. <if test="site != null and site != ''">
  1317. AND a.site = #{site}
  1318. </if>
  1319. <if test="ecnFlag != null and ecnFlag != ''">
  1320. AND a.ecn_flag = #{ecnFlag}
  1321. </if>
  1322. <if test="oriCodeNo != null and oriCodeNo != ''">
  1323. AND a.ori_code_no like #{oriCodeNo}
  1324. </if>
  1325. <if test="codeNo != null and codeNo != ''">
  1326. AND a.code_no like #{codeNo}
  1327. </if>
  1328. <if test="projectId != null and projectId != ''">
  1329. AND a.project_id like #{projectId}
  1330. </if>
  1331. <if test="testPartNo != null and testPartNo != ''">
  1332. AND (
  1333. a.test_part_no like #{testPartNo} or
  1334. b.final_part_no like #{testPartNo} or
  1335. a.relevance_part_no like #{testPartNo} or
  1336. pcpi.customer_part_no like #{testPartNo}
  1337. )
  1338. </if>
  1339. <if test="customerDesc != null and customerDesc != ''">
  1340. AND (
  1341. dbo.plm_get_customer_desc(c.site, c.customer_id) like #{customerDesc})
  1342. </if>
  1343. <if test="status == null or status == ''">
  1344. and a.status != 'death'
  1345. </if>
  1346. <if test="statusDesc != null and statusDesc != ''">
  1347. <!-- AND dbo.plm_get_technicalBaseDesc(a.status, 'status') like #{statusDesc}-->
  1348. and a.status = #{statusDesc}
  1349. </if>
  1350. <if test="buNo == null || buNo == ''">
  1351. AND b.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(#{site}, #{userName}))
  1352. </if>
  1353. <if test="buNo != null and buNo != ''">
  1354. AND b.bu_no like #{buNo}
  1355. </if>
  1356. </where>
  1357. order by a.ori_code_no desc, a.rev_no desc
  1358. </select>
  1359. <select id="queryTechnicalSpecificationCount" resultType="long">
  1360. SELECT
  1361. count(1)
  1362. FROM plm_technical_specification_sheet a
  1363. left join view_Project_final_Part b
  1364. on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no
  1365. left join plm_project_info c on a.site = c.site and a.project_id = c.project_id
  1366. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'
  1367. left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and
  1368. prh.workflow_id = d.workflow_id and a.step_id = d.step_id
  1369. left join plm_customer_part_info pcpi
  1370. on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no
  1371. <if test="cutterNumber != null and cutterNumber != ''">
  1372. inner join plm_bm_prepress pbp on pbp.Site = a.site and pbp.code_no = a.code_no and
  1373. (plateNo like #{cutterNumber} or
  1374. cutterNumber like #{cutterNumber})
  1375. </if>
  1376. <where>
  1377. <if test="id != null">
  1378. AND a.id = #{id}
  1379. </if>
  1380. <if test="site != null and site != ''">
  1381. AND a.site = #{site}
  1382. </if>
  1383. <if test="ecnFlag != null and ecnFlag != ''">
  1384. AND a.ecn_flag = #{ecnFlag}
  1385. </if>
  1386. <if test="oriCodeNo != null and oriCodeNo != ''">
  1387. AND a.ori_code_no like #{oriCodeNo}
  1388. </if>
  1389. <if test="codeNo != null and codeNo != ''">
  1390. AND a.code_no like #{codeNo}
  1391. </if>
  1392. <if test="projectId != null and projectId != ''">
  1393. AND a.project_id like #{projectId}
  1394. </if>
  1395. <if test="testPartNo != null and testPartNo != ''">
  1396. AND (
  1397. a.test_part_no like #{testPartNo} or
  1398. b.final_part_no like #{testPartNo} or
  1399. a.relevance_part_no like #{testPartNo} or
  1400. pcpi.customer_part_no like #{testPartNo}
  1401. )
  1402. </if>
  1403. <if test="customerDesc != null and customerDesc != ''">
  1404. AND (
  1405. dbo.plm_get_customer_desc(c.site, c.customer_id) like #{customerDesc} or
  1406. dbo.plm_get_dictDataLabel('finalCustomer', c.final_customer_id, c.site) like #{customerDesc}
  1407. )
  1408. </if>
  1409. <if test="statusDesc != null and statusDesc != ''">
  1410. AND dbo.plm_get_technicalBaseDesc(a.status, 'status') like #{statusDesc}
  1411. </if>
  1412. <if test="buNo == null || buNo == ''">
  1413. AND b.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(#{site}, #{userName}))
  1414. </if>
  1415. <if test="buNo != null and buNo != ''">
  1416. AND b.bu_no like #{buNo}
  1417. </if>
  1418. </where>
  1419. </select>
  1420. <select id="queryTechnicalSpecificationList"
  1421. resultType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
  1422. EXEC dbo.getTechnicalSpecificationPageWithSql #{sql}, #{page}, #{limit}
  1423. </select>
  1424. <select id="queryChangeLog" resultType="com.spring.modules.change.vo.ChangeRequestVo">
  1425. SELECT a.site,
  1426. a.bu_no,
  1427. a.change_no,
  1428. a.applicant_id,
  1429. dbo.get_userDisPlay(a.applicant_id) as applicantName,
  1430. b.department_no as applicationDepartmentId,
  1431. dbo.get_department_name(a.site, b.department_no) as applicationDepartmentName,
  1432. a.apply_date,
  1433. a.ecn_type,
  1434. a.change_impact,
  1435. a.change_impact_desc,
  1436. a.ecn_stage,
  1437. a.change_type,
  1438. a.tp_engineer_id,
  1439. dbo.get_userDisPlay(a.tp_engineer_id) as tpEngineerName,
  1440. a.change_phase_in_date,
  1441. a.df_is_product,
  1442. a.printing,
  1443. a.manufacturing_cost_is_change,
  1444. a.change_request_desc,
  1445. a.is_re_quote,
  1446. a.ul_certification_requirements,
  1447. a.ul_continue_to_meet_demand,
  1448. a.gp_certification_requirements,
  1449. a.gp_continue_to_meet_demand,
  1450. a.create_date,
  1451. a.create_by,
  1452. a.update_date,
  1453. a.update_by,
  1454. a.industrial_engineer_id,
  1455. dbo.get_userDisPlay(a.industrial_engineer_id) as industrialEngineerName,
  1456. a.change_status,
  1457. a.cqc_operator_id,
  1458. dbo.get_userDisPlay(a.cqc_operator_id) as cqcOperatorName,
  1459. a.fai_operator_id,
  1460. dbo.get_userDisPlay(a.fai_operator_id) as faiOperatorName,
  1461. a.step_id,
  1462. a.reject_flag,
  1463. a.reject_step_id
  1464. FROM plm_change_request a
  1465. LEFT JOIN sys_user as b on a.site = b.site and a.applicant_id = b.username
  1466. left join plm_change_request_detail pcrd on a.site = pcrd.site and a.change_no = pcrd.change_no
  1467. where a.site = #{site} and a.show_in_query_flag = 'Y' and pcrd.code_no IN (SELECT code_no FROM plm_technical_specification_sheet WHERE site = #{site} AND ori_code_no = #{codeNo})
  1468. </select>
  1469. </mapper>