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.

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