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.

2829 lines
120 KiB

2 years ago
9 months ago
8 months ago
1 year ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
2 years ago
8 months ago
8 months ago
2 years ago
8 months ago
2 years ago
8 months ago
2 years ago
8 months ago
2 years ago
8 months ago
2 years ago
8 months ago
2 years ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
1 year ago
8 months ago
1 year ago
8 months ago
1 year ago
1 year ago
1 year ago
8 months ago
1 year ago
1 year ago
1 year ago
1 year ago
8 months ago
1 year ago
1 year ago
1 year ago
1 year ago
8 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
8 months ago
8 months ago
1 year ago
10 months ago
8 months ago
10 months ago
9 months ago
8 months ago
9 months ago
8 months ago
8 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
9 months ago
8 months ago
8 months ago
9 months ago
8 months ago
8 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
9 months ago
8 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
9 months ago
9 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 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
  199. (site, code_no, project_id, test_part_no, status, rev_no, ECN_flag, ECN_no, ECN_address, remark,
  200. create_date, create_by, proofing_no, ori_code_no, bom_type, eng_chg_level, bom_alternative_no,
  201. routing_type, routing_revision, routing_alternative_no, stage, materialType, step_id, cqcOperator,
  202. faiOperator, peOperater, csOperater, mpOperator, rev, customer_rev, certification, document_source)
  203. values
  204. (#{site}, #{codeNo}, #{projectId}, #{testPartNo}, #{status}, #{revNo}, #{ecnFlag}, #{ecnNo}, #{ecnAddress}, #{remark},
  205. GetDate(), #{createBy}, #{proofingNo}, #{oriCodeNo}, #{bomType}, #{engChgLevel,jdbcType=INTEGER}, #{bomAlternativeNo},
  206. #{routingType}, #{routingRevision,jdbcType=INTEGER}, #{routingAlternativeNo}, 'Sample', 'Label', 10, #{cqcOperator},
  207. #{faiOperator}, #{peOperater}, #{csOperater}, #{mpOperator}, #{rev}, #{customerRev}, 'RoHs', '新增')
  208. </insert>
  209. <update id="updateProjectPartNowBm">
  210. update plm_project_part
  211. set now_bm = #{codeNo}
  212. where site = #{site} and project_id = #{projectId} and test_part_no = #{testPartNo}
  213. </update>
  214. <insert id="saveTechnicalSpecificationTeams">
  215. insert into plm_technicalSpecification_team (site, code_no, operator_id, type)
  216. values (#{site}, #{codeNo}, #{operatorId}, #{type})
  217. </insert>
  218. <insert id="saveBatchTechnicalSpecificationTeams">
  219. insert into plm_technicalSpecification_team (site, code_no, operator_id, type)
  220. values
  221. <foreach collection="list" item="item" separator=",">
  222. (#{item.site}, #{item.codeNo}, #{item.operatorId}, #{item.type})
  223. </foreach>
  224. </insert>
  225. <update id="updateTechnicalSpecificationSheet">
  226. update plm_technical_specification_sheet
  227. set project_id = #{projectId},
  228. test_part_no = #{testPartNo},
  229. status = #{status},
  230. rev_no = #{revNo},
  231. ECN_no = #{ecnNo},
  232. ECN_flag = #{ecnFlag},
  233. ECN_address = #{ecnAddress},
  234. remark = #{remark},
  235. update_date = GetDate(),
  236. update_by = #{updateBy},
  237. cqcOperator = #{cqcOperator},
  238. faiOperator = #{faiOperator},
  239. peOperater = #{peOperater},
  240. csOperater = #{csOperater},
  241. mpOperator = #{mpOperator},
  242. rev = #{rev},
  243. customer_rev = #{customerRev}
  244. where id = #{id}
  245. </update>
  246. <delete id="deleteTechnicalSpecificationTeamsForBase">
  247. delete
  248. from plm_technicalSpecification_team
  249. where site = #{site}
  250. and code_no = #{codeNo}
  251. and type in ('quotationOfficer', 'engineer', 'technician', 'dcc', 'cqc', 'fai', 'cs', 'mp', 'plan')
  252. </delete>
  253. <delete id="deleteTechnicalSpecificationTeamsForDetail">
  254. delete
  255. from plm_technicalSpecification_team
  256. where site = #{site}
  257. and code_no = #{codeNo}
  258. and type in ('reviewEngineer', 'peEngineer', 'cqe')
  259. </delete>
  260. <select id="searchTechnicalSpecificationTeamStr" resultType="String">
  261. select operator_id
  262. from plm_technicalSpecification_team
  263. where type = #{type}
  264. and site = #{site}
  265. and code_no = #{codeNo}
  266. </select>
  267. <select id="getTechnicalCustomerInfoData" resultType="TechnicalCustomerInfoData">
  268. select a.id,
  269. b.customer_id,
  270. c.customer_desc as customerName,
  271. c.customer_description as customerDesc,
  272. b.customer_Remark,
  273. b.remark,
  274. a.picture_addess,
  275. a.customerPictureChangeRemark,
  276. a.productionFileComments
  277. from plm_technical_specification_sheet a
  278. left join plm_project_info b on a.site = b.site and a.project_id = b.project_id
  279. left join plm_customer_information c on b.site = c.site and b.customer_id = c.customer_no
  280. where a.id = #{id}
  281. </select>
  282. <select id="searchBMUser" resultType="PlmOperatorData">
  283. select a.username operator_id, a.user_display operator_name, b.site, b.bu_no as buNo
  284. from sys_user a
  285. left join AccessBu b on a.username = b.username
  286. <if test="roleNo != null and roleNo != ''">
  287. inner join AccessRole r on r.username = a.username and r.role_no = #{roleNo}
  288. </if>
  289. where b.bu_no = #{buNo}
  290. <if test="roleNo != null and roleNo != ''">
  291. and r.site = #{site}
  292. </if>
  293. and b.site = #{site}
  294. order by a.username desc
  295. </select>
  296. <select id="tsdBasicInformationSearch" resultType="PlmTechnicalSpecificationSheetData">
  297. SELECT
  298. top 1
  299. a.id,
  300. a.site,
  301. a.code_no,
  302. a.project_id,
  303. a.test_part_no,
  304. a.status,
  305. a.rev_no,
  306. a.work_center_no,
  307. a.ECN_flag,
  308. a.ECN_no,
  309. b.bu_no,
  310. a.ECN_address,
  311. a.remark,
  312. a.create_date,
  313. a.create_by,
  314. a.update_date,
  315. a.update_by,
  316. b.final_part_no,
  317. b.part_type partTypeDesc,
  318. b.part_type,
  319. b.part_name,
  320. b.part_desc,
  321. b.part_spec,
  322. dbo.plm_get_technicalBaseDesc(a.status, 'status') statusDesc,
  323. a.proofing_no,
  324. stage,
  325. dbo.plm_get_dictDataLabel('bm_process', process, a.site) process,
  326. remarkPage,
  327. c.customer_Id,
  328. a.ori_code_no,
  329. a.overPrintOperator,
  330. a.printOperator,
  331. dbo.get_userDisPlay(a.overPrintOperator) overPrintOperatorName,
  332. dbo.get_userDisPlay(a.printOperator) printOperatorName,
  333. isnull(a.step_id, 10) stepId,
  334. d.is_reject,
  335. a.pod,
  336. d.node_id,
  337. d.node_name,
  338. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'cs') csOperater,
  339. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'cs') csOperaterName,
  340. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'engineer') engineerNo,
  341. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'engineer') engineer,
  342. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'technician') technicianNo,
  343. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'technician') technician,
  344. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'mp') mpOperator,
  345. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'mp') mpOperatorName,
  346. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'dcc') dcc,
  347. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'cqc') cqcOperatorName,
  348. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'fai') faiOperatorName,
  349. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'plan') planOperator,
  350. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'plan') planOperatorName,
  351. a.rev,
  352. a.customer_rev,
  353. relevance_part_no,
  354. a.ecn_upgrade_version,
  355. a.ecn_upgrade_flag,
  356. a.ecn_need_change_drawing,
  357. a.document_source,
  358. a.shop_order,
  359. a.copy_flag
  360. FROM plm_technical_specification_sheet a
  361. 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
  362. left join plm_project_info c on a.site = c.site and a.project_id = c.project_id
  363. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'
  364. left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and prh.workflow_id = d.workflow_id and isnull(a.step_id, 10) = d.step_id
  365. where a.site = #{site} and a.code_no = #{codeNo}
  366. </select>
  367. <delete id="deleteTechnicalSpecificationList">
  368. delete
  369. from plm_technical_specification_sheet
  370. where id = #{id}
  371. </delete>
  372. <update id="updateBMProcess">
  373. update plm_technical_specification_sheet
  374. set process=#{process},
  375. overPrintOperator=#{overPrintOperator},
  376. printOperator=#{printOperator}
  377. where site = #{site}
  378. and code_no = #{codeNo}
  379. </update>
  380. <select id="getTestPartChangeData" resultType="PlmProjectPartData">
  381. select top 1 *
  382. from view_Project_final_Part
  383. where site = #{site}
  384. and test_part_no = #{testPartNo}
  385. </select>
  386. <select id="BMBasicInformationSearch" resultType="PlmTechnicalSpecificationSheetData">
  387. SELECT top 1 a.id,
  388. a.site,
  389. a.code_no,
  390. a.project_id,
  391. a.test_part_no,
  392. a.status,
  393. a.rev_no,
  394. a.work_center_no,
  395. a.ECN_flag,
  396. a.ECN_no,
  397. a.ECN_address,
  398. a.remark,
  399. a.create_date,
  400. a.create_by,
  401. a.update_date,
  402. a.update_by,
  403. b.final_part_no,
  404. b.part_type partTypeDesc,
  405. b.part_type,
  406. b.part_name,
  407. b.part_desc,
  408. b.part_spec,
  409. dbo.plm_get_technicalBaseDesc(a.status, 'status') statusDesc,
  410. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'engineer') engineer,
  411. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'technician') technician,
  412. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'quotationOfficer') quotationOfficer,
  413. c.customer_Id,
  414. a.proofing_no,
  415. a.ori_code_no
  416. FROM plm_technical_specification_sheet a
  417. left join view_Project_final_Part b
  418. on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no
  419. left join plm_project_info c on a.site = c.site and a.project_id = c.project_id
  420. where a.site = #{site}
  421. and a.code_no = #{codeNo}
  422. </select>
  423. <select id="getProofingDataByUserRole" resultType="PlmTechnicalSpecificationSheetData">
  424. SELECT a.site,
  425. a.proofing_no,
  426. a.project_id,
  427. a.test_part_no,
  428. dbo.plm_get_test_part_name(a.site, a.test_part_no) partName,
  429. dbo.plm_get_test_part_desc(a.site, a.test_part_no) partDesc,
  430. b.customer_id,
  431. b.final_customer_id,
  432. dbo.plm_get_customer_desc(a.site, b.customer_id) CustomerDesc,
  433. dbo.plm_get_dictDataLabel('finalCustomer', b.final_customer_id, a.site) finalCustomerDesc,
  434. b.project_name,
  435. d.bu_no
  436. from plm_proofing_information a
  437. left join plm_project_info b on a.site = b.site and a.project_id = b.project_id
  438. left join part as c on a.site = c.site and a.test_part_no = c.part_no
  439. left join plm_project_part d on a.site = d.site and a.test_part_no = d.test_part_no
  440. <where>
  441. and a.site = #{site}
  442. AND a.project_id in (select project_id
  443. from AccessProject
  444. where site = #{site} and username = #{username} and searchFlag = 'Y')
  445. <if test="proofingNo != null and proofingNo != ''">
  446. AND a.proofing_no like #{proofingNo}
  447. </if>
  448. <if test="projectId != null and projectId != ''">
  449. AND a.project_id like #{projectId}
  450. </if>
  451. <if test="customerId != null and customerId != ''">
  452. AND b.customer_id like #{customerId}
  453. </if>
  454. <if test="finalCustomerId != null and finalCustomerId != ''">
  455. AND b.final_customer_id like #{finalCustomerId}
  456. </if>
  457. and c.status = 'Y'
  458. </where>
  459. </select>
  460. <update id="updateBMBasicInformation">
  461. update plm_technical_specification_sheet
  462. set status = #{status},
  463. stage = #{stage},
  464. remarkPage = #{remarkPage},
  465. rev_no = #{revNo},
  466. ECN_no = #{ecnNo},
  467. ECN_flag = #{ecnFlag},
  468. ECN_address = #{ecnAddress},
  469. cqcOperator = #{cqcOperator},
  470. update_date = GetDate(),
  471. update_by = #{updateBy},
  472. faiOperator = #{faiOperator},
  473. peOperater = #{peOperater},
  474. csOperater = #{csOperater},
  475. pod = #{pod},
  476. mpOperator = #{mpOperator},
  477. relevance_part_no = #{relevancePartNo},
  478. ecn_need_change_drawing = #{ecnNeedChangeDrawing},
  479. shop_order = #{shopOrder},
  480. copy_flag = #{copyFlag}
  481. where site = #{site} and code_no = #{codeNo}
  482. </update>
  483. <select id="searchBMcustomerInfo" resultType="PlmTechnicalSpecificationSheetData">
  484. select a.site,
  485. a.code_no,
  486. a.picture_addess,
  487. a.customerPictureChangeRemark,
  488. a.productionFileComments,
  489. b.customer_id,
  490. dbo.plm_get_customer_desc(b.site, b.customer_id) CustomerDesc,
  491. b.final_customer_id finalCustomerNo,
  492. dbo.plm_get_dictDataLabel('finalCustomer', b.final_customer_id, a.site) finalCustomerDesc,
  493. c.final_part_no as part_no,
  494. c.part_desc,
  495. c.material_number,
  496. c.part_type as part_family,
  497. b.customer_remark,
  498. a.remark,
  499. a.ori_code_no,
  500. a.materialType,
  501. a.customerRevNo,
  502. a.materialNumber,
  503. a.certification,
  504. a.customerRemark,
  505. a.projectRemark,
  506. b.project_id,
  507. pcpi.customer_part_no
  508. from plm_technical_specification_sheet a
  509. left join plm_project_info b on a.site = b.site and a.project_id = b.project_id
  510. left join view_Project_final_Part c
  511. on a.site = c.site and a.test_part_no = c.test_part_no and a.project_id = c.project_id
  512. left join plm_customer_part_info pcpi
  513. on a.site = pcpi.site and a.test_part_no = pcpi.part_no and b.customer_id = pcpi.customer_no
  514. where a.site = #{site}
  515. and a.code_no = #{codeNo}
  516. </select>
  517. <update id="updateBMcustomerInfo">
  518. update plm_technical_specification_sheet
  519. set picture_Addess=#{pictureAddess},
  520. materialType=#{materialType},
  521. customerPictureChangeRemark=#{customerPictureChangeRemark},
  522. productionFileComments =#{productionFileComments},
  523. remark=#{remark},
  524. update_date=GetDate(),
  525. update_by=#{updateBy},
  526. certification=#{certification},
  527. customerRevNo=#{customerRevNo},
  528. materialNumber=#{materialNumber},
  529. customerRemark=#{customerRemark},
  530. projectRemark=#{projectRemark}
  531. where site = #{site}
  532. and code_no = #{codeNo}
  533. </update>
  534. <select id="searchBMPackageInfo" resultType="PlmBmPackageInfoData">
  535. select site,
  536. code_no,
  537. matrixStripped,
  538. appliedType,
  539. finalFormat,
  540. [rowCount],
  541. columnCount,
  542. missingAllowedFlag,
  543. rollPerQty,
  544. addingFilmFlag,
  545. packageRequest,
  546. coreType,
  547. coreDiameter,
  548. joinAllowedFlag,
  549. coreWidth,
  550. specialPositiorFlag,
  551. copyPosition,
  552. overprintingFlag,
  553. otherRequirement
  554. from plm_bm_packageInfo
  555. where site = #{site}
  556. and code_no = #{codeNo}
  557. </select>
  558. <update id="updateBMPackageInfo">
  559. update plm_bm_packageInfo
  560. set matrixStripped=#{matrixStripped},
  561. appliedType=#{appliedType},
  562. finalFormat=#{finalFormat},
  563. [rowCount]=#{rowCount,jdbcType=INTEGER},
  564. columnCount=#{columnCount,jdbcType=INTEGER},
  565. missingAllowedFlag=#{missingAllowedFlag},
  566. rollPerQty=#{rollPerQty,jdbcType=DECIMAL},
  567. addingFilmFlag=#{addingFilmFlag},
  568. packageRequest=#{packageRequest},
  569. coreType=#{coreType},
  570. coreDiameter=#{coreDiameter},
  571. joinAllowedFlag=#{joinAllowedFlag},
  572. coreWidth=#{coreWidth,jdbcType=DECIMAL},
  573. specialPositiorFlag=#{specialPositiorFlag},
  574. copyPosition=#{copyPosition},
  575. overprintingFlag=#{overprintingFlag},
  576. otherRequirement=#{otherRequirement},
  577. update_date=GetDate(),
  578. update_by=#{updateBy}
  579. where site = #{site}
  580. and code_no = #{codeNo}
  581. </update>
  582. <select id="saveBMPackageInfo">
  583. insert into plm_bm_packageInfo (site, code_no, matrixStripped, appliedType, finalFormat, [rowCount],
  584. columnCount, missingAllowedFlag, rollPerQty, addingFilmFlag,
  585. packageRequest, coreType, coreDiameter, joinAllowedFlag, coreWidth,
  586. specialPositiorFlag, copyPosition, overprintingFlag,
  587. otherRequirement, update_date, update_by)
  588. values (#{site}, #{codeNo}, #{matrixStripped}, #{appliedType}, #{finalFormat}, #{rowCount,jdbcType=INTEGER},
  589. #{columnCount,jdbcType=INTEGER},
  590. #{missingAllowedFlag}, #{rollPerQty,jdbcType=DECIMAL}, #{addingFilmFlag}, #{packageRequest},
  591. #{coreType}, #{coreDiameter}, #{joinAllowedFlag}, #{coreWidth,jdbcType=DECIMAL},
  592. #{specialPositiorFlag}, #{copyPosition}, #{overprintingFlag}, #{otherRequirement}, GetDate(),
  593. #{updateBy})
  594. </select>
  595. <select id="searchPartDataForSelect" resultType="com.spring.modules.part.vo.PartInformationVo">
  596. select top 100 a.erp_part_no, a.part_desc, a.family_id, a.spec, family_name
  597. from part a
  598. left join part_family b on a.site = b.site and a.family_id = b.family_id
  599. <where>
  600. and a.site = #{site}
  601. <if test="erpPartNo != null and erpPartNo != ''">
  602. AND a.erp_part_no like #{erpPartNo}
  603. </if>
  604. <if test="familyId != null and familyId != ''">
  605. AND a.family_id like #{familyId}
  606. </if>
  607. <if test="partDesc != null and partDesc != ''">
  608. AND a.part_desc like #{partDesc}
  609. </if>
  610. and a.erp_part_no is not null
  611. and a.erp_part_no != ''
  612. </where>
  613. </select>
  614. <insert id="saveBMBom">
  615. insert into plm_bm_bom (Site, code_no, erp_part_no, quantity, remark, create_by, create_date)
  616. values (#{site}, #{codeNo}, #{erpPartNo}, #{quantity}, #{remark}, #{username}, GetDate())
  617. </insert>
  618. <update id="updateBMBom">
  619. update plm_bm_bom
  620. set quantity=#{quantity,jdbcType=DECIMAL},
  621. remark=#{remark},
  622. update_by=#{username},
  623. update_date=GetDate()
  624. where Site = #{site}
  625. and code_no = #{codeNo}
  626. and erp_part_no = #{erpPartNo}
  627. </update>
  628. <select id="searchBMBom" resultType="PlmBmBomData">
  629. select a.Site,
  630. a.code_no,
  631. a.erp_part_no,
  632. a.quantity,
  633. a.remark,
  634. b.part_desc,
  635. b.spec,
  636. b.family_id,
  637. c.family_name
  638. from plm_bm_bom a
  639. left join part b on a.erp_part_no = b.erp_part_no and a.site = b.site
  640. left join part_family c on b.family_id = c.family_id and b.site = c.site
  641. <where>
  642. and a.site = #{site}
  643. <if test="erpPartNo != null and erpPartNo != ''">
  644. AND a.erp_part_no like #{erpPartNo}
  645. </if>
  646. <if test="codeNo != null and codeNo != ''">
  647. AND a.code_no like #{codeNo}
  648. </if>
  649. </where>
  650. </select>
  651. <delete id="deleteBMBom">
  652. delete
  653. from plm_bm_bom
  654. where code_no = #{codeNo}
  655. and site = #{site}
  656. and erp_part_no = #{erpPartNo}
  657. </delete>
  658. <select id="searchBMRoutingDetail" resultType="PlmBmRoutingData">
  659. SELECT a.Site,
  660. a.code_no,
  661. a.processDetail,
  662. a.supplyAdhesiveTape,
  663. a.routingDrawing,
  664. a.drawingRevison,
  665. a.drawingDate,
  666. a.workInfo,
  667. a.wiRevison,
  668. a.wiDate,
  669. a.routingRemark,
  670. a.routingAction,
  671. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'reviewEngineer') reviewEngineer,
  672. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'peEngineer') peEngineer,
  673. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'cqe') cqe
  674. FROM plm_bm_routing a
  675. where a.site = #{site}
  676. and a.code_no = #{codeNo}
  677. </select>
  678. <insert id="saveBMRoutingDetail">
  679. insert into plm_bm_routing (Site, code_no, processDetail, supplyAdhesiveTape, routingDrawing, drawingRevison,
  680. drawingDate, workInfo, wiRevison, wiDate,
  681. routingRemark, routingAction, update_by, update_date)
  682. values (#{site}, #{codeNo}, #{processDetail}, #{supplyAdhesiveTape}, #{routingDrawing}, #{drawingRevison},
  683. #{drawingDate}, #{workInfo}, #{wiRevison}, #{wiDate},
  684. #{routingRemark}, #{routingAction}, #{username}, GetDate())
  685. </insert>
  686. <update id="updateBMRoutingDetail">
  687. update plm_bm_routing
  688. set processDetail=#{processDetail},
  689. supplyAdhesiveTape=#{supplyAdhesiveTape},
  690. routingDrawing=#{routingDrawing},
  691. drawingRevison=#{drawingRevison},
  692. drawingDate=#{drawingDate},
  693. workInfo=#{workInfo},
  694. wiRevison=#{wiRevison},
  695. wiDate=#{wiDate},
  696. routingRemark=#{routingRemark},
  697. routingAction=#{routingAction},
  698. update_by=#{username},
  699. update_date=GetDate()
  700. where site = #{site}
  701. and code_no = #{codeNo}
  702. </update>
  703. <select id="checkPlmBmPropertiesValueHeaderData" resultType="PlmBmPropertiesValueHeaderData">
  704. select Site, bu_no, PartNo, CodeNo, SubCodeSeqNo, SubCodeDesc, RecordType
  705. from plm_bm_propertiesValueHeader
  706. where PartNo = #{codeNo}
  707. and site = #{site}
  708. and CodeNo = #{type}
  709. and bu_no = #{buNo}
  710. </select>
  711. <insert id="savePlmBmPropertiesValueHeaderData">
  712. insert into plm_bm_propertiesValueHeader(Site, bu_no, PartNo, CodeNo, SubCodeSeqNo, SubCodeDesc, RecordType)
  713. select #{site}, #{buNo}, #{codeNo}, #{type}, 1, code_desc, 'BM'
  714. from plm_bm_model_header
  715. where site = #{site}
  716. and bu_no = #{buNo}
  717. and function_type = 'BM'
  718. and code_no = #{type}
  719. </insert>
  720. <insert id="savePlmBmPropertiesValueData">
  721. insert into plm_bm_propertiesValue(Site, bu_no, PartNo, CodeNo, SubCodeSeqNo, SubCodeDesc, ItemNo,
  722. PropertiesItemNo, TextValue, NumValue, RecordType, order_id)
  723. select #{site},
  724. #{buNo},
  725. #{codeNo},
  726. #{type},
  727. 1,
  728. b.code_desc,
  729. a.seq_no,
  730. a.properties_item_no,
  731. c.DefaultValue,
  732. null,
  733. 'BM',
  734. a.order_id
  735. from plm_bm_model_header b
  736. left join plm_properties_model_detail a on a.site = #{site} and a.function_type = 'BM'
  737. and a.code_no = b.properties_code_no
  738. left join plm_properties_item c
  739. on a.properties_item_no = c.ItemNo and a.site = c.site and a.function_type = c.ItemType
  740. where b.site = #{site}
  741. and b.bu_no = #{buNo}
  742. and b.function_type = 'BM'
  743. and b.code_no = #{type}
  744. and a.code_no is not null
  745. </insert>
  746. <select id="searchBMPropertiesValue" resultType="PlmBmPropertiesValueData">
  747. select a.Site,
  748. a.bu_no,
  749. a.PartNo,
  750. a.CodeNo,
  751. a.SubCodeSeqNo,
  752. a.SubCodeDesc,
  753. a.ItemNo,
  754. a.PropertiesItemNo,
  755. a.TextValue,
  756. a.NumValue,
  757. a.RecordType,
  758. a.order_id,
  759. b.itemDesc,
  760. b.ValueType_DB,
  761. b.ValueChooseFlag
  762. from plm_bm_propertiesValue a
  763. left join plm_properties_item b
  764. on a.PropertiesItemNo = b.ItemNo and a.site = b.site and a.RecordType = b.ItemType
  765. where a.site = #{site}
  766. and a.bu_no = #{buNo}
  767. and a.RecordType = 'BM'
  768. and a.CodeNo = #{type}
  769. and a.PartNo = #{codeNo}
  770. order by a.order_id
  771. </select>
  772. <select id="getAvailableValueList" resultType="PlmPropertiesItemAvailableData">
  773. select ItemNo, ValueNo, AvailableValue
  774. from plm_properties_item_available
  775. where itemNo = #{propertiesItemNo}
  776. and site = #{site}
  777. and ItemType = 'BM'
  778. </select>
  779. <update id="updateBMPropertiesValue">
  780. update plm_bm_propertiesValue
  781. set NumValue=#{numValue,jdbcType=DOUBLE},
  782. TextValue=#{textValue}
  783. where site = #{site}
  784. and bu_no = #{buNo}
  785. and PartNo = #{partNo}
  786. and RecordType = #{recordType}
  787. and SubCodeSeqNo = #{subCodeSeqNo}
  788. and CodeNo = #{codeNo}
  789. and ItemNo = #{itemNo}
  790. </update>
  791. <select id="getBMPageBase" resultType="PlmBmPageBaseData">
  792. select bu_no, code_no
  793. from plm_bm_model_header
  794. where bu_no = #{buNo}
  795. and site = #{site}
  796. and active = 'Y'
  797. </select>
  798. <select id="searchBMRoute" resultType="com.spring.modules.part.vo.RoutingComponentVo">
  799. SELECT a.site,
  800. a.part_no,
  801. a.routing_type,
  802. a.routing_revision,
  803. a.alternative_no,
  804. a.operation_id,
  805. a.operation_no,
  806. a.operation_name,
  807. a.efficiency_factor,
  808. a.mach_run_factor,
  809. a.mach_setup_time,
  810. a.run_time_code,
  811. a.labor_run_factor,
  812. a.labor_setup_time,
  813. a.crew_size,
  814. a.setup_crew_size,
  815. a.outside_op_item,
  816. a.machine_no,
  817. a.work_center_no,
  818. dbo.get_workCenter_desc(a.site, a.work_center_no) as workCenterDesc,
  819. a.labor_class_no,
  820. a.setup_labor_class_no,
  821. a.overlap,
  822. a.note_text as componentNoteText,
  823. b.itemType
  824. FROM plm_routing_component a
  825. left join WorkCenter_BMType b on a.site = b.site and a.work_center_no = b.workCenterNo
  826. where a.site = #{site}
  827. and a.part_no = #{partNo}
  828. and a.routing_type = #{routingType}
  829. and a.routing_revision = #{routingRevision,jdbcType=INTEGER}
  830. and a.alternative_no = #{alternativeNo}
  831. order by operation_no
  832. </select>
  833. <insert id="saveBMRoute">
  834. insert into plm_bm_routing_detail (site, code_no, item_no, OperationDesc, remark, create_date, create_by)
  835. values (#{site}, #{codeNo}, #{itemNo}, #{operationDesc}, #{remark}, GetDate(), #{username})
  836. </insert>
  837. <update id="updateBMRoute">
  838. update plm_bm_routing_detail
  839. set item_no=#{itemNo}
  840. , OperationDesc=#{operationDesc}
  841. , remark=#{remark}
  842. , update_date=GetDate()
  843. , update_by=#{username}
  844. where id = #{id}
  845. </update>
  846. <delete id="deleteBMRoute">
  847. delete
  848. from plm_bm_routing_detail
  849. where id = #{id}
  850. </delete>
  851. <select id="searchBMTPInfoDetail" resultType="PlmBmTpInfoDetailData">
  852. select site,
  853. code_no,
  854. colourMatch,
  855. environment,
  856. eordValue,
  857. customerFile,
  858. laberSize,
  859. crossNumber,
  860. hp,
  861. rowNumber,
  862. vp,
  863. remark
  864. from plm_bm_tpInfoDetail
  865. where site = #{site}
  866. and code_no = #{codeNo}
  867. </select>
  868. <insert id="saveBMTPInfoDetail">
  869. insert into plm_bm_tpInfoDetail (site, code_no, colourMatch, environment, eordValue, customerFile, laberSize,
  870. crossNumber, hp, rowNumber, vp, remark, update_date, update_by)
  871. values (#{site}, #{codeNo}, #{colourMatch}, #{environment}, #{eordValue}, #{customerFile}, #{laberSize},
  872. #{crossNumber}, #{hp}, #{rowNumber}, #{vp}, #{remark}, GetDate(), #{updateBy})
  873. </insert>
  874. <update id="updateBMTPInfoDetail">
  875. update plm_bm_tpInfoDetail
  876. set colourMatch=#{colourMatch},
  877. environment=#{environment},
  878. eordValue=#{eordValue},
  879. customerFile=#{customerFile},
  880. laberSize=#{laberSize},
  881. crossNumber=#{crossNumber},
  882. hp=#{hp},
  883. rowNumber=#{rowNumber},
  884. vp=#{vp},
  885. remark=#{remark},
  886. update_date=GetDate(),
  887. update_by=#{updateBy}
  888. where site = #{site}
  889. and code_no = #{codeNo}
  890. </update>
  891. <select id="searchBMTPInfoColor" resultType="PlmBmTpInfoColorData">
  892. select site,
  893. code_no,
  894. [order],
  895. color,
  896. inkType,
  897. colorRet,
  898. colorMatch,
  899. remark,
  900. filmNo,
  901. stencilNo,
  902. update_by,
  903. update_date,
  904. id
  905. from plm_bm_tpInfoColor
  906. where site = #{site}
  907. and code_no = #{codeNo}
  908. order by [order]
  909. </select>
  910. <insert id="saveBMTPInfoColor">
  911. insert into plm_bm_tpInfoColor (site, code_no, [order], color, inkType, colorRet, colorMatch, remark, filmNo,
  912. stencilNo, update_by, update_date)
  913. values (#{site}, #{codeNo}, #{order}, #{color}, #{inkType}, #{colorRet}, #{colorMatch}, #{remark}, #{filmNo},
  914. #{stencilNo}, #{updateBy}, GetDate())
  915. </insert>
  916. <update id="updateBMTPInfoColor">
  917. update plm_bm_tpInfoColor
  918. set [order]=#{order},
  919. color=#{color},
  920. inkType=#{inkType},
  921. colorRet=#{colorRet},
  922. colorMatch=#{colorMatch},
  923. remark=#{remark},
  924. filmNo=#{filmNo},
  925. stencilNo=#{stencilNo},
  926. update_date=GetDate(),
  927. update_by=#{updateBy}
  928. where id = #{id}
  929. </update>
  930. <delete id="deleteBMTPInfoColor">
  931. delete
  932. from plm_bm_tpInfoColor
  933. where id = #{id}
  934. </delete>
  935. <select id="checkPlmBmTpInfoColorOrder" resultType="PlmBmTpInfoColorData">
  936. select site
  937. from plm_bm_tpInfoColor
  938. where site = #{site}
  939. and code_no = #{codeNo}
  940. and [order] = #{order}
  941. </select>
  942. <select id="searchBMTPInfoCut" resultType="PlmBmTpInfoCutData">
  943. select site,
  944. code_no,
  945. [order],
  946. cuttingMachine,
  947. cuttingType,
  948. cutterTooling,
  949. cutterLayout,
  950. cutterCost,
  951. p2c,
  952. c2c,
  953. cutterNo,
  954. update_date,
  955. update_by,
  956. id
  957. from plm_bm_tpInfoCut
  958. where site = #{site}
  959. and code_no = #{codeNo}
  960. order by [order]
  961. </select>
  962. <insert id="saveBMTPInfoCut">
  963. insert into plm_bm_tpInfoCut (site, code_no, [order], cuttingMachine, cuttingType, cutterTooling, cutterLayout,
  964. cutterCost, p2c, c2c, cutterNo, update_date,
  965. update_by)
  966. values (#{site}, #{codeNo}, #{order}, #{cuttingMachine}, #{cuttingType}, #{cutterTooling}, #{cutterLayout},
  967. #{cutterCost}, #{p2c}, #{c2c}, #{cutterNo}, GetDate(), #{updateBy})
  968. </insert>
  969. <update id="updateBMTPInfoCut">
  970. update plm_bm_tpInfoCut
  971. set [order]=#{order},
  972. cuttingMachine=#{cuttingMachine},
  973. cuttingType=#{cuttingType},
  974. cutterTooling=#{cutterTooling},
  975. cutterLayout=#{cutterLayout},
  976. cutterCost=#{cutterCost},
  977. p2c=#{p2c},
  978. c2c=#{c2c},
  979. cutterNo=#{cutterNo},
  980. update_date=GetDate(),
  981. update_by=#{updateBy}
  982. where id = #{id}
  983. </update>
  984. <select id="checkPlmBmTpInfoCutOrder" resultType="PlmBmTpInfoCutData">
  985. select site
  986. from plm_bm_tpInfoCut
  987. where site = #{site}
  988. and code_no = #{codeNo}
  989. and [order] = #{order}
  990. </select>
  991. <delete id="deleteBMTPInfoCut">
  992. delete
  993. from plm_bm_tpInfoCut
  994. where id = #{id}
  995. </delete>
  996. <select id="searchBMPrepressDetail" resultType="PlmBmPrepressData">
  997. select Site,
  998. code_no,
  999. plateNo,
  1000. cutterNumber,
  1001. cutterLayout,
  1002. [action],
  1003. remark,
  1004. feedback,
  1005. update_by,
  1006. update_date
  1007. from plm_bm_prepress
  1008. where site = #{site}
  1009. and code_no = #{codeNo}
  1010. </select>
  1011. <insert id="saveBMPrepressDetail">
  1012. insert into plm_bm_prepress (Site, code_no, plateNo, cutterNumber, cutterLayout, [action], remark, feedback,
  1013. update_by, update_date)
  1014. values (#{site}, #{codeNo}, #{plateNo}, #{cutterNumber}, #{cutterLayout}, #{action}, #{remark}, #{feedback},
  1015. #{updateBy}, GetDate())
  1016. </insert>
  1017. <update id="updateBMPrepressDetail">
  1018. update plm_bm_prepress
  1019. set plateNo=#{plateNo},
  1020. cutterNumber=#{cutterNumber},
  1021. cutterLayout=#{cutterLayout},
  1022. [action]=#{action},
  1023. remark=#{remark},
  1024. feedback=#{feedback},
  1025. update_by=#{updateBy},
  1026. update_date=GetDate()
  1027. where site = #{site}
  1028. and code_no = #{codeNo}
  1029. </update>
  1030. <select id="searchBMPrepressColor" resultType="PlmBmPrepressColorData">
  1031. select site,
  1032. code_no,
  1033. [order],
  1034. meshModel,
  1035. meshSize,
  1036. angle,
  1037. coatingType,
  1038. filmNo,
  1039. stencilNo,
  1040. color,
  1041. update_by,
  1042. update_date
  1043. from plm_bm_PrepressColor
  1044. where site = #{site}
  1045. and code_no = #{codeNo}
  1046. order by [order]
  1047. </select>
  1048. <insert id="saveBMPrepressColor">
  1049. insert into plm_bm_PrepressColor (site, code_no, [order], meshModel, meshSize, angle, coatingType, filmNo,
  1050. stencilNo, color, update_by, update_date)
  1051. values (#{site}, #{codeNo}, #{order}, #{meshModel}, #{meshSize}, #{angle}, #{coatingType}, #{filmNo},
  1052. #{stencilNo}, #{color}, #{updateBy}, GetDate())
  1053. </insert>
  1054. <update id="updateBMPrepressColor">
  1055. update plm_bm_PrepressColor
  1056. set [order]=#{order},
  1057. color=#{color},
  1058. meshModel=#{meshModel},
  1059. meshSize=#{meshSize},
  1060. angle=#{angle},
  1061. coatingType=#{coatingType},
  1062. filmNo=#{filmNo},
  1063. stencilNo=#{stencilNo},
  1064. update_date=GetDate(),
  1065. update_by=#{updateBy}
  1066. where id = #{id}
  1067. </update>
  1068. <delete id="deleteBMPrepressColor">
  1069. delete
  1070. from plm_bm_PrepressColor
  1071. where id = #{id}
  1072. </delete>
  1073. <select id="checkPlmBmPrepressColorOrder" resultType="PlmBmPrepressColorData">
  1074. select site
  1075. from plm_bm_PrepressColor
  1076. where site = #{site}
  1077. and code_no = #{codeNo}
  1078. and [order] = #{order}
  1079. </select>
  1080. <select id="searchBMPrintOtherDetail" resultType="PlmBmPrintOtherData">
  1081. select site, code_no, remark, [action], update_date, update_by, id
  1082. from plm_bm_PrintOther
  1083. where site = #{site}
  1084. and code_no = #{codeNo}
  1085. </select>
  1086. <insert id="saveBMPrintOtherDetail">
  1087. insert into plm_bm_PrintOther (site, code_no, remark, [action], update_date, update_by)
  1088. values (#{site}, #{codeNo}, #{remark}, #{action}, GetDate(), #{updateBy})
  1089. </insert>
  1090. <update id="updateBMPrintOtherDetail">
  1091. update plm_bm_PrintOther
  1092. set remark=#{remark},
  1093. [action]=#{action}
  1094. where site = #{site}
  1095. and code_no = #{codeNo}
  1096. </update>
  1097. <select id="searchBMPrintOtherColor" resultType="PlmBmPrintOtherColorData">
  1098. select site,
  1099. code_no,
  1100. [order],
  1101. seqNo,
  1102. ink,
  1103. [type],
  1104. otherRef,
  1105. update_date,
  1106. update_by
  1107. from plm_bm_PrintOtherColor
  1108. where site = #{site}
  1109. and code_no = #{codeNo}
  1110. order by [order], seqNo
  1111. </select>
  1112. <insert id="saveBMPrintOtherColor">
  1113. insert into plm_bm_PrintOtherColor (site, code_no, [order], seqNo, ink, [type], otherRef, update_by,
  1114. update_date)
  1115. values (#{site}, #{codeNo}, #{order}, #{seqNo}, #{ink}, #{type}, #{otherRef}, #{updateBy}, GetDate())
  1116. </insert>
  1117. <update id="updateBMPrintOtherColor">
  1118. update plm_bm_PrintOtherColor
  1119. set [order]=#{order},
  1120. seqNo=#{seqNo},
  1121. ink=#{ink},
  1122. [type]=#{type},
  1123. otherRef=#{otherRef},
  1124. update_date=GetDate(),
  1125. update_by=#{updateBy}
  1126. where id = #{id}
  1127. </update>
  1128. <delete id="deleteBMPrintOtherColor">
  1129. delete
  1130. from plm_bm_PrintOtherColor
  1131. where id = #{id}
  1132. </delete>
  1133. <select id="checkPlmBmPrintOtherColorOrder" resultType="PlmBmPrintOtherColorData">
  1134. select site
  1135. from plm_bm_PrintOtherColor
  1136. where site = #{site}
  1137. and code_no = #{codeNo}
  1138. and [order] = #{order}
  1139. and seqNo = #{seqNo}
  1140. </select>
  1141. <update id="updateBMModal">
  1142. update plm_bm_model_header
  1143. set properties_code_no=#{propertiesCodeNo},
  1144. active=#{active}
  1145. where site = #{site}
  1146. and bu_no = #{buNo}
  1147. and code_no = #{codeNo}
  1148. </update>
  1149. <select id="checkBMModelHeader" resultType="PlmBmModelHeaderData">
  1150. select properties_code_no
  1151. from plm_bm_model_header
  1152. where site = #{site}
  1153. and bu_no = #{buNo}
  1154. and code_no = #{type}
  1155. </select>
  1156. <select id="searchBMPropertiesHeaderForBM" resultType="PlmBmModelHeaderData">
  1157. select properties_code_no
  1158. from plm_bm_model_header
  1159. where site = #{site}
  1160. and bu_no = #{buNo}
  1161. and code_no = #{type}
  1162. </select>
  1163. <!-- Ink Mixing 油墨房-->
  1164. <select id="searchBMInkMixingDetail" resultType="PlmBmInkMixingData">
  1165. select site,
  1166. code_no,
  1167. colourMatch,
  1168. visuallySetting,
  1169. indicate,
  1170. customerFile,
  1171. remarks,
  1172. [action],
  1173. update_date,
  1174. update_by
  1175. from plm_bm_InkMixing
  1176. where site = #{site}
  1177. and code_no = #{codeNo}
  1178. </select>
  1179. <insert id="saveBMInkMixingDetail">
  1180. insert into plm_bm_InkMixing (site, code_no, colourMatch, visuallySetting, indicate, customerFile, remarks,
  1181. [action], update_date, update_by)
  1182. values (#{site}, #{codeNo}, #{colourMatch}, #{visuallySetting}, #{indicate}, #{customerFile}, #{remarks},
  1183. #{action}, GetDate(), #{updateBy})
  1184. </insert>
  1185. <update id="updateBMInkMixingDetail">
  1186. update plm_bm_InkMixing
  1187. set colourMatch=#{colourMatch}
  1188. , visuallySetting=#{visuallySetting}
  1189. , indicate=#{indicate}
  1190. , customerFile=#{customerFile}
  1191. , [action]=#{action}
  1192. , remarks=#{remarks}
  1193. , update_date=GetDate()
  1194. , update_by=#{updateBy}
  1195. where site = #{site}
  1196. and code_no = #{codeNo}
  1197. </update>
  1198. <select id="searchBMInkMixingColor" resultType="PlmBmInkMixingColorData">
  1199. select site,
  1200. code_no,
  1201. [order],
  1202. color,
  1203. [type],
  1204. supplier,
  1205. inkUsage,
  1206. mixTime,
  1207. standbyTime,
  1208. Viscosity,
  1209. RecycleTimes,
  1210. update_by,
  1211. update_date,
  1212. id
  1213. from plm_bm_InkMixingColor
  1214. where site = #{site}
  1215. and code_no = #{codeNo}
  1216. order by [order]
  1217. </select>
  1218. <insert id="saveBMInkMixingColor">
  1219. insert into plm_bm_InkMixingColor (site, code_no, [order], color, [type], supplier, inkUsage, mixTime,
  1220. standbyTime, Viscosity, RecycleTimes, update_by, update_date)
  1221. values (#{site}, #{codeNo}, #{order}, #{color}, #{type}, #{supplier}, #{inkUsage}, #{mixTime}, #{standbyTime},
  1222. #{viscosity}, #{recycleTimes}, #{updateBy}, GetDate())
  1223. </insert>
  1224. <update id="updateBMInkMixingColor">
  1225. update plm_bm_InkMixingColor
  1226. set [order]=#{order},
  1227. color=#{color},
  1228. [type]=#{type},
  1229. supplier=#{supplier},
  1230. inkUsage=#{inkUsage},
  1231. mixTime=#{mixTime},
  1232. standbyTime=#{standbyTime},
  1233. Viscosity=#{viscosity},
  1234. RecycleTimes=#{recycleTimes},
  1235. update_date=GetDate(),
  1236. update_by=#{updateBy}
  1237. where id = #{id}
  1238. </update>
  1239. <delete id="deleteBMInkMixingColor">
  1240. delete
  1241. from plm_bm_InkMixingColor
  1242. where id = #{id}
  1243. </delete>
  1244. <select id="checkPlmBmInkMixingColorOrder" resultType="PlmBmInkMixingColorData">
  1245. select site
  1246. from plm_bm_InkMixingColor
  1247. where site = #{site}
  1248. and code_no = #{codeNo}
  1249. and [order] = #{order}
  1250. </select>
  1251. <!-- Ink Formulation 油墨配方-->
  1252. <select id="searchBMInkFormulationDetail" resultType="PlmBmInkFormulationData">
  1253. select Site,
  1254. code_no,
  1255. remarks,
  1256. label_size,
  1257. qpa,
  1258. [action],
  1259. [cross],
  1260. row,
  1261. hp,
  1262. vp,
  1263. update_date,
  1264. update_by
  1265. from plm_bm_InkFormulation
  1266. where site = #{site}
  1267. and code_no = #{codeNo}
  1268. </select>
  1269. <insert id="saveBMInkFormulationDetail">
  1270. insert into plm_bm_InkFormulation (Site, code_no, remarks, label_size, qpa, [action], [cross], row, hp, vp,
  1271. update_date, update_by)
  1272. values (#{site}, #{codeNo}, #{remarks}, #{labelSize}, #{qpa}, #{action}, #{cross}, #{row}, #{hp}, #{vp},
  1273. GetDate(), #{updateBy})
  1274. </insert>
  1275. <update id="updateBMInkFormulationDetail">
  1276. update plm_bm_InkFormulation
  1277. set remarks=#{remarks}
  1278. , label_size=#{labelSize}
  1279. , qpa=#{qpa}
  1280. , [action]=#{action}
  1281. , [cross]=#{cross}
  1282. , row=#{row}
  1283. , [hp]=#{hp}
  1284. , vp=#{vp}
  1285. , update_date=GetDate()
  1286. , update_by=#{updateBy}
  1287. where site = #{site}
  1288. and code_no = #{codeNo}
  1289. </update>
  1290. <select id="searchBMInkFormulationColor" resultType="PlmBmInkFormulationColorData">
  1291. select site,
  1292. code_no,
  1293. [order],
  1294. hardness,
  1295. tartness,
  1296. printingSide,
  1297. energy,
  1298. dry_speed,
  1299. dry_time,
  1300. dry_temp,
  1301. dry_time2,
  1302. update_date,
  1303. update_by,
  1304. id
  1305. from plm_bm_InkFormulationColor
  1306. where site = #{site}
  1307. and code_no = #{codeNo}
  1308. order by [order]
  1309. </select>
  1310. <insert id="saveBMInkFormulationColor">
  1311. insert into plm_bm_InkFormulationColor (site, code_no, [order], hardness, tartness, printingSide, energy,
  1312. dry_speed, dry_time, dry_temp, dry_time2, update_date, update_by)
  1313. values (#{site}, #{codeNo}, #{order}, #{hardness}, #{tartness}, #{printingSide}, #{energy}, #{drySpeed},
  1314. #{dryTime}, #{dryTemp}, #{dryTime2}, GetDate(), #{updateBy})
  1315. </insert>
  1316. <update id="updateBMInkFormulationColor">
  1317. update plm_bm_InkFormulationColor
  1318. set [order]=#{order},
  1319. hardness=#{hardness},
  1320. [tartness]=#{tartness},
  1321. printingSide=#{printingSide},
  1322. energy=#{energy},
  1323. dry_speed=#{drySpeed},
  1324. dry_time=#{dryTime},
  1325. dry_temp=#{dryTemp},
  1326. dry_time2=#{dryTime2},
  1327. update_date=GetDate(),
  1328. update_by=#{updateBy}
  1329. where id = #{id}
  1330. </update>
  1331. <delete id="deleteBMInkFormulationColor">
  1332. delete
  1333. from plm_bm_InkFormulationColor
  1334. where id = #{id}
  1335. </delete>
  1336. <select id="checkPlmBmInkFormulationColorOrder" resultType="PlmBmInkFormulationColorData">
  1337. select site
  1338. from plm_bm_InkFormulationColor
  1339. where site = #{site}
  1340. and code_no = #{codeNo}
  1341. and [order] = #{order}
  1342. </select>
  1343. <!-- Lamination 覆膜 -->
  1344. <select id="searchBMLaminationDetail" resultType="PlmBmLaminationData">
  1345. select site, code_no, [action], update_date, update_by, remark
  1346. from plm_bm_Lamination
  1347. where site = #{site}
  1348. and code_no = #{codeNo}
  1349. </select>
  1350. <insert id="saveBMLaminationDetail">
  1351. insert into plm_bm_Lamination (site, code_no, [action], update_date, update_by, remark)
  1352. values (#{site}, #{codeNo}, #{action}, GetDate(), #{updateBy}, #{remark})
  1353. </insert>
  1354. <update id="updateBMLaminationDetail">
  1355. update plm_bm_Lamination
  1356. set remark=#{remark},
  1357. [action]=#{action},
  1358. update_date=GetDate(),
  1359. update_by=#{updateBy}
  1360. where site = #{site}
  1361. and code_no = #{codeNo}
  1362. </update>
  1363. <select id="searchBMLaminationCut" resultType="PlmBmLaminationCutData">
  1364. select site,
  1365. code_no,
  1366. [order],
  1367. station,
  1368. processStep,
  1369. machine,
  1370. laminationType,
  1371. rm_partNo,
  1372. rm_partNo2,
  1373. film_partNo,
  1374. lamination_side,
  1375. remarks,
  1376. update_date,
  1377. update_by,
  1378. id
  1379. from plm_bm_LaminationCut
  1380. where site = #{site}
  1381. and code_no = #{codeNo}
  1382. order by [order]
  1383. </select>
  1384. <insert id="saveBMLaminationCut">
  1385. insert into plm_bm_LaminationCut (site, code_no, [order], station, processStep, machine, laminationType,
  1386. rm_partNo, rm_partNo2, film_partNo, lamination_side, remarks,
  1387. update_date, update_by)
  1388. values (#{site}, #{codeNo}, #{order}, #{station}, #{processStep}, #{machine}, #{laminationType}, #{rmPartNo},
  1389. #{rmPartNo2}, #{filmPartNo}, #{laminationSide}, #{remarks},
  1390. GetDate(), #{updateBy})
  1391. </insert>
  1392. <update id="updateBMLaminationCut">
  1393. update plm_bm_LaminationCut
  1394. set [order]=#{order},
  1395. station=#{station},
  1396. [processStep]=#{processStep},
  1397. machine=#{machine},
  1398. laminationType=#{laminationType},
  1399. rm_partNo=#{rmPartNo},
  1400. rm_partNo2=#{rmPartNo2},
  1401. film_partNo=#{filmPartNo},
  1402. lamination_side=#{laminationSide},
  1403. remarks=#{remarks},
  1404. update_date=GetDate(),
  1405. update_by=#{updateBy}
  1406. where id = #{id}
  1407. </update>
  1408. <delete id="deleteBMLaminationCut">
  1409. delete
  1410. from plm_bm_LaminationCut
  1411. where id = #{id}
  1412. </delete>
  1413. <select id="checkPlmBmLaminationCutOrder" resultType="PlmBmLaminationCutData">
  1414. select site
  1415. from plm_bm_LaminationCut
  1416. where site = #{site}
  1417. and code_no = #{codeNo}
  1418. and [order] = #{order}
  1419. </select>
  1420. <!-- Cnc -->
  1421. <select id="searchBMCncDetail" resultType="PlmBmCncData">
  1422. select site, code_no, [action], update_date, update_by
  1423. from plm_bm_Cnc
  1424. where site = #{site}
  1425. and code_no = #{codeNo}
  1426. </select>
  1427. <insert id="saveBMCncDetail">
  1428. insert into plm_bm_Cnc (site, code_no, [action], update_date, update_by)
  1429. values (#{site}, #{codeNo}, #{action}, GetDate(), #{updateBy})
  1430. </insert>
  1431. <update id="updateBMCncDetail">
  1432. update plm_bm_Cnc
  1433. set [action]=#{action},
  1434. update_date=GetDate(),
  1435. update_by=#{updateBy}
  1436. where site = #{site}
  1437. and code_no = #{codeNo}
  1438. </update>
  1439. <select id="searchBMCncCut" resultType="PlmBmCncCutData">
  1440. select site,
  1441. code_no,
  1442. [order],
  1443. cutting_machine,
  1444. program_name,
  1445. cutting_speed,
  1446. spec,
  1447. p2c,
  1448. c2c,
  1449. remarks,
  1450. update_date,
  1451. update_by,
  1452. id
  1453. from plm_bm_CncCut
  1454. where site = #{site}
  1455. and code_no = #{codeNo}
  1456. order by [order]
  1457. </select>
  1458. <insert id="saveBMCncCut">
  1459. insert into plm_bm_CncCut (site, code_no, [order], cutting_machine, program_name, cutting_speed, spec, p2c, c2c,
  1460. remarks, update_date, update_by)
  1461. values (#{site}, #{codeNo}, #{order}, #{cuttingMachine}, #{programName}, #{cuttingSpeed}, #{spec}, #{p2c},
  1462. #{c2c}, #{remarks},
  1463. GetDate(), #{updateBy})
  1464. </insert>
  1465. <update id="updateBMCncCut">
  1466. update plm_bm_CncCut
  1467. set [order]=#{order},
  1468. cutting_machine=#{cuttingMachine},
  1469. [program_name]=#{programName},
  1470. cutting_speed=#{cuttingSpeed},
  1471. spec=#{spec},
  1472. p2c=#{p2c},
  1473. c2c=#{c2c},
  1474. remarks=#{remarks},
  1475. update_date=GetDate(),
  1476. update_by=#{updateBy}
  1477. where id = #{id}
  1478. </update>
  1479. <delete id="deleteBMCncCut">
  1480. delete
  1481. from plm_bm_CncCut
  1482. where id = #{id}
  1483. </delete>
  1484. <select id="checkPlmBmCncCutOrder" resultType="PlmBmCncCutData">
  1485. select site
  1486. from plm_bm_CncCut
  1487. where site = #{site}
  1488. and code_no = #{codeNo}
  1489. and [order] = #{order}
  1490. </select>
  1491. <!-- Cut -->
  1492. <select id="searchBMCutDetail" resultType="PlmBmCutData">
  1493. select site, code_no, [action], remarks, update_date, update_by
  1494. from plm_bm_Cut
  1495. where site = #{site}
  1496. and code_no = #{codeNo}
  1497. </select>
  1498. <insert id="saveBMCutDetail">
  1499. insert into plm_bm_Cut (site, code_no, [action], update_date, update_by, remarks)
  1500. values (#{site}, #{codeNo}, #{action}, GetDate(), #{updateBy}, #{remarks})
  1501. </insert>
  1502. <update id="updateBMCutDetail">
  1503. update plm_bm_Cut
  1504. set [action]=#{action},
  1505. remarks=#{remarks},
  1506. update_date=GetDate(),
  1507. update_by=#{updateBy}
  1508. where site = #{site}
  1509. and code_no = #{codeNo}
  1510. </update>
  1511. <select id="searchBMCutCut" resultType="PlmBmCutCutData">
  1512. select site,
  1513. code_no,
  1514. [order],
  1515. cutting_machine,
  1516. cutting_type,
  1517. cutting_tooling,
  1518. cutter_no,
  1519. cutter_layout,
  1520. cutter_cost,
  1521. program_name,
  1522. program_path,
  1523. p2c,
  1524. c2c,
  1525. update_by,
  1526. update_date,
  1527. id
  1528. from plm_bm_CutCut
  1529. where site = #{site}
  1530. and code_no = #{codeNo}
  1531. order by [order]
  1532. </select>
  1533. <insert id="saveBMCutCut">
  1534. insert into plm_bm_CutCut (site, code_no, [order], cutting_machine, cutting_type, cutting_tooling, cutter_no,
  1535. cutter_layout, cutter_cost, program_name,
  1536. program_path, p2c, c2c, update_by, update_date)
  1537. values (#{site}, #{codeNo}, #{order}, #{cuttingMachine}, #{cuttingType}, #{cuttingTooling}, #{cutterNo},
  1538. #{cutterLayout}, #{cutterCost}, #{programName},
  1539. #{programPath}, #{p2c}, #{c2c}, #{updateBy}, GetDate())
  1540. </insert>
  1541. <update id="updateBMCutCut">
  1542. update plm_bm_CutCut
  1543. set [order]=#{order},
  1544. cutting_machine=#{cuttingMachine},
  1545. [cutting_type]=#{cuttingType},
  1546. cutting_tooling=#{cuttingTooling},
  1547. cutter_no=#{cutterNo},
  1548. cutter_layout=#{cutterLayout},
  1549. cutter_cost=#{cutterCost},
  1550. program_name=#{programName},
  1551. p2c=#{p2c},
  1552. c2c=#{c2c},
  1553. program_path=#{programPath},
  1554. update_date=GetDate(),
  1555. update_by=#{updateBy}
  1556. where id = #{id}
  1557. </update>
  1558. <delete id="deleteBMCutCut">
  1559. delete
  1560. from plm_bm_CutCut
  1561. where id = #{id}
  1562. </delete>
  1563. <select id="checkPlmBmCutCutOrder" resultType="PlmBmCutCutData">
  1564. select site
  1565. from plm_bm_CutCut
  1566. where site = #{site}
  1567. and code_no = #{codeNo}
  1568. and [order] = #{order}
  1569. </select>
  1570. <!-- printing 印刷-->
  1571. <select id="searchBMPrintingDetail" resultType="PlmBmPrintingData">
  1572. select site,
  1573. code_no,
  1574. colour_match,
  1575. conditions,
  1576. colour_indicat,
  1577. customer_file,
  1578. glossiness_requirement,
  1579. comments,
  1580. repeat,
  1581. vp,
  1582. label_size,
  1583. down,
  1584. plate_distortion_rate,
  1585. actual_number,
  1586. print_position,
  1587. goods_roll_width,
  1588. update_date,
  1589. update_by,
  1590. printLayout
  1591. from plm_bm_Printing
  1592. where site = #{site}
  1593. and code_no = #{codeNo}
  1594. </select>
  1595. <insert id="saveBMPrintingDetail">
  1596. insert into plm_bm_Printing (site, code_no, colour_match, conditions, colour_indicat, customer_file,
  1597. glossiness_requirement, comments, repeat, vp, label_size,
  1598. down, plate_distortion_rate, actual_number, print_position, goods_roll_width,
  1599. update_date, update_by, printLayout)
  1600. values (#{site}, #{codeNo}, #{colourMatch}, #{conditions}, #{colourIndicat}, #{customerFile},
  1601. #{glossinessRequirement}, #{comments},
  1602. #{repeat}, #{vp}, #{labelSize}, #{down}, #{plateDistortionRate}, #{actualNumber}, #{printPosition},
  1603. #{goodsRollWidth},
  1604. GetDate(), #{updateBy}, #{printLayout})
  1605. </insert>
  1606. <update id="updateBMPrintingDetail">
  1607. update plm_bm_Printing
  1608. set printLayout=#{printLayout},
  1609. colour_match=#{colourMatch},
  1610. conditions=#{conditions},
  1611. colour_indicat=#{colourIndicat},
  1612. customer_file=#{customerFile},
  1613. glossiness_requirement=#{glossinessRequirement},
  1614. comments=#{comments},
  1615. repeat=#{repeat},
  1616. vp=#{vp},
  1617. label_size=#{labelSize},
  1618. down=#{down},
  1619. plate_distortion_rate=#{plateDistortionRate},
  1620. actual_number=#{actualNumber},
  1621. print_position=#{printPosition},
  1622. goods_roll_width=#{goodsRollWidth},
  1623. update_date=GetDate(),
  1624. update_by=#{updateBy}
  1625. where site = #{site}
  1626. and code_no = #{codeNo}
  1627. </update>
  1628. <select id="searchBMPrintingColor" resultType="PlmBmPrintingColorData">
  1629. select
  1630. site,
  1631. code_no,
  1632. [order],
  1633. ink_type,
  1634. color_reference,
  1635. color_match,
  1636. bcm,
  1637. speed,
  1638. dry,
  1639. gallus,
  1640. mark_andy,
  1641. lp,
  1642. Hexiang,
  1643. update_date,
  1644. update_by,
  1645. id,
  1646. resource_no
  1647. from plm_bm_PrintingColor
  1648. where site = #{site} and code_no = #{codeNo}
  1649. order by [order]
  1650. </select>
  1651. <insert id="saveBMPrintingColor">
  1652. insert into plm_bm_PrintingColor
  1653. (site, code_no, [order], ink_type, color_reference, color_match, bcm, speed,
  1654. dry, gallus, mark_andy, lp, Hexiang, update_by, update_date, resource_no)
  1655. values
  1656. (#{site}, #{codeNo}, #{order}, #{inkType}, #{colorReference}, #{colorMatch}, #{bcm}, #{speed},
  1657. #{dry}, #{gallus}, #{markAndy}, #{lp}, #{hexiang}, #{updateBy}, GetDate(), #{resourceNo})
  1658. </insert>
  1659. <insert id="saveBMPrintingColors">
  1660. insert into plm_bm_PrintingColor
  1661. (site, code_no, [order], ink_type, color_reference, color_match, bcm, speed,
  1662. dry, gallus, mark_andy, lp, Hexiang, update_by, update_date, resource_no)
  1663. values
  1664. <foreach collection="list" item="item" index="index" separator=",">
  1665. (#{item.site}, #{item.codeNo}, #{item.order}, #{item.inkType}, #{item.colorReference}, #{item.colorMatch}, #{item.bcm}, #{item.speed},
  1666. #{item.dry}, #{item.gallus}, #{item.markAndy}, #{item.lp}, #{item.hexiang}, #{item.updateBy}, GetDate(), #{item.resourceNo})
  1667. </foreach>
  1668. </insert>
  1669. <update id="updateBMPrintingColor">
  1670. update plm_bm_PrintingColor
  1671. set [order] = #{order},
  1672. ink_type = #{inkType},
  1673. [color_reference] = #{colorReference},
  1674. color_match = #{colorMatch},
  1675. bcm = #{bcm},
  1676. speed = #{speed},
  1677. dry = #{dry},
  1678. gallus = #{gallus},
  1679. mark_andy = #{markAndy},
  1680. lp = #{lp},
  1681. Hexiang = #{hexiang},
  1682. update_date = GetDate(),
  1683. update_by = #{updateBy},
  1684. resource_no = #{resourceNo}
  1685. where id = #{id}
  1686. </update>
  1687. <delete id="deleteBMPrintingColor">
  1688. delete from plm_bm_PrintingColor
  1689. where id = #{id}
  1690. </delete>
  1691. <delete id="deleteBMPrintingColorByCodeNo">
  1692. delete from plm_bm_PrintingColor
  1693. where site = #{site} and code_no = #{codeNo}
  1694. </delete>
  1695. <select id="checkPlmBmPrintingColorOrder" resultType="PlmBmPrintingColorData">
  1696. select site
  1697. from plm_bm_PrintingColor
  1698. where site = #{site}
  1699. and code_no = #{codeNo}
  1700. and [order] = #{order}
  1701. </select>
  1702. <select id="getBomNowRevNo" resultType="com.spring.modules.part.entity.BomHeaderEntity">
  1703. select top 1 eng_chg_level, bom_type, site, part_no
  1704. from plm_bom_header
  1705. where site = #{site}
  1706. and part_no = #{partNo}
  1707. and GetDate() > eff_phase_in_date
  1708. and isnull(eff_phase_out_date, DATEADD(d, 1, GETDATE())) > GetDate()
  1709. </select>
  1710. <select id="getTopOneBomAlternativeNo" resultType="com.spring.modules.part.entity.BomDetailEntity">
  1711. select top 1 site, part_no, alternative_no, alternative_description, bom_type, eng_chg_level
  1712. from plm_bom_detail
  1713. where site = #{site}
  1714. and part_no = #{partNo}
  1715. and bom_type = #{bomType}
  1716. and eng_chg_level = #{engChgLevel}
  1717. </select>
  1718. <select id="getRouteNowRevNo" resultType="com.spring.modules.part.entity.RoutingHeaderEntity">
  1719. select top 1 site, part_no, routing_revision, routing_type
  1720. from plm_routing_header
  1721. where site = #{site}
  1722. and part_no = #{partNo}
  1723. and GetDate() > phase_in_date
  1724. and isnull(phase_out_date, DATEADD(d, 1, GETDATE())) > GetDate()
  1725. </select>
  1726. <select id="getTopOneRouteAlternativeNo" resultType="com.spring.modules.part.entity.RoutingDetailEntity">
  1727. select top 1 site, part_no, routing_revision, routing_type, alternative_no, alternative_description
  1728. from plm_routing_detail
  1729. where site = #{site}
  1730. and part_no = #{partNo}
  1731. and routing_type = #{routingType}
  1732. and routing_revision = #{routingRevision}
  1733. </select>
  1734. <select id="getBMBomDetail" resultType="com.spring.modules.part.entity.BomDetailEntity">
  1735. select
  1736. a.site,
  1737. a.bom_type,
  1738. a.eng_chg_level,
  1739. a.bom_alternative_no alternativeNo,
  1740. b.final_part_no partNo
  1741. from plm_technical_specification_sheet a
  1742. left join view_Project_final_Part b on a.site = b.site and a.test_part_no = b.test_part_no
  1743. left join plm_bom_detail c on a.site = c.site and b.final_part_no = c.part_no and a.eng_chg_level = c.eng_chg_level and a.bom_alternative_no = c.alternative_no and a.bom_type = c.bom_type
  1744. where a.site = #{site}
  1745. and a.code_no = #{codeNo}
  1746. and a.project_id = b.project_id
  1747. and c.status = 'Buildable'
  1748. </select>
  1749. <select id="getBMRouteDetail" resultType="com.spring.modules.part.entity.RoutingDetailEntity">
  1750. select a.site,
  1751. a.routing_type,
  1752. a.routing_revision,
  1753. a.routing_alternative_no alternativeNo,
  1754. b.final_part_no partNo
  1755. from plm_technical_specification_sheet a
  1756. left join view_Project_final_Part b on a.site = b.site and a.test_part_no = b.test_part_no
  1757. left join plm_routing_detail c
  1758. on a.site = c.site and b.final_part_no = c.part_no AND
  1759. a.routing_revision = c.routing_revision
  1760. and a.routing_alternative_no = c.alternative_no and a.routing_type = c.routing_type
  1761. where a.site = #{site}
  1762. and a.code_no = #{codeNo}
  1763. and a.project_id = b.project_id
  1764. and c.status = 'Buildable'
  1765. </select>
  1766. <select id="searchBMBomDetail" resultType="com.spring.modules.part.vo.BomDetailVo">
  1767. select a.site,
  1768. a.part_no,
  1769. b.alternative_no,
  1770. b.alternative_description,
  1771. a.bom_type,
  1772. a.eng_chg_level,
  1773. b.min_lot_qty,
  1774. b.default_flag,
  1775. a.note_text,
  1776. a.create_date,
  1777. a.create_by,
  1778. a.update_date,
  1779. a.update_by,
  1780. b.status,
  1781. a.official_flag,
  1782. a.eff_phase_in_date,
  1783. a.eff_phase_out_date
  1784. from plm_bom_header a
  1785. left join plm_bom_detail b
  1786. on a.site = b.site and a.part_no = b.part_NO and a.bom_type = b.bom_type AND
  1787. A.eng_chg_level = B.eng_chg_level
  1788. where a.part_no = #{partNo}
  1789. and a.site = #{site}
  1790. and a.bom_type != 'Repair'
  1791. and b.status = 'Buildable'
  1792. </select>
  1793. <update id="updateBMBomRev">
  1794. update plm_technical_specification_sheet
  1795. set bom_type=#{bomType},
  1796. eng_chg_level=#{engChgLevel,jdbcType=INTEGER},
  1797. bom_alternative_no=#{bomAlternativeNo}
  1798. where site = #{site}
  1799. and code_no = #{codeNo}
  1800. </update>
  1801. <update id="updateBMRouteRev">
  1802. update plm_technical_specification_sheet
  1803. set routing_type=#{routingType},
  1804. routing_revision=#{routingRevision,jdbcType=INTEGER},
  1805. routing_alternative_no=#{routingAlternativeNo}
  1806. where site = #{site}
  1807. and code_no = #{codeNo}
  1808. </update>
  1809. <select id="searchRouteDetail" resultType="com.spring.modules.part.vo.RoutingDetailVo">
  1810. select a.site,
  1811. a.part_no,
  1812. a.routing_revision,
  1813. a.routing_type,
  1814. b.alternative_no,
  1815. b.alternative_description,
  1816. b.status,
  1817. a.official_flag,
  1818. a.phase_in_date,
  1819. a.phase_out_date
  1820. from plm_routing_header a
  1821. left join plm_routing_detail b
  1822. on a.site = b.site and a.part_no = b.part_NO and a.routing_type = b.routing_type AND
  1823. A.routing_revision = B.routing_revision
  1824. where a.site = #{site}
  1825. and a.part_no = #{partNo}
  1826. and a.routing_type != 'Repair'
  1827. and b.status = 'Buildable'
  1828. </select>
  1829. <select id="searchBMRemarkPage" resultType="PlmTechnicalSpecificationSheetData">
  1830. select site, remarkPage, code_no
  1831. from plm_technical_specification_sheet
  1832. where site = #{site}
  1833. and code_no = #{codeNo}
  1834. </select>
  1835. <update id="updateBMRemarkPage">
  1836. update plm_technical_specification_sheet
  1837. set remarkPage=#{remarkPage}
  1838. where site = #{site}
  1839. and code_no = #{codeNo}
  1840. </update>
  1841. <select id="searchPartLastQuotationNo" resultType="com.spring.modules.quotation.entity.QuotationHeader">
  1842. select top 1 a.site, a.quotation_no
  1843. from quotation_header a
  1844. left join quotation_detail b on a.quotation_header_id = b.quotation_header_id
  1845. where b.site = #{site}
  1846. and b.product_no = #{productNo}
  1847. order by a.create_time desc
  1848. </select>
  1849. <select id="getSysProxyAddress" resultType="SysProxyAddress">
  1850. select physicalAddress, proxyAddress, remark
  1851. from sys_proxy_address
  1852. </select>
  1853. <select id="searchBMprintFlexoColor" resultType="PlmBmPrintFlexoColorData">
  1854. select
  1855. id,
  1856. site,
  1857. codeNo,
  1858. printSide,
  1859. [order],
  1860. colorReference,
  1861. inkCode,
  1862. colorMatch,
  1863. lpi,
  1864. bcm,
  1865. openFlag,
  1866. gallus,
  1867. markAndy,
  1868. hexiang,
  1869. temperature,
  1870. pressure,
  1871. updateDate,
  1872. updateBy,
  1873. resource_no,
  1874. speed
  1875. from plm_bm_printFlexoColor
  1876. where site = #{site} and codeNo = #{codeNo}
  1877. order by printSide desc, [order]
  1878. </select>
  1879. <select id="checkBMprintFlexoColorOrder" resultType="PlmBmPrintFlexoColorData">
  1880. select id, site, codeNo, printSide, [order]
  1881. from plm_bm_printFlexoColor
  1882. where site = #{site}
  1883. and codeNo = #{codeNo}
  1884. and printSide = #{printSide}
  1885. and [order] = #{order}
  1886. </select>
  1887. <insert id="saveBMprintFlexoColor">
  1888. insert into plm_bm_printFlexoColor
  1889. (site, codeNo, printSide, [order], colorReference, inkCode, colorMatch, lpi,
  1890. bcm, openFlag, gallus, markAndy, hexiang, temperature, pressure, updateDate, updateBy, remark, resource_no, speed)
  1891. values
  1892. (#{site}, #{codeNo}, #{printSide}, #{order}, #{colorReference}, #{inkCode}, #{colorMatch}, #{lpi},
  1893. #{bcm}, #{openFlag}, #{gallus}, #{markAndy}, #{hexiang}, #{temperature}, #{pressure}, GetDate(), #{updateBy}, #{remark}, #{resourceNo}, #{speed})
  1894. </insert>
  1895. <insert id="saveBMPrintFlexoColors">
  1896. insert into plm_bm_printFlexoColor
  1897. (site, codeNo, printSide, [order], colorReference, inkCode, colorMatch, lpi,
  1898. bcm, openFlag, gallus, markAndy, hexiang, temperature, pressure, updateDate,
  1899. updateBy, remark, resource_no, speed)
  1900. values
  1901. <foreach collection="list" item="item" index="index" separator=",">
  1902. (#{item.site}, #{item.codeNo}, #{item.printSide}, #{item.order}, #{item.colorReference}, #{item.inkCode}, #{item.colorMatch}, #{item.lpi},
  1903. #{item.bcm}, #{item.openFlag}, #{item.gallus}, #{item.markAndy}, #{item.hexiang}, #{item.temperature}, #{item.pressure}, GetDate(),
  1904. #{item.updateBy}, #{item.remark}, #{item.resourceNo}, #{item.speed})
  1905. </foreach>
  1906. </insert>
  1907. <update id="updateBMprintFlexoColor">
  1908. update plm_bm_printFlexoColor
  1909. set printSide = #{printSide},
  1910. [order] = #{order,jdbcType=INTEGER},
  1911. colorReference = #{colorReference},
  1912. inkCode = #{inkCode},
  1913. colorMatch = #{colorMatch},
  1914. lpi = #{lpi},
  1915. bcm = #{bcm},
  1916. openFlag = #{openFlag},
  1917. gallus = #{gallus},
  1918. markAndy = #{markAndy},
  1919. hexiang = #{hexiang},
  1920. temperature = #{temperature},
  1921. pressure = #{pressure},
  1922. updateDate = GetDate(),
  1923. updateBy = #{updateBy},
  1924. remark = #{remark},
  1925. resource_no = #{resourceNo},
  1926. speed = #{speed}
  1927. where id = #{id}
  1928. </update>
  1929. <delete id="deleteBMprintFlexoColor">
  1930. delete from plm_bm_printFlexoColor
  1931. where id = #{id}
  1932. </delete>
  1933. <delete id="deleteBMPrintFlexoColorByCodeNo">
  1934. delete from plm_bm_printFlexoColor
  1935. where site = #{site} and codeNo = #{codeNo}
  1936. </delete>
  1937. <select id="searchBMprintIndigoColor" resultType="PlmBmPrintIndigoColorData">
  1938. select id,
  1939. code_no,
  1940. site,
  1941. [order],
  1942. printSide,
  1943. colorReference,
  1944. inkCode,
  1945. colorMatch,
  1946. printMotion,
  1947. opticalDensity,
  1948. lut,
  1949. lpi,
  1950. screenAngle,
  1951. printHits,
  1952. blanketTemperture,
  1953. remark,
  1954. updateBy,
  1955. updateDate
  1956. from plm_bm_printIndigoColor
  1957. where site = #{site}
  1958. and code_no = #{codeNo}
  1959. order by printSide desc, [order]
  1960. </select>
  1961. <select id="checkBMprintIndigoColorOrder" resultType="PlmBmPrintIndigoColorData">
  1962. select id, site, code_no, printSide, [order]
  1963. from plm_bm_printIndigoColor
  1964. where site = #{site}
  1965. and code_no = #{codeNo}
  1966. and printSide = #{printSide}
  1967. and [order] = #{order}
  1968. </select>
  1969. <insert id="saveBMprintIndigoColor">
  1970. insert into plm_bm_printIndigoColor
  1971. (site, code_no, [order], printSide, colorReference, inkCode, colorMatch,
  1972. printMotion, opticalDensity, lut, lpi, screenAngle, printHits, blanketTemperture,
  1973. remark, updateBy, updateDate)
  1974. values
  1975. (#{site}, #{codeNo}, #{order}, #{printSide}, #{colorReference}, #{inkCode}, #{colorMatch},
  1976. #{printMotion}, #{opticalDensity}, #{lut}, #{lpi}, #{screenAngle}, #{printHits}, #{blanketTemperture},
  1977. #{remark}, #{updateBy}, GetDate())
  1978. </insert>
  1979. <insert id="saveBMPrintIndigoColors">
  1980. insert into plm_bm_printIndigoColor
  1981. (site, code_no, [order], printSide, colorReference, inkCode, colorMatch,
  1982. printMotion, opticalDensity, lut, lpi, screenAngle, printHits, blanketTemperture,
  1983. remark, updateBy, updateDate)
  1984. values
  1985. <foreach collection="list" item="item" index="index" separator=",">
  1986. (#{item.site}, #{item.codeNo}, #{item.order}, #{item.printSide}, #{item.colorReference}, #{item.inkCode}, #{item.colorMatch},
  1987. #{item.printMotion}, #{item.opticalDensity}, #{item.lut}, #{item.lpi}, #{item.screenAngle}, #{item.printHits}, #{item.blanketTemperture},
  1988. #{item.remark}, #{item.updateBy}, GetDate())
  1989. </foreach>
  1990. </insert>
  1991. <update id="updateBMprintIndigoColor">
  1992. update plm_bm_printIndigoColor
  1993. set printSide=#{printSide},
  1994. [order]=#{order,jdbcType=INTEGER},
  1995. colorReference=#{colorReference},
  1996. inkCode=#{inkCode},
  1997. colorMatch=#{colorMatch},
  1998. printMotion=#{printMotion},
  1999. opticalDensity=#{opticalDensity},
  2000. lut=#{lut},
  2001. lpi=#{lpi},
  2002. screenAngle=#{screenAngle},
  2003. printHits=#{printHits},
  2004. blanketTemperture=#{blanketTemperture},
  2005. remark=#{remark},
  2006. updateDate=GetDate(),
  2007. updateBy=#{updateBy}
  2008. where id = #{id}
  2009. </update>
  2010. <delete id="deleteBMprintIndigoColor">
  2011. delete
  2012. from plm_bm_printIndigoColor
  2013. where id = #{id}
  2014. </delete>
  2015. <delete id="deleteBMPrintIndigoColorByCodeNo">
  2016. delete from plm_bm_printIndigoColor
  2017. where site = #{site} and code_no = #{codeNo}
  2018. </delete>
  2019. <select id="selectTechnicalSpecification" resultType="PlmTechnicalSpecificationSheet">
  2020. SELECT id,
  2021. site,
  2022. code_no,
  2023. proofing_no,
  2024. project_id,
  2025. test_part_no,
  2026. status,
  2027. rev_no,
  2028. work_center_no,
  2029. ECN_flag,
  2030. ECN_no,
  2031. ECN_address,
  2032. remark,
  2033. create_date,
  2034. create_by,
  2035. update_date,
  2036. update_by,
  2037. picture_addess,
  2038. customerPictureChangeRemark,
  2039. productionFileComments,
  2040. ori_code_no,
  2041. bom_type,
  2042. eng_chg_level,
  2043. bom_alternative_no,
  2044. routing_type,
  2045. routing_revision,
  2046. routing_alternative_no,
  2047. remarkPage,
  2048. process,
  2049. stage,
  2050. materialType,
  2051. cqcOperator,
  2052. faiOperator,
  2053. overPrintOperator,
  2054. printOperator,
  2055. peOperater,
  2056. csOperater,
  2057. step_id,
  2058. reject_flag,
  2059. reject_step_id,
  2060. mpOperator,
  2061. pod,
  2062. relevance_part_no,
  2063. ecn_upgrade_version,
  2064. ecn_need_change_drawing,
  2065. ecn_upgrade_flag
  2066. FROM plm_technical_specification_sheet a
  2067. where a.site = #{site}
  2068. and a.code_no = #{codeNo}
  2069. </select>
  2070. <update id="updateStatus" parameterType="PlmTechnicalSpecificationSheetData">
  2071. update plm_technical_specification_sheet
  2072. set status = #{status},
  2073. update_date = getDate(),
  2074. update_by = #{userName}
  2075. where site = #{site} and code_no = #{codeNo}
  2076. </update>
  2077. <select id="selectTechnicalSpecificationTeam" parameterType="string" resultType="PlmTechnicalSpecificationTeamData">
  2078. SELECT a.site,
  2079. a.code_no,
  2080. a.operator_id,
  2081. a.type,
  2082. b.domain_control_account
  2083. FROM plm_technicalSpecification_team as a
  2084. left join sys_user as b on a.operator_id = b.username
  2085. where a.site = #{site} and a.code_no = #{codeNo}
  2086. </select>
  2087. <select id="getBMStatusDesc" resultType="PlmTechnicalSpecificationSheetData">
  2088. SELECT id,
  2089. site,
  2090. code_no,
  2091. dbo.plm_get_technicalBaseDesc(a.status, 'status') statusDesc
  2092. FROM plm_technical_specification_sheet a
  2093. where a.site = #{site}
  2094. and a.code_no = #{codeNo}
  2095. </select>
  2096. <select id="getFinalPartData" resultType="PlmProjectPartData">
  2097. Select
  2098. a.Final_Part_No,
  2099. a.Test_part_no,
  2100. a.Active,
  2101. a.Part_desc,
  2102. a.project_id,
  2103. pcpi.customer_part_no,
  2104. a.bu_no
  2105. from view_Project_final_Part as a
  2106. left join plm_project_info as c on a.site = c.site and a.project_id = c.project_id
  2107. left join plm_customer_part_info as pcpi on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no
  2108. left join plm_technical_specification_sheet d on a.site = d.site and a.test_part_no = d.test_part_no
  2109. <where>
  2110. and d.test_part_no is null
  2111. and a.site = #{query.site}
  2112. <if test="query.projectId != null and query.projectId != ''">
  2113. AND a.project_id like #{query.projectId}
  2114. </if>
  2115. <if test="query.finalPartNo != null and query.finalPartNo != ''">
  2116. AND a.Final_Part_No like #{query.finalPartNo}
  2117. </if>
  2118. <if test="query.customerPartNo != null and query.customerPartNo != ''">
  2119. AND pcpi.customer_part_no like #{query.customerPartNo}
  2120. </if>
  2121. <if test="query.testPartNo != null and query.testPartNo != ''">
  2122. AND a.Test_part_no like #{query.testPartNo}
  2123. </if>
  2124. <if test="query.partDesc != null and query.partDesc != ''">
  2125. AND a.Part_desc like #{query.partDesc}
  2126. </if>
  2127. and a.RealFlag = 'Y'
  2128. </where>
  2129. </select>
  2130. <select id="getOADetailForBM" resultType="PlmTechnicalSpecificationSheetData">
  2131. select
  2132. top 1
  2133. d.is_reject,
  2134. d.node_id,
  2135. d.node_name,
  2136. dbo.get_plm_Approval_username(a.site, prh.workflow_id, d.node_id, a.code_no) as sp
  2137. from plm_technical_specification_sheet a
  2138. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'
  2139. 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
  2140. where a.site = #{site} and a.code_no = #{codeNo}
  2141. </select>
  2142. <select id="searchCopyPart" resultType="PlmProjectPartData">
  2143. Select
  2144. a.Final_Part_No,
  2145. a.Test_part_no,
  2146. a.Active,
  2147. a.Part_desc,
  2148. a.project_id,
  2149. pcpi.customer_part_no,
  2150. a.bu_no
  2151. from plm_project_info c
  2152. left join view_Project_Part a on a.site = c.site and a.project_id = c.project_id
  2153. 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
  2154. left join part p on a.Final_Part_No = p.part_no
  2155. left join plm_technical_specification_sheet ps on a.site = ps.site and a.Test_part_no = ps.Test_part_no
  2156. <where>
  2157. a.site = #{query.site}
  2158. <if test = "query.buNo != null and query.buNo != ''">
  2159. AND a.bu_no = #{query.buNo}
  2160. </if>
  2161. <if test = "query.finalPartNo != null and query.finalPartNo != ''">
  2162. AND a.Final_Part_No LIKE #{query.finalPartNo}
  2163. </if>
  2164. <if test = "query.testPartNo != null and query.testPartNo != ''">
  2165. AND a.Test_Part_No LIKE #{query.testPartNo}
  2166. </if>
  2167. <if test = "query.projectId != null and query.projectId != ''">
  2168. AND a.project_id LIKE #{query.projectId}
  2169. </if>
  2170. <if test = "query.customerPartNo != null and query.customerPartNo != ''">
  2171. AND pcpi.customer_part_no LIKE #{query.customerPartNo}
  2172. </if>
  2173. and a.realFlag = 'Y'
  2174. and ps.Test_part_no is null
  2175. and dbo.Get_PartHasRealBOMRoute(a.site, a.Final_Part_No) = 'Y'
  2176. </where>
  2177. <!-- a.project_id = #{projectId}-->
  2178. <!-- and a.site = #{site}-->
  2179. <!-- and a.Test_part_no != #{testPartNo}-->
  2180. <!-- and a.realFlag = 'Y'-->
  2181. <!-- and ps.Test_part_no is null-->
  2182. <!-- and dbo.Get_PartHasRealBOMRoute(a.site, a.Final_Part_No) = 'Y'-->
  2183. </select>
  2184. <select id="queryCustomerPartNo" resultType="java.lang.String">
  2185. select top 1 pcpi.customer_part_no
  2186. from plm_customer_part_info pcpi
  2187. where pcpi.site = #{site}
  2188. and pcpi.customer_no = #{customerId}
  2189. and pcpi.part_no = #{partNo}
  2190. </select>
  2191. <insert id="saveCustomerPartNo">
  2192. insert into plm_customer_part_info(site, customer_no, part_no, customer_part_no, create_date, create_by)
  2193. values (#{site}, #{customerId}, #{partNo}, #{customerPartNo}, getdate(), #{username})
  2194. </insert>
  2195. <update id="updateCustomerPartNo">
  2196. update plm_customer_part_info
  2197. set customer_part_no = #{customerPartNo},
  2198. update_by = #{username},
  2199. update_date = getdate()
  2200. where site = #{site}
  2201. and customer_no = #{customerId}
  2202. and part_no = #{partNo}
  2203. </update>
  2204. <select id="technicalSpecificationList" resultType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
  2205. SELECT
  2206. a.id,
  2207. a.site,
  2208. a.code_no as codeNo,
  2209. a.project_id as projectId,
  2210. a.test_part_no as testPartNo,
  2211. a.status,
  2212. a.rev_no as revNo,
  2213. a.work_center_no as workCenterNo,
  2214. a.ECN_flag as ecnFlag,
  2215. a.ECN_no as ecnNo,
  2216. a.ori_code_no as oriCodeNo,
  2217. a.ECN_address as ecnAddress,
  2218. a.remark,
  2219. a.create_date as createDate,
  2220. a.create_by as createBy,
  2221. a.update_date as updateDate,
  2222. a.update_by as updateBy,
  2223. b.final_part_no as finalPartNo,
  2224. b.part_type as partTypeDesc,
  2225. b.part_type as partType,
  2226. b.part_name as partName,
  2227. b.part_desc as partDesc,
  2228. b.part_spec as partSpec,
  2229. dbo.plm_get_technicalBaseDesc(a.status, 'status') as statusDesc,
  2230. a.proofing_no as proofingNo,
  2231. b.bu_no as buNo,
  2232. dbo.plm_get_bu_desc(a.site, b.bu_no) as buDesc,
  2233. process,
  2234. c.customer_Id as customerId,
  2235. a.picture_addess as pictureAddess,
  2236. a.customerPictureChangeRemark,
  2237. a.productionFileComments,
  2238. a.bom_type as bomType,
  2239. a.eng_chg_level as engChgLevel,
  2240. a.bom_alternative_no as bomAlternativeNo,
  2241. a.routing_type as routingType,
  2242. a.routing_revision as routingRevision,
  2243. a.routing_alternative_no as routingAlternativeNo,
  2244. a.pod,
  2245. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'cs') csOperater,
  2246. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'cs') csOperaterName,
  2247. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'engineer') engineerNo,
  2248. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'engineer') engineer,
  2249. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'technician') technicianNo,
  2250. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'technician') technician,
  2251. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'mp') mpOperator,
  2252. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'mp') mpOperatorName,
  2253. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'dcc') dccOperaterName,
  2254. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'cqc') cqcOperatorName,
  2255. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'fai') faiOperatorName,
  2256. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'plan') planOperater,
  2257. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'plan') planOperaterName,
  2258. d.is_reject as isReject,
  2259. d.node_id as nodeId,
  2260. d.node_name as nodeName,
  2261. pcpi.customer_part_no as customerPartNo,
  2262. dbo.get_plm_Approval_username(a.site, prh.workflow_id, d.node_id, a.code_no) as sp,
  2263. a.remarkPage,
  2264. a.rev,
  2265. a.customer_rev as customerRev,
  2266. b.plm_part_no as plmPartNo,
  2267. c.project_name as projectName,
  2268. a.document_source as documentSource
  2269. FROM plm_technical_specification_sheet a
  2270. left join view_Project_final_Part b
  2271. on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no
  2272. left join plm_project_info c on a.site = c.site and a.project_id = c.project_id
  2273. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'
  2274. left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and
  2275. prh.workflow_id = d.workflow_id and a.step_id = d.step_id
  2276. left join plm_customer_part_info pcpi
  2277. on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no
  2278. <if test="cutterNumber != null and cutterNumber != ''">
  2279. inner join plm_bm_prepress pbp on pbp.Site = a.site and pbp.code_no = a.code_no and
  2280. (plateNo like #{cutterNumber} or
  2281. cutterNumber like #{cutterNumber})
  2282. </if>
  2283. <where>
  2284. <if test="id != null">
  2285. AND a.id = #{id}
  2286. </if>
  2287. <if test="site != null and site != ''">
  2288. AND a.site = #{site}
  2289. </if>
  2290. <if test="ecnFlag != null and ecnFlag != ''">
  2291. AND a.ecn_flag = #{ecnFlag}
  2292. </if>
  2293. <if test="oriCodeNo != null and oriCodeNo != ''">
  2294. AND a.ori_code_no like #{oriCodeNo}
  2295. </if>
  2296. <if test="codeNo != null and codeNo != ''">
  2297. AND a.code_no like #{codeNo}
  2298. </if>
  2299. <if test="projectId != null and projectId != ''">
  2300. AND a.project_id like #{projectId}
  2301. </if>
  2302. <if test="testPartNo != null and testPartNo != ''">
  2303. AND (
  2304. a.test_part_no like #{testPartNo} or
  2305. b.final_part_no like #{testPartNo} or
  2306. a.relevance_part_no like #{testPartNo} or
  2307. pcpi.customer_part_no like #{testPartNo}
  2308. )
  2309. </if>
  2310. <if test="customerDesc != null and customerDesc != ''">
  2311. AND (
  2312. dbo.plm_get_customer_desc(c.site, c.customer_id) like #{customerDesc})
  2313. </if>
  2314. <if test="statusDesc == null or statusDesc == ''">
  2315. and a.status != 'death'
  2316. </if>
  2317. <if test="statusDesc != null and statusDesc != ''">
  2318. <!-- AND dbo.plm_get_technicalBaseDesc(a.status, 'status') like #{statusDesc}-->
  2319. and a.status = #{statusDesc}
  2320. </if>
  2321. <if test="buNo == null || buNo == ''">
  2322. AND b.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(#{site}, #{userName}))
  2323. </if>
  2324. <if test="buNo != null and buNo != ''">
  2325. AND b.bu_no like #{buNo}
  2326. </if>
  2327. <if test="nodeId != null and nodeId != ''">
  2328. AND d.node_id like #{nodeId}
  2329. </if>
  2330. <if test="sp != null and sp != ''">
  2331. AND dbo.get_plm_Approval_username(a.site, prh.workflow_id, d.node_id, a.code_no) like #{sp}
  2332. </if>
  2333. <if test="documentSource != null and documentSource != ''">
  2334. AND a.document_source = #{documentSource}
  2335. </if>
  2336. </where>
  2337. order by a.ori_code_no desc, a.rev_no desc
  2338. </select>
  2339. <select id="queryTechnicalSpecificationCount" resultType="long">
  2340. SELECT count(1)
  2341. FROM plm_technical_specification_sheet a
  2342. left join view_Project_final_Part b
  2343. on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no
  2344. left join plm_project_info c on a.site = c.site and a.project_id = c.project_id
  2345. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'
  2346. left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and
  2347. prh.workflow_id = d.workflow_id and a.step_id = d.step_id
  2348. left join plm_customer_part_info pcpi
  2349. on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no
  2350. <if test="cutterNumber != null and cutterNumber != ''">
  2351. inner join plm_bm_prepress pbp on pbp.Site = a.site and pbp.code_no = a.code_no and
  2352. (plateNo like #{cutterNumber} or
  2353. cutterNumber like #{cutterNumber})
  2354. </if>
  2355. <where>
  2356. <if test="id != null">
  2357. AND a.id = #{id}
  2358. </if>
  2359. <if test="site != null and site != ''">
  2360. AND a.site = #{site}
  2361. </if>
  2362. <if test="ecnFlag != null and ecnFlag != ''">
  2363. AND a.ecn_flag = #{ecnFlag}
  2364. </if>
  2365. <if test="oriCodeNo != null and oriCodeNo != ''">
  2366. AND a.ori_code_no like #{oriCodeNo}
  2367. </if>
  2368. <if test="codeNo != null and codeNo != ''">
  2369. AND a.code_no like #{codeNo}
  2370. </if>
  2371. <if test="projectId != null and projectId != ''">
  2372. AND a.project_id like #{projectId}
  2373. </if>
  2374. <if test="testPartNo != null and testPartNo != ''">
  2375. AND (
  2376. a.test_part_no like #{testPartNo} or
  2377. b.final_part_no like #{testPartNo} or
  2378. a.relevance_part_no like #{testPartNo} or
  2379. pcpi.customer_part_no like #{testPartNo}
  2380. )
  2381. </if>
  2382. <if test="customerDesc != null and customerDesc != ''">
  2383. AND (
  2384. dbo.plm_get_customer_desc(c.site, c.customer_id) like #{customerDesc} or
  2385. dbo.plm_get_dictDataLabel('finalCustomer', c.final_customer_id, c.site) like #{customerDesc}
  2386. )
  2387. </if>
  2388. <if test="statusDesc == null or statusDesc == ''">
  2389. and a.status != 'death'
  2390. </if>
  2391. <if test="statusDesc != null and statusDesc != ''">
  2392. AND a.status like #{statusDesc}
  2393. </if>
  2394. <if test="buNo == null || buNo == ''">
  2395. AND b.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(#{site}, #{userName}))
  2396. </if>
  2397. <if test="buNo != null and buNo != ''">
  2398. AND b.bu_no like #{buNo}
  2399. </if>
  2400. <if test="documentSource != null and documentSource != ''">
  2401. AND a.document_source = #{documentSource}
  2402. </if>
  2403. </where>
  2404. </select>
  2405. <select id="queryTechnicalSpecificationList" resultType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
  2406. EXEC dbo.getTechnicalSpecificationPageWithSql #{sql}, #{page}, #{limit}
  2407. </select>
  2408. <select id="queryChangeLog" resultType="com.spring.modules.change.vo.ChangeRequestVo">
  2409. WITH SpecCode AS (SELECT ori_code_no
  2410. FROM plm_technical_specification_sheet
  2411. WHERE site = #{site}
  2412. AND code_no = #{codeNo}),
  2413. TargetCode AS (SELECT code_no
  2414. FROM plm_technical_specification_sheet
  2415. WHERE ori_code_no IN (SELECT ori_code_no FROM SpecCode))
  2416. SELECT a.site,
  2417. a.bu_no,
  2418. a.change_no,
  2419. a.applicant_id,
  2420. dbo.get_userDisPlay(a.applicant_id) AS applicantName,
  2421. b.department_no AS applicationDepartmentId,
  2422. dbo.get_department_name(a.site, b.department_no) AS applicationDepartmentName,
  2423. a.apply_date,
  2424. a.ecn_type,
  2425. a.change_impact,
  2426. a.change_impact_desc,
  2427. a.ecn_stage,
  2428. a.change_type,
  2429. a.tp_engineer_id,
  2430. dbo.get_userDisPlay(a.tp_engineer_id) AS tpEngineerName,
  2431. a.change_phase_in_date,
  2432. a.df_is_product,
  2433. a.printing,
  2434. a.manufacturing_cost_is_change,
  2435. a.change_request_desc,
  2436. a.is_re_quote,
  2437. a.ul_certification_requirements,
  2438. a.ul_continue_to_meet_demand,
  2439. a.gp_certification_requirements,
  2440. a.gp_continue_to_meet_demand,
  2441. a.create_date,
  2442. a.create_by,
  2443. a.update_date,
  2444. a.update_by,
  2445. a.industrial_engineer_id,
  2446. dbo.get_userDisPlay(a.industrial_engineer_id) AS industrialEngineerName,
  2447. a.change_status,
  2448. a.cqc_operator_id,
  2449. dbo.get_userDisPlay(a.cqc_operator_id) AS cqcOperatorName,
  2450. a.fai_operator_id,
  2451. dbo.get_userDisPlay(a.fai_operator_id) AS faiOperatorName,
  2452. a.step_id,
  2453. a.reject_flag,
  2454. a.reject_step_id
  2455. FROM plm_change_request a
  2456. LEFT JOIN sys_user b
  2457. ON a.site = b.site AND a.applicant_id = b.username
  2458. LEFT JOIN plm_change_request_detail pcrd
  2459. ON a.site = pcrd.site AND a.change_no = pcrd.change_no
  2460. WHERE a.site = #{site}
  2461. AND a.show_in_query_flag = 'Y'
  2462. AND pcrd.code_no IN (SELECT code_no FROM TargetCode)
  2463. </select>
  2464. <!-- <select id="queryChangeLog" resultType="com.spring.modules.change.vo.ChangeRequestVo">-->
  2465. <!-- SELECT a.site,-->
  2466. <!-- a.bu_no,-->
  2467. <!-- a.change_no,-->
  2468. <!-- a.applicant_id,-->
  2469. <!-- dbo.get_userDisPlay(a.applicant_id) as applicantName,-->
  2470. <!-- b.department_no as applicationDepartmentId,-->
  2471. <!-- dbo.get_department_name(a.site, b.department_no) as applicationDepartmentName,-->
  2472. <!-- a.apply_date,-->
  2473. <!-- a.ecn_type,-->
  2474. <!-- a.change_impact,-->
  2475. <!-- a.change_impact_desc,-->
  2476. <!-- a.ecn_stage,-->
  2477. <!-- a.change_type,-->
  2478. <!-- a.tp_engineer_id,-->
  2479. <!-- dbo.get_userDisPlay(a.tp_engineer_id) as tpEngineerName,-->
  2480. <!-- a.change_phase_in_date,-->
  2481. <!-- a.df_is_product,-->
  2482. <!-- a.printing,-->
  2483. <!-- a.manufacturing_cost_is_change,-->
  2484. <!-- a.change_request_desc,-->
  2485. <!-- a.is_re_quote,-->
  2486. <!-- a.ul_certification_requirements,-->
  2487. <!-- a.ul_continue_to_meet_demand,-->
  2488. <!-- a.gp_certification_requirements,-->
  2489. <!-- a.gp_continue_to_meet_demand,-->
  2490. <!-- a.create_date,-->
  2491. <!-- a.create_by,-->
  2492. <!-- a.update_date,-->
  2493. <!-- a.update_by,-->
  2494. <!-- a.industrial_engineer_id,-->
  2495. <!-- dbo.get_userDisPlay(a.industrial_engineer_id) as industrialEngineerName,-->
  2496. <!-- a.change_status,-->
  2497. <!-- a.cqc_operator_id,-->
  2498. <!-- dbo.get_userDisPlay(a.cqc_operator_id) as cqcOperatorName,-->
  2499. <!-- a.fai_operator_id,-->
  2500. <!-- dbo.get_userDisPlay(a.fai_operator_id) as faiOperatorName,-->
  2501. <!-- a.step_id,-->
  2502. <!-- a.reject_flag,-->
  2503. <!-- a.reject_step_id-->
  2504. <!-- FROM plm_change_request a-->
  2505. <!-- LEFT JOIN sys_user as b on a.site = b.site and a.applicant_id = b.username-->
  2506. <!-- left join plm_change_request_detail pcrd on a.site = pcrd.site and a.change_no = pcrd.change_no-->
  2507. <!-- where a.site = #{site}-->
  2508. <!-- and a.show_in_query_flag = 'Y'-->
  2509. <!-- and pcrd.code_no IN-->
  2510. <!-- (SELECT code_no FROM plm_technical_specification_sheet WHERE site = #{site} AND ori_code_no = #{codeNo})-->
  2511. <!-- </select>-->
  2512. <update id="updateBMStepId" parameterType="PlmTechnicalSpecificationSheetData">
  2513. update plm_technical_specification_sheet
  2514. set step_id = #{stepId}
  2515. where site = #{site} and code_no = #{codeNo}
  2516. </update>
  2517. <update id="updateBMIsRemark" parameterType="PlmTechnicalSpecificationSheetData">
  2518. update plm_process_form
  2519. set is_remark = 1
  2520. where site = #{site} and document_no = #{codeNo} and document_type = 'BM' and is_remark = 0
  2521. </update>
  2522. <select id="nodeList" resultType="com.spring.modules.sampleManagement.entity.NodeVo"
  2523. parameterType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
  2524. SELECT distinct
  2525. d.node_id AS nodeId,
  2526. d.node_name AS nodeName
  2527. FROM
  2528. plm_technical_specification_sheet AS a
  2529. LEFT JOIN plm_request_header AS prh ON a.site = prh.site
  2530. AND prh.menu_id = '103002'
  2531. LEFT JOIN plm_request_node AS d ON a.site = d.site
  2532. AND prh.classification_no = d.classification_no
  2533. AND prh.workflow_id = d.workflow_id
  2534. AND a.step_id = d.step_id
  2535. WHERE
  2536. d.site = #{ site }
  2537. </select>
  2538. <!-- <select id="queryTechnicalSpecificationCountByAnyField" resultType="java.lang.Long">-->
  2539. <!-- SELECT count(1)-->
  2540. <!-- FROM plm_technical_specification_sheet a-->
  2541. <!-- left join view_Project_final_Part b-->
  2542. <!-- on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no-->
  2543. <!-- left join plm_project_info c on a.site = c.site and a.project_id = c.project_id-->
  2544. <!-- left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'-->
  2545. <!-- left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and-->
  2546. <!-- prh.workflow_id = d.workflow_id and a.step_id = d.step_id-->
  2547. <!-- left join plm_customer_part_info pcpi-->
  2548. <!-- on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no-->
  2549. <!-- <if test="cutterNumber != null and cutterNumber != ''">-->
  2550. <!-- inner join plm_bm_prepress pbp on pbp.Site = a.site and pbp.code_no = a.code_no and-->
  2551. <!-- (plateNo like #{cutterNumber} or-->
  2552. <!-- cutterNumber like #{cutterNumber})-->
  2553. <!-- </if>-->
  2554. <!-- <if test="whereClause != null and whereClause != ''">-->
  2555. <!-- WHERE ${whereClause}-->
  2556. <!-- </if>-->
  2557. <!-- <if test="orderClause != null and orderClause != ''">-->
  2558. <!-- ORDER BY ${orderClause}-->
  2559. <!-- </if>-->
  2560. <!-- </select>-->
  2561. <!-- <select id="technicalSpecificationListByAnyField"-->
  2562. <!-- resultType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">-->
  2563. <!-- SELECT-->
  2564. <!-- a.id,-->
  2565. <!-- a.site,-->
  2566. <!-- a.code_no as codeNo,-->
  2567. <!-- a.project_id as projectId,-->
  2568. <!-- a.test_part_no as testPartNo,-->
  2569. <!-- a.status,-->
  2570. <!-- a.rev_no as revNo,-->
  2571. <!-- a.work_center_no as workCenterNo,-->
  2572. <!-- a.ECN_flag as ecnFlag,-->
  2573. <!-- a.ECN_no as ecnNo,-->
  2574. <!-- a.ori_code_no as oriCodeNo,-->
  2575. <!-- a.ECN_address as ecnAddress,-->
  2576. <!-- a.remark,-->
  2577. <!-- a.create_date as createDate,-->
  2578. <!-- a.create_by as createBy,-->
  2579. <!-- a.update_date as updateDate,-->
  2580. <!-- a.update_by as updateBy,-->
  2581. <!-- b.final_part_no as finalPartNo,-->
  2582. <!-- b.part_type as partTypeDesc,-->
  2583. <!-- b.part_type as partType,-->
  2584. <!-- b.part_name as partName,-->
  2585. <!-- b.part_desc as partDesc,-->
  2586. <!-- b.part_spec as partSpec,-->
  2587. <!-- dbo.plm_get_technicalBaseDesc(a.status, 'status') as statusDesc,-->
  2588. <!-- a.proofing_no as proofingNo,-->
  2589. <!-- b.bu_no as buNo,-->
  2590. <!-- dbo.plm_get_bu_desc(a.site, b.bu_no) as buDesc,-->
  2591. <!-- process,-->
  2592. <!-- c.customer_Id as customerId,-->
  2593. <!-- a.picture_addess as pictureAddess,-->
  2594. <!-- a.customerPictureChangeRemark,-->
  2595. <!-- a.productionFileComments,-->
  2596. <!-- a.bom_type as bomType,-->
  2597. <!-- a.eng_chg_level as engChgLevel,-->
  2598. <!-- a.bom_alternative_no as bomAlternativeNo,-->
  2599. <!-- a.routing_type as routingType,-->
  2600. <!-- a.routing_revision as routingRevision,-->
  2601. <!-- a.routing_alternative_no as routingAlternativeNo,-->
  2602. <!-- a.pod,-->
  2603. <!-- dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'cs') csOperater,-->
  2604. <!-- dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'cs') csOperaterName,-->
  2605. <!-- dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'engineer') engineerNo,-->
  2606. <!-- dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'engineer') engineer,-->
  2607. <!-- dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'technician') technicianNo,-->
  2608. <!-- dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'technician') technician,-->
  2609. <!-- dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'mp') mpOperator,-->
  2610. <!-- dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'mp') mpOperatorName,-->
  2611. <!-- dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'dcc') dccOperaterName,-->
  2612. <!-- dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'cqc') cqcOperatorName,-->
  2613. <!-- dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'fai') faiOperatorName,-->
  2614. <!-- d.is_reject as isReject,-->
  2615. <!-- d.node_id as nodeId,-->
  2616. <!-- d.node_name as nodeName,-->
  2617. <!-- pcpi.customer_part_no as customerPartNo,-->
  2618. <!-- dbo.get_plm_Approval_username(a.site, prh.workflow_id, d.node_id, a.code_no) as sp,-->
  2619. <!-- a.remarkPage,-->
  2620. <!-- a.rev,-->
  2621. <!-- a.customer_rev as customerRev,-->
  2622. <!-- b.plm_part_no as plmPartNo,-->
  2623. <!-- c.project_name as projectName,-->
  2624. <!-- a.document_source as documentSource-->
  2625. <!-- FROM plm_technical_specification_sheet a-->
  2626. <!-- left join view_Project_final_Part b-->
  2627. <!-- on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no-->
  2628. <!-- left join plm_project_info c on a.site = c.site and a.project_id = c.project_id-->
  2629. <!-- left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'-->
  2630. <!-- left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and-->
  2631. <!-- prh.workflow_id = d.workflow_id and a.step_id = d.step_id-->
  2632. <!-- left join plm_customer_part_info pcpi-->
  2633. <!-- on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no-->
  2634. <!-- <if test="cutterNumber != null and cutterNumber != ''">-->
  2635. <!-- inner join plm_bm_prepress pbp on pbp.Site = a.site and pbp.code_no = a.code_no and-->
  2636. <!-- (plateNo like #{cutterNumber} or-->
  2637. <!-- cutterNumber like #{cutterNumber})-->
  2638. <!-- </if>-->
  2639. <!-- <if test="whereClause != null and whereClause != ''">-->
  2640. <!-- WHERE ${whereClause}-->
  2641. <!-- </if>-->
  2642. <!-- <if test="orderClause != null and orderClause != ''">-->
  2643. <!-- ORDER BY ${orderClause}-->
  2644. <!-- </if>-->
  2645. <!-- </select>-->
  2646. </mapper>