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.

2642 lines
109 KiB

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