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.

2876 lines
121 KiB

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