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.

3258 lines
138 KiB

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