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.

2645 lines
108 KiB

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