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.

1598 lines
79 KiB

2 years ago
9 months ago
9 months ago
1 year ago
9 months ago
1 year ago
9 months ago
1 year ago
9 months ago
1 year ago
9 months ago
1 year ago
9 months ago
1 year ago
9 months ago
1 year ago
9 months ago
1 year ago
9 months ago
1 year ago
9 months ago
1 year ago
9 months ago
9 months ago
9 months ago
10 months ago
9 months ago
1 year ago
9 months ago
1 year ago
11 months ago
1 year ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
9 months ago
1 year ago
1 year ago
2 years ago
2 years ago
10 months ago
2 years ago
2 years ago
1 year ago
2 years ago
9 months ago
2 years ago
2 years ago
1 year ago
10 months ago
1 year ago
2 years ago
2 years ago
9 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
10 months ago
1 year ago
10 months ago
1 year ago
2 years ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
10 months ago
2 years ago
2 years ago
10 months ago
9 months ago
10 months ago
2 years ago
10 months ago
2 years ago
2 years ago
2 years ago
10 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
9 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
9 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
10 months ago
2 years ago
2 years ago
10 months ago
2 years ago
2 years ago
2 years ago
10 months ago
2 years ago
2 years ago
2 years ago
10 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
11 months ago
1 year ago
1 year ago
9 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
9 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
10 months ago
9 months ago
9 months ago
9 months ago
2 years ago
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.spring.modules.sampleManagement.dao.TechnicalSpecificationMapper">
  4. <resultMap id="getTechnicalSpecificationSheetData" type="PlmTechnicalSpecificationSheetData">
  5. <result column="id" property="id"/>
  6. <result column="site" property="site"/>
  7. <result column="code_no" property="codeNo"/>
  8. <result column="project_id" property="projectId"/>
  9. <result column="test_part_no" property="testPartNo"/>
  10. <result column="status" property="status"/>
  11. <result column="rev_no" property="revNo"/>
  12. <result column="work_center_no" property="workCenterNo"/>
  13. <result column="ECN_flag" property="ecnFlag"/>
  14. <result column="ECN_no" property="ecnNo"/>
  15. <result column="ori_code_no" property="oriCodeNo"/>
  16. <result column="ECN_address" property="ecnAddress"/>
  17. <result column="remark" property="remark"/>
  18. <result column="create_date" property="createDate"/>
  19. <result column="create_by" property="createBy"/>
  20. <result column="update_date" property="updateDate"/>
  21. <result column="update_by" property="updateBy"/>
  22. <result column="final_part_no" property="finalPartNo"/>
  23. <result column="partTypeDesc" property="partTypeDesc"/>
  24. <result column="partType" property="partType"/>
  25. <result column="part_name" property="partName"/>
  26. <result column="part_desc" property="partDesc"/>
  27. <result column="part_spec" property="partSpec"/>
  28. <result column="statusDesc" property="statusDesc"/>
  29. <result column="proofing_no" property="proofingNo"/>
  30. <result column="bu_no" property="buNo"/>
  31. <result column="buDesc" property="buDesc"/>
  32. <result column="engineer" property="engineer"/>
  33. <result column="technician" property="technician"/>
  34. <result column="process" property="process"/>
  35. <result column="quotationOfficer" property="quotationOfficer"/>
  36. <result column="engineerNo" property="engineerNo"/>
  37. <result column="technicianNo" property="technicianNo"/>
  38. <result column="customer_Id" property="customerId"/>
  39. <result column="picture_addess" property="pictureAddess"/>
  40. <result column="customerPictureChangeRemark" property="customerPictureChangeRemark"/>
  41. <result column="productionFileComments" property="productionFileComments"/>
  42. <result column="bom_type" property="bomType"/>
  43. <result column="eng_chg_level" property="engChgLevel"/>
  44. <result column="bom_alternative_no" property="bomAlternativeNo"/>
  45. <result column="routing_type" property="routingType"/>
  46. <result column="routing_revision" property="routingRevision"/>
  47. <result column="routing_alternative_no" property="routingAlternativeNo"/>
  48. <result column="pod" property="pod"/>
  49. <result column="mpOperator" property="mpOperator"/>
  50. <result column="mpOperatorName" property="mpOperatorName"/>
  51. <result column="cqcOperator" property="cqcOperator"/>
  52. <result column="cqcOperatorName" property="cqcOperatorName"/>
  53. <result column="faiOperator" property="faiOperator"/>
  54. <result column="faiOperatorName" property="faiOperatorName"/>
  55. <result column="peOperater" property="peOperater"/>
  56. <result column="peOperaterName" property="peOperaterName"/>
  57. <result column="csOperater" property="csOperater"/>
  58. <result column="dccOperater" property="dccOperater"/>
  59. <result column="dccOperaterName" property="dccOperaterName"/>
  60. <result column="is_reject" property="isReject"/>
  61. <result column="node_id" property="nodeId"/>
  62. <result column="node_name" property="nodeName"/>
  63. <result column="customer_part_no" property="customerPartNo"/>
  64. <result column="sp" property="sp"/>
  65. <result column="remarkPage" property="remarkPage"/>
  66. <result column="rev" property="rev"/>
  67. <result column="customer_rev" property="customerRev"/>
  68. <result column="plm_part_no" property="plmPartNo"/>
  69. <result column="project_name" property="projectName"/>
  70. </resultMap>
  71. <select id="technicalSpecificationListSearch" parameterType="PlmTechnicalSpecificationSheetData" resultType="PlmTechnicalSpecificationSheetData">
  72. SELECT a.id,
  73. a.site,
  74. a.code_no as codeNo,
  75. a.project_id as projectId,
  76. a.test_part_no as testPartNo,
  77. a.status,
  78. a.rev_no as revNo,
  79. a.work_center_no as workCenterNo,
  80. a.ECN_flag as ecnFlag,
  81. a.ECN_no as ecnNo,
  82. a.ori_code_no as oriCodeNo,
  83. a.ECN_address as ecnAddress,
  84. a.remark,
  85. a.create_date as createDate,
  86. a.create_by as createBy,
  87. a.update_date as updateDate,
  88. a.update_by as updateBy,
  89. b.final_part_no as finalPartNo,
  90. b.part_type as partTypeDesc,
  91. b.part_type as partType,
  92. b.part_name as partName,
  93. b.part_desc as partDesc,
  94. b.part_spec as partSpec,
  95. dbo.plm_get_technicalBaseDesc(a.status, 'status') as statusDesc,
  96. a.proofing_no as proofingNo,
  97. b.bu_no as buNo,
  98. dbo.plm_get_bu_desc(a.site, b.bu_no) as buDesc,
  99. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'engineer') as engineer,
  100. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'technician') as technician,
  101. process,
  102. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'quotationOfficer') as quotationOfficer,
  103. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'engineer') as engineerNo,
  104. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'technician') as technicianNo,
  105. c.customer_Id as customerId,
  106. a.picture_addess as pictureAddess,
  107. a.customerPictureChangeRemark,
  108. a.productionFileComments,
  109. a.bom_type as bomType,
  110. a.eng_chg_level as engChgLevel,
  111. a.bom_alternative_no as bomAlternativeNo,
  112. a.routing_type as routingType,
  113. a.routing_revision as routingRevision,
  114. a.routing_alternative_no as routingAlternativeNo,
  115. a.pod,
  116. a.mpOperator,
  117. dbo.get_userDisPlay(a.mpOperator) as mpOperatorName,
  118. a.cqcOperator,
  119. dbo.get_userDisPlay(a.cqcOperator) as cqcOperatorName,
  120. a.faiOperator,
  121. dbo.get_userDisPlay(a.faiOperator) as faiOperatorName,
  122. a.peOperater,
  123. dbo.get_userDisPlay(a.peOperater) as peOperaterName,
  124. a.csOperater,
  125. dbo.get_userDisPlay(a.csOperater) as csOperaterName,
  126. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'dcc') as dccOperater,
  127. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'dcc') as dccOperaterName,
  128. d.is_reject as isReject,
  129. d.node_id as nodeId,
  130. d.node_name as nodeName,
  131. pcpi.customer_part_no as customerPartNo,
  132. dbo.get_plm_Approval_username(a.site, prh.workflow_id, d.node_id, a.code_no) as sp,
  133. a.remarkPage,
  134. a.rev,
  135. a.customer_rev as customerRev,
  136. b.plm_part_no as plmPartNo,
  137. c.project_name as projectName
  138. FROM plm_technical_specification_sheet a
  139. left join view_Project_final_Part b
  140. on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no
  141. left join plm_project_info c on a.site = c.site and a.project_id = c.project_id
  142. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'
  143. left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and
  144. prh.workflow_id = d.workflow_id and a.step_id = d.step_id
  145. left join plm_customer_part_info pcpi
  146. on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no
  147. <if test="query.cutterNumber != null and query.cutterNumber != ''">
  148. inner join plm_bm_prepress pbp on pbp.Site = a.site and pbp.code_no = a.code_no and
  149. (plateNo like #{query.cutterNumber} or
  150. cutterNumber like #{query.cutterNumber})
  151. </if>
  152. <where>
  153. <if test="query.id != null">
  154. AND a.id = #{query.id}
  155. </if>
  156. <if test="query.site != null and query.site != ''">
  157. AND a.site = #{query.site}
  158. </if>
  159. <if test="query.ecnFlag != null and query.ecnFlag != ''">
  160. AND a.ecn_flag = #{query.ecnFlag}
  161. </if>
  162. <if test="query.oriCodeNo != null and query.oriCodeNo != ''">
  163. AND a.ori_code_no like #{query.oriCodeNo}
  164. </if>
  165. <if test="query.codeNo != null and query.codeNo != ''">
  166. AND a.code_no like #{query.codeNo}
  167. </if>
  168. <if test="query.projectId != null and query.projectId != ''">
  169. AND a.project_id like #{query.projectId}
  170. </if>
  171. <if test="query.testPartNo != null and query.testPartNo != ''">
  172. AND (
  173. a.test_part_no like #{query.testPartNo} or
  174. b.final_part_no like #{query.testPartNo} or
  175. a.relevance_part_no like #{query.testPartNo} or
  176. pcpi.customer_part_no like #{query.testPartNo}
  177. )
  178. </if>
  179. <if test="query.customerDesc != null and query.customerDesc != ''">
  180. AND (
  181. dbo.plm_get_customer_desc(c.site, c.customer_id) like #{query.customerDesc} or
  182. dbo.plm_get_dictDataLabel('finalCustomer', c.final_customer_id, c.site) like #{query.customerDesc}
  183. )
  184. </if>
  185. <if test="query.statusDesc != null and query.statusDesc != ''">
  186. AND dbo.plm_get_technicalBaseDesc(a.status, 'status') like #{query.statusDesc}
  187. </if>
  188. <if test="query.buNo == null || query.buNo == ''">
  189. AND b.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(#{query.site}, #{query.userName}))
  190. </if>
  191. <if test="query.buNo != null and query.buNo != ''">
  192. AND b.bu_no like #{query.buNo}
  193. </if>
  194. </where>
  195. order by a.ori_code_no desc, a.rev_no desc
  196. </select>
  197. <insert id="saveTechnicalSpecificationSheet">
  198. insert into plm_technical_specification_sheet(site, code_no, project_id, test_part_no, status, rev_no, ECN_flag,
  199. ECN_no, ECN_address, remark,
  200. create_date, create_by, proofing_no, ori_code_no, bom_type,
  201. eng_chg_level, bom_alternative_no, routing_type, routing_revision,
  202. routing_alternative_no, stage, materialType, step_id
  203. , cqcOperator, faiOperator, peOperater, csOperater, mpOperator, rev, customer_rev,certification)
  204. values ( #{site}, #{codeNo}, #{projectId}, #{testPartNo}, #{status}, #{revNo}, #{ecnFlag}, #{ecnNo}, #{ecnAddress}
  205. , #{remark}, GetDate(), #{createBy}, #{proofingNo}, #{oriCodeNo}, #{bomType}, #{engChgLevel,jdbcType=INTEGER}
  206. , #{bomAlternativeNo}, #{routingType}, #{routingRevision,jdbcType=INTEGER}, #{routingAlternativeNo}, 'Sample'
  207. , 'Label', 10
  208. , #{cqcOperator}, #{faiOperator}, #{peOperater}, #{csOperater}, #{mpOperator}, #{rev}, #{customerRev},'RoHs')
  209. </insert>
  210. <update id="updateProjectPartNowBm">
  211. update plm_project_part set now_bm=#{codeNo} where site=#{site} and project_id=#{projectId} and test_part_no=#{testPartNo}
  212. </update>
  213. <insert id="saveTechnicalSpecificationTeams">
  214. insert into plm_technicalSpecification_team (site,code_no,operator_id,type)
  215. values (#{site},#{codeNo},#{operatorId},#{type})
  216. </insert>
  217. <insert id="saveBatchTechnicalSpecificationTeams" >
  218. insert into plm_technicalSpecification_team (site,code_no,operator_id,type)
  219. values
  220. <foreach collection="list" item="item" separator=",">
  221. (#{item.site},#{item.codeNo},#{item.operatorId},#{item.type})
  222. </foreach>
  223. </insert>
  224. <update id="updateTechnicalSpecificationSheet">
  225. update plm_technical_specification_sheet set project_id=#{projectId},test_part_no=#{testPartNo},status=#{status}
  226. ,rev_no=#{revNo},ECN_no=#{ecnNo},ECN_flag=#{ecnFlag},ECN_address=#{ecnAddress},remark=#{remark},update_date=GetDate(),update_by=#{updateBy}
  227. ,cqcOperator=#{cqcOperator},faiOperator=#{faiOperator},peOperater=#{peOperater},
  228. csOperater=#{csOperater},mpOperator=#{mpOperator},rev=#{rev},customer_rev=#{customerRev}
  229. where id=#{id}
  230. </update>
  231. <delete id="deleteTechnicalSpecificationTeamsForBase">
  232. delete from plm_technicalSpecification_team where site=#{site} and code_no=#{codeNo} and type in ('quotationOfficer','engineer','technician','dcc','cqc','fai')
  233. </delete>
  234. <delete id="deleteTechnicalSpecificationTeamsForDetail">
  235. delete from plm_technicalSpecification_team where site=#{site} and code_no=#{codeNo} and type in ('reviewEngineer','peEngineer','cqe')
  236. </delete>
  237. <select id="searchTechnicalSpecificationTeamStr" resultType="String">
  238. select operator_id from plm_technicalSpecification_team where type=#{type} and site=#{site} and code_no=#{codeNo}
  239. </select>
  240. <select id="getTechnicalCustomerInfoData" resultType="TechnicalCustomerInfoData">
  241. select a.id,b.customer_id,c.customer_desc as customerName,c.customer_description as customerDesc ,b.customer_Remark,b.remark,
  242. a.picture_addess,a.customerPictureChangeRemark,a.productionFileComments
  243. from plm_technical_specification_sheet a
  244. left join plm_project_info b on a.site=b.site and a.project_id=b.project_id
  245. left join plm_customer_information c on b.site=c.site and b.customer_id=c.customer_no where a.id=#{id}
  246. </select>
  247. <select id="searchBMUser" resultType="PlmOperatorData">
  248. select a.username operator_id, a.user_display operator_name, b.site, b.bu_no as buNo
  249. from sys_user a
  250. left join AccessBu b on a.username = b.username
  251. <if test="roleNo != null and roleNo != ''">
  252. inner join AccessRole r on r.username = a.username and r.role_no = #{roleNo}
  253. </if>
  254. where b.bu_no = #{buNo}
  255. and b.site = #{site}
  256. order by a.username desc
  257. </select>
  258. <select id="tsdBasicInformationSearch" resultType="PlmTechnicalSpecificationSheetData">
  259. SELECT top 1 a.id,
  260. a.site,
  261. a.code_no,
  262. a.project_id,
  263. a.test_part_no,
  264. a.status,
  265. a.rev_no,
  266. a.work_center_no,
  267. a.ECN_flag,
  268. a.ECN_no,
  269. b.bu_no,
  270. a.ECN_address,
  271. a.remark,
  272. a.create_date,
  273. a.create_by,
  274. a.update_date,
  275. a.update_by,
  276. b.final_part_no,
  277. b.part_type partTypeDesc,
  278. b.part_type,
  279. b.part_name,
  280. b.part_desc,
  281. b.part_spec,
  282. dbo.plm_get_technicalBaseDesc(a.status, 'status') statusDesc,
  283. a.proofing_no,
  284. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'engineer') engineer,
  285. stage,
  286. dbo.plm_get_dictDataLabel('bm_process', process, a.site) process,
  287. remarkPage,
  288. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'quotationOfficer') quotationOfficer,
  289. c.customer_Id,
  290. a.ori_code_no,
  291. a.overPrintOperator,
  292. a.printOperator,
  293. dbo.get_userDisPlay(a.overPrintOperator) overPrintOperatorName,
  294. dbo.get_userDisPlay(a.printOperator) printOperatorName,
  295. a.peOperater,
  296. dbo.get_userDisPlay(a.peOperater) peOperaterName,
  297. a.csOperater,
  298. dbo.get_userDisPlay(a.csOperater) csOperaterName,
  299. isnull(a.step_id, 10) stepId,
  300. d.is_reject,
  301. a.pod,
  302. d.node_id,
  303. d.node_name,
  304. a.mpOperator,
  305. dbo.get_userDisPlay(a.mpOperator) mpOperatorName,
  306. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'technician') technician,
  307. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'engineer') engineerNo,
  308. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'dcc') dcc,
  309. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'technician') technicianNo,
  310. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'cqc') cqcOperatorName,
  311. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'fai') faiOperatorName,
  312. <!-- a.cqcOperator,-->
  313. <!-- a.faiOperator,-->
  314. <!-- dbo.get_userDisPlay(a.cqcOperator) cqcOperatorName,-->
  315. <!-- dbo.get_userDisPlay(a.faiOperator) faiOperatorName,-->
  316. a.rev,
  317. a.customer_rev,
  318. relevance_part_no
  319. FROM plm_technical_specification_sheet a
  320. left join view_Project_final_Part b
  321. on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no
  322. left join plm_project_info c on a.site = c.site and a.project_id = c.project_id
  323. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'
  324. left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and
  325. prh.workflow_id = d.workflow_id and isnull(a.step_id, 10) = d.step_id
  326. where a.site = #{site}
  327. and a.code_no = #{codeNo}
  328. </select>
  329. <delete id="deleteTechnicalSpecificationList">
  330. delete from plm_technical_specification_sheet where id=#{id}
  331. </delete>
  332. <update id="updateBMProcess">
  333. update plm_technical_specification_sheet set process=#{process},overPrintOperator=#{overPrintOperator},printOperator=#{printOperator} where site=#{site} and code_no=#{codeNo}
  334. </update>
  335. <select id="getTestPartChangeData" resultType="PlmProjectPartData">
  336. select top 1 * from view_Project_final_Part where site=#{site} and test_part_no=#{testPartNo}
  337. </select>
  338. <select id="BMBasicInformationSearch" resultType="PlmTechnicalSpecificationSheetData">
  339. SELECT top 1 a.id,a.site,a.code_no,a.project_id,a.test_part_no,a.status,a.rev_no,a.work_center_no,a.ECN_flag,a.ECN_no,
  340. a.ECN_address,a.remark,a.create_date,a.create_by,a.update_date,a.update_by,b.final_part_no,b.part_type partTypeDesc,
  341. b.part_type,b.part_name,b.part_desc,b.part_spec,dbo.plm_get_technicalBaseDesc(a.status,'status') statusDesc,
  342. dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'engineer') engineer,
  343. dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'technician') technician,
  344. dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'quotationOfficer') quotationOfficer,c.customer_Id,
  345. a.proofing_no,a.ori_code_no
  346. FROM plm_technical_specification_sheet a
  347. 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
  348. left join plm_project_info c on a.site=c.site and a.project_id=c.project_id
  349. where a.site=#{site} and a.code_no=#{codeNo}
  350. </select>
  351. <select id="getProofingDataByUserRole" resultType="PlmTechnicalSpecificationSheetData">
  352. SELECT
  353. a.site,
  354. a.proofing_no,
  355. a.project_id,
  356. a.test_part_no,
  357. dbo.plm_get_test_part_name(a.site,a.test_part_no) partName,
  358. dbo.plm_get_test_part_desc(a.site, a.test_part_no) partDesc,
  359. b.customer_id,
  360. b.final_customer_id,
  361. dbo.plm_get_customer_desc(a.site,b.customer_id) CustomerDesc,
  362. dbo.plm_get_dictDataLabel('finalCustomer',b.final_customer_id,a.site) finalCustomerDesc,
  363. b.project_name,d.bu_no
  364. from plm_proofing_information a
  365. left join plm_project_info b on a.site = b.site and a.project_id = b.project_id
  366. left join part as c on a.site = c.site and a.test_part_no = c.part_no
  367. left join plm_project_part d on a.site = d.site and a.test_part_no = d.test_part_no
  368. <where>
  369. and a.site=#{site}
  370. AND a.project_id in ( select project_id from AccessProject where site=#{site} and username=#{username} and searchFlag='Y' )
  371. <if test="proofingNo!= null and proofingNo != ''">
  372. AND a.proofing_no like #{proofingNo}
  373. </if>
  374. <if test="projectId!= null and projectId != ''">
  375. AND a.project_id like #{projectId}
  376. </if>
  377. <if test="customerId!= null and customerId != ''">
  378. AND b.customer_id like #{customerId}
  379. </if>
  380. <if test="finalCustomerId!= null and finalCustomerId != ''">
  381. AND b.final_customer_id like #{finalCustomerId}
  382. </if>
  383. and c.status = 'Y'
  384. </where>
  385. </select>
  386. <update id="updateBMBasicInformation" >
  387. update plm_technical_specification_sheet
  388. set status=#{status}
  389. , stage=#{stage}
  390. , remarkPage=#{remarkPage}
  391. , rev_no=#{revNo}
  392. , ECN_no=#{ecnNo}
  393. , ECN_flag=#{ecnFlag}
  394. , ECN_address=#{ecnAddress}
  395. , cqcOperator=#{cqcOperator}
  396. , update_date=GetDate()
  397. , update_by=#{updateBy}
  398. , faiOperator=#{faiOperator}
  399. , peOperater=#{peOperater}
  400. , csOperater=#{csOperater}
  401. , pod=#{pod}
  402. , mpOperator=#{mpOperator}
  403. , relevance_part_no=#{relevancePartNo}
  404. where site = #{site}
  405. and code_no = #{codeNo}
  406. </update>
  407. <select id="searchBMcustomerInfo" resultType="PlmTechnicalSpecificationSheetData">
  408. select a.site,
  409. a.code_no,
  410. a.picture_addess,
  411. a.customerPictureChangeRemark,
  412. a.productionFileComments,
  413. b.customer_id,
  414. dbo.plm_get_customer_desc(b.site, b.customer_id) CustomerDesc,
  415. b.final_customer_id finalCustomerNo,
  416. dbo.plm_get_dictDataLabel('finalCustomer', b.final_customer_id, a.site) finalCustomerDesc,
  417. c.final_part_no as part_no,
  418. c.part_desc,
  419. c.material_number,
  420. c.part_type as part_family,
  421. b.customer_remark,
  422. a.remark,
  423. a.ori_code_no,
  424. a.materialType,
  425. a.customerRevNo,
  426. a.materialNumber,
  427. a.certification,
  428. a.customerRemark,
  429. a.projectRemark,
  430. b.project_id,
  431. pcpi.customer_part_no
  432. from plm_technical_specification_sheet a
  433. left join plm_project_info b on a.site = b.site and a.project_id = b.project_id
  434. left join view_Project_final_Part c
  435. on a.site = c.site and a.test_part_no = c.test_part_no and a.project_id = c.project_id
  436. left join plm_customer_part_info pcpi
  437. on a.site = pcpi.site and a.test_part_no = pcpi.part_no and b.customer_id = pcpi.customer_no
  438. where a.site = #{site}
  439. and a.code_no = #{codeNo}
  440. </select>
  441. <update id="updateBMcustomerInfo">
  442. update plm_technical_specification_sheet
  443. set picture_Addess=#{pictureAddess},
  444. materialType=#{materialType},
  445. customerPictureChangeRemark=#{customerPictureChangeRemark},
  446. productionFileComments =#{productionFileComments},
  447. remark=#{remark},
  448. update_date=GetDate(),
  449. update_by=#{updateBy},
  450. certification=#{certification},
  451. customerRevNo=#{customerRevNo},
  452. materialNumber=#{materialNumber},
  453. customerRemark=#{customerRemark},
  454. projectRemark=#{projectRemark}
  455. where site = #{site}
  456. and code_no = #{codeNo}
  457. </update>
  458. <select id="searchBMPackageInfo" resultType="PlmBmPackageInfoData">
  459. select site,code_no,matrixStripped,appliedType,finalFormat,[rowCount],columnCount,missingAllowedFlag,rollPerQty,addingFilmFlag,
  460. packageRequest,coreType,coreDiameter,joinAllowedFlag,coreWidth,specialPositiorFlag,copyPosition,overprintingFlag,
  461. otherRequirement from plm_bm_packageInfo
  462. where site=#{site} and code_no=#{codeNo}
  463. </select>
  464. <update id="updateBMPackageInfo">
  465. update plm_bm_packageInfo set
  466. matrixStripped=#{matrixStripped},appliedType=#{appliedType},finalFormat=#{finalFormat},[rowCount]=#{rowCount,jdbcType=INTEGER},columnCount=#{columnCount,jdbcType=INTEGER},
  467. missingAllowedFlag=#{missingAllowedFlag},rollPerQty=#{rollPerQty,jdbcType=DECIMAL},addingFilmFlag=#{addingFilmFlag},
  468. packageRequest=#{packageRequest},coreType=#{coreType},coreDiameter=#{coreDiameter},joinAllowedFlag=#{joinAllowedFlag},coreWidth=#{coreWidth,jdbcType=DECIMAL},
  469. specialPositiorFlag=#{specialPositiorFlag},copyPosition=#{copyPosition},overprintingFlag=#{overprintingFlag},
  470. otherRequirement=#{otherRequirement},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
  471. </update>
  472. <select id="saveBMPackageInfo">
  473. insert into plm_bm_packageInfo (site,code_no,matrixStripped,appliedType,finalFormat,[rowCount],columnCount,missingAllowedFlag,rollPerQty,addingFilmFlag,
  474. packageRequest,coreType,coreDiameter,joinAllowedFlag,coreWidth,specialPositiorFlag,copyPosition,overprintingFlag,
  475. otherRequirement,update_date,update_by) values
  476. (#{site},#{codeNo},#{matrixStripped},#{appliedType},#{finalFormat},#{rowCount,jdbcType=INTEGER},#{columnCount,jdbcType=INTEGER},
  477. #{missingAllowedFlag},#{rollPerQty,jdbcType=DECIMAL},#{addingFilmFlag},#{packageRequest},#{coreType},#{coreDiameter},#{joinAllowedFlag},#{coreWidth,jdbcType=DECIMAL},
  478. #{specialPositiorFlag},#{copyPosition},#{overprintingFlag},#{otherRequirement},GetDate(),#{updateBy})
  479. </select>
  480. <select id="searchPartDataForSelect" resultType="com.spring.modules.part.vo.PartInformationVo">
  481. select top 100 a.erp_part_no ,a.part_desc,a.family_id,a.spec,family_name
  482. from part a left join part_family b on a.site=b.site and a.family_id=b.family_id
  483. <where>
  484. and a.site=#{site}
  485. <if test="erpPartNo!= null and erpPartNo != ''">
  486. AND a.erp_part_no like #{erpPartNo}
  487. </if>
  488. <if test="familyId!= null and familyId != ''">
  489. AND a.family_id like #{familyId}
  490. </if>
  491. <if test="partDesc!= null and partDesc != ''">
  492. AND a.part_desc like #{partDesc}
  493. </if>
  494. and a.erp_part_no is not null and a.erp_part_no !=''
  495. </where>
  496. </select>
  497. <insert id="saveBMBom" >
  498. insert into plm_bm_bom (Site,code_no,erp_part_no,quantity,remark,create_by,create_date)
  499. values(#{site},#{codeNo},#{erpPartNo},#{quantity},#{remark},#{username},GetDate())
  500. </insert>
  501. <update id="updateBMBom" >
  502. update plm_bm_bom set quantity=#{quantity,jdbcType=DECIMAL} ,remark=#{remark},update_by=#{username},
  503. update_date=GetDate() where Site=#{site} and code_no=#{codeNo} and erp_part_no=#{erpPartNo}
  504. </update>
  505. <select id="searchBMBom" resultType="PlmBmBomData">
  506. select a.Site,a.code_no,a.erp_part_no,a.quantity,a.remark,b.part_desc,b.spec,b.family_id,c.family_name
  507. from plm_bm_bom a
  508. left join part b on a.erp_part_no=b.erp_part_no and a.site=b.site
  509. left join part_family c on b.family_id=c.family_id and b.site=c.site
  510. <where>
  511. and a.site=#{site}
  512. <if test="erpPartNo!= null and erpPartNo != ''">
  513. AND a.erp_part_no like #{erpPartNo}
  514. </if>
  515. <if test="codeNo!= null and codeNo != ''">
  516. AND a.code_no like #{codeNo}
  517. </if>
  518. </where>
  519. </select>
  520. <delete id="deleteBMBom" >
  521. delete from plm_bm_bom where code_no=#{codeNo} and site=#{site} and erp_part_no=#{erpPartNo}
  522. </delete>
  523. <select id="searchBMRoutingDetail" resultType="PlmBmRoutingData">
  524. SELECT a.Site,a.code_no,a.processDetail,a.supplyAdhesiveTape,a.routingDrawing,a.drawingRevison,a.drawingDate,a.workInfo,
  525. a.wiRevison,a.wiDate,a.routingRemark,a.routingAction,
  526. dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'reviewEngineer') reviewEngineer,
  527. dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'peEngineer') peEngineer,
  528. dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'cqe') cqe
  529. FROM plm_bm_routing a
  530. where a.site=#{site} and a.code_no=#{codeNo}
  531. </select>
  532. <insert id="saveBMRoutingDetail">
  533. insert into plm_bm_routing (Site,code_no,processDetail,supplyAdhesiveTape,routingDrawing,drawingRevison,drawingDate,workInfo,wiRevison,wiDate,
  534. routingRemark,routingAction,update_by,update_date) values
  535. (#{site},#{codeNo},#{processDetail},#{supplyAdhesiveTape},#{routingDrawing},#{drawingRevison},#{drawingDate},#{workInfo},#{wiRevison},#{wiDate},
  536. #{routingRemark},#{routingAction},#{username},GetDate())
  537. </insert>
  538. <update id="updateBMRoutingDetail">
  539. update plm_bm_routing set processDetail=#{processDetail},supplyAdhesiveTape=#{supplyAdhesiveTape},routingDrawing=#{routingDrawing},
  540. drawingRevison=#{drawingRevison},drawingDate=#{drawingDate},workInfo=#{workInfo},wiRevison=#{wiRevison},wiDate=#{wiDate},
  541. routingRemark=#{routingRemark},routingAction=#{routingAction},update_by=#{username},update_date=GetDate() where site=#{site} and code_no=#{codeNo}
  542. </update>
  543. <select id="checkPlmBmPropertiesValueHeaderData" resultType="PlmBmPropertiesValueHeaderData">
  544. select Site,bu_no,PartNo,CodeNo,SubCodeSeqNo,SubCodeDesc,RecordType from plm_bm_propertiesValueHeader
  545. where PartNo=#{codeNo} and site=#{site} and CodeNo=#{type} and bu_no=#{buNo}
  546. </select>
  547. <insert id="savePlmBmPropertiesValueHeaderData">
  548. insert into plm_bm_propertiesValueHeader(Site,bu_no,PartNo,CodeNo,SubCodeSeqNo,SubCodeDesc,RecordType )
  549. select #{site},#{buNo},#{codeNo},#{type},1,code_desc,'BM' from plm_bm_model_header
  550. where site=#{site} and bu_no=#{buNo} and function_type='BM' and code_no=#{type}
  551. </insert>
  552. <insert id="savePlmBmPropertiesValueData">
  553. insert into plm_bm_propertiesValue(Site,bu_no,PartNo,CodeNo,SubCodeSeqNo,SubCodeDesc,ItemNo,PropertiesItemNo,TextValue,NumValue,RecordType,order_id)
  554. select #{site},#{buNo},#{codeNo},#{type},1,b.code_desc,a.seq_no,a.properties_item_no,c.DefaultValue,null,'BM',a.order_id
  555. from plm_bm_model_header b left join plm_properties_model_detail a on a.site=#{site} and a.function_type='BM'
  556. and a.code_no=b.properties_code_no
  557. left join plm_properties_item c on a.properties_item_no=c.ItemNo and a.site=c.site and a.function_type=c.ItemType
  558. where b.site=#{site} and b.bu_no=#{buNo} and b.function_type='BM' and b.code_no=#{type} and a.code_no is not null
  559. </insert>
  560. <select id="searchBMPropertiesValue" resultType="PlmBmPropertiesValueData">
  561. select a.Site,a.bu_no,a.PartNo,a.CodeNo,a.SubCodeSeqNo,a.SubCodeDesc,a.ItemNo,a.PropertiesItemNo,a.TextValue,a.NumValue,a.RecordType,a.order_id,b.itemDesc,b.ValueType_DB,b.ValueChooseFlag
  562. from plm_bm_propertiesValue a left join plm_properties_item b on a.PropertiesItemNo=b.ItemNo and a.site=b.site and a.RecordType=b.ItemType
  563. where a.site=#{site} and a.bu_no=#{buNo} and a.RecordType='BM' and a.CodeNo=#{type} and a.PartNo=#{codeNo} order by a.order_id
  564. </select>
  565. <select id="getAvailableValueList" resultType="PlmPropertiesItemAvailableData">
  566. select ItemNo,ValueNo,AvailableValue from plm_properties_item_available where itemNo=#{propertiesItemNo} and site=#{site} and ItemType='BM'
  567. </select>
  568. <update id="updateBMPropertiesValue">
  569. update plm_bm_propertiesValue set NumValue=#{numValue,jdbcType=DOUBLE} ,TextValue=#{textValue} where site=#{site} and bu_no=#{buNo} and PartNo=#{partNo} and RecordType=#{recordType}
  570. and SubCodeSeqNo=#{subCodeSeqNo} and CodeNo = #{codeNo} and ItemNo=#{itemNo}
  571. </update>
  572. <select id="getBMPageBase" resultType="PlmBmPageBaseData">
  573. select bu_no,code_no from plm_bm_model_header where bu_no=#{buNo} and site=#{site} and active='Y'
  574. </select>
  575. <select id="searchBMRoute" resultType="com.spring.modules.part.vo.RoutingComponentVo">
  576. SELECT
  577. a.site,
  578. a.part_no,
  579. a.routing_type,
  580. a.routing_revision,
  581. a.alternative_no,
  582. a.operation_id,
  583. a.operation_no,
  584. a.operation_name,
  585. a.efficiency_factor,
  586. a.mach_run_factor,
  587. a.mach_setup_time,
  588. a.run_time_code,
  589. a.labor_run_factor,
  590. a.labor_setup_time,
  591. a.crew_size,
  592. a.setup_crew_size,
  593. a.outside_op_item,
  594. a.machine_no,
  595. a.work_center_no,
  596. dbo.get_workCenter_desc(a.site, a.work_center_no) as workCenterDesc,
  597. a.labor_class_no,
  598. a.setup_labor_class_no,
  599. a.overlap,
  600. a.note_text as componentNoteText,
  601. b.itemType
  602. FROM plm_routing_component a
  603. left join WorkCenter_BMType b on a.site=b.site and a.work_center_no=b.workCenterNo
  604. where a.site = #{site} and a.part_no =#{partNo} and a.routing_type = #{routingType} and a.routing_revision = #{routingRevision,jdbcType=INTEGER} and a.alternative_no = #{alternativeNo}
  605. order by operation_no
  606. </select>
  607. <insert id="saveBMRoute">
  608. insert into plm_bm_routing_detail (site,code_no,item_no,OperationDesc,remark,create_date,create_by)
  609. values(#{site},#{codeNo},#{itemNo},#{operationDesc},#{remark},GetDate(),#{username})
  610. </insert>
  611. <update id="updateBMRoute">
  612. update plm_bm_routing_detail set item_no=#{itemNo},OperationDesc=#{operationDesc}
  613. ,remark=#{remark},update_date=GetDate(),update_by=#{username}
  614. where id=#{id}
  615. </update>
  616. <delete id="deleteBMRoute">
  617. delete from plm_bm_routing_detail where id=#{id}
  618. </delete>
  619. <select id="searchBMTPInfoDetail" resultType="PlmBmTpInfoDetailData">
  620. select site,code_no,colourMatch,environment,eordValue,customerFile,laberSize,crossNumber,hp,rowNumber,vp,remark
  621. from plm_bm_tpInfoDetail where site=#{site} and code_no=#{codeNo}
  622. </select>
  623. <insert id="saveBMTPInfoDetail">
  624. insert into plm_bm_tpInfoDetail (site,code_no,colourMatch,environment,eordValue,customerFile,laberSize,crossNumber,hp,rowNumber,vp,remark,update_date,update_by)
  625. values(#{site},#{codeNo},#{colourMatch},#{environment},#{eordValue},#{customerFile},#{laberSize},#{crossNumber},#{hp},#{rowNumber},#{vp},#{remark},GetDate(),#{updateBy})
  626. </insert>
  627. <update id="updateBMTPInfoDetail">
  628. update plm_bm_tpInfoDetail set colourMatch=#{colourMatch},environment=#{environment},eordValue=#{eordValue},customerFile=#{customerFile},
  629. laberSize=#{laberSize},crossNumber=#{crossNumber},hp=#{hp},rowNumber=#{rowNumber},vp=#{vp},
  630. remark=#{remark},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
  631. </update>
  632. <select id="searchBMTPInfoColor" resultType="PlmBmTpInfoColorData">
  633. select site,code_no,[order],color,inkType,colorRet,colorMatch,remark,filmNo,stencilNo,update_by,update_date,id
  634. from plm_bm_tpInfoColor where site=#{site} and code_no=#{codeNo} order by [order]
  635. </select>
  636. <insert id="saveBMTPInfoColor">
  637. insert into plm_bm_tpInfoColor (site,code_no,[order],color,inkType,colorRet,colorMatch,remark,filmNo,stencilNo,update_by,update_date)
  638. values(#{site},#{codeNo},#{order},#{color},#{inkType},#{colorRet},#{colorMatch},#{remark},#{filmNo},#{stencilNo},#{updateBy},GetDate())
  639. </insert>
  640. <update id="updateBMTPInfoColor">
  641. update plm_bm_tpInfoColor set [order]=#{order},color=#{color},inkType=#{inkType},colorRet=#{colorRet},
  642. colorMatch=#{colorMatch},remark=#{remark},filmNo=#{filmNo},stencilNo=#{stencilNo},
  643. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  644. </update>
  645. <delete id="deleteBMTPInfoColor">
  646. delete from plm_bm_tpInfoColor where id=#{id}
  647. </delete>
  648. <select id="checkPlmBmTpInfoColorOrder" resultType="PlmBmTpInfoColorData">
  649. select site from plm_bm_tpInfoColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  650. </select>
  651. <select id="searchBMTPInfoCut" resultType="PlmBmTpInfoCutData">
  652. select site,code_no,[order],cuttingMachine,cuttingType,cutterTooling,cutterLayout,cutterCost,p2c,c2c,cutterNo,update_date,
  653. update_by,id
  654. from plm_bm_tpInfoCut where site=#{site} and code_no=#{codeNo} order by [order]
  655. </select>
  656. <insert id="saveBMTPInfoCut">
  657. insert into plm_bm_tpInfoCut (site,code_no,[order],cuttingMachine,cuttingType,cutterTooling,cutterLayout,cutterCost,p2c,c2c,cutterNo,update_date,
  658. update_by)
  659. values(#{site},#{codeNo},#{order},#{cuttingMachine},#{cuttingType},#{cutterTooling},#{cutterLayout},#{cutterCost},#{p2c},#{c2c},#{cutterNo},GetDate(),#{updateBy})
  660. </insert>
  661. <update id="updateBMTPInfoCut">
  662. update plm_bm_tpInfoCut set [order]=#{order},cuttingMachine=#{cuttingMachine},cuttingType=#{cuttingType},cutterTooling=#{cutterTooling},
  663. cutterLayout=#{cutterLayout},cutterCost=#{cutterCost},p2c=#{p2c},c2c=#{c2c},cutterNo=#{cutterNo},
  664. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  665. </update>
  666. <select id="checkPlmBmTpInfoCutOrder" resultType="PlmBmTpInfoCutData">
  667. select site from plm_bm_tpInfoCut where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  668. </select>
  669. <delete id="deleteBMTPInfoCut">
  670. delete from plm_bm_tpInfoCut where id=#{id}
  671. </delete>
  672. <select id="searchBMPrepressDetail" resultType="PlmBmPrepressData">
  673. select Site,code_no,plateNo,cutterNumber,cutterLayout,[action],remark,feedback,update_by,update_date
  674. from plm_bm_prepress where site=#{site} and code_no=#{codeNo}
  675. </select>
  676. <insert id="saveBMPrepressDetail">
  677. insert into plm_bm_prepress (Site,code_no,plateNo,cutterNumber,cutterLayout,[action],remark,feedback,update_by,update_date)
  678. values(#{site},#{codeNo},#{plateNo},#{cutterNumber},#{cutterLayout},#{action},#{remark},#{feedback},#{updateBy},GetDate())
  679. </insert>
  680. <update id="updateBMPrepressDetail">
  681. update plm_bm_prepress
  682. set plateNo=#{plateNo},
  683. cutterNumber=#{cutterNumber},
  684. cutterLayout=#{cutterLayout},
  685. [action]=#{action},
  686. remark=#{remark},
  687. feedback=#{feedback},
  688. update_by=#{updateBy},
  689. update_date=GetDate()
  690. where site = #{site}
  691. and code_no = #{codeNo}
  692. </update>
  693. <select id="searchBMPrepressColor" resultType="PlmBmPrepressColorData">
  694. select site,code_no,[order],meshModel,meshSize,angle,coatingType,filmNo,stencilNo,color,update_by,update_date
  695. from plm_bm_PrepressColor where site=#{site} and code_no=#{codeNo} order by [order]
  696. </select>
  697. <insert id="saveBMPrepressColor">
  698. insert into plm_bm_PrepressColor (site,code_no,[order],meshModel,meshSize,angle,coatingType,filmNo,stencilNo,color,update_by,update_date)
  699. values(#{site},#{codeNo},#{order},#{meshModel},#{meshSize},#{angle},#{coatingType},#{filmNo},#{stencilNo},#{color},#{updateBy},GetDate())
  700. </insert>
  701. <update id="updateBMPrepressColor">
  702. update plm_bm_PrepressColor set [order]=#{order},color=#{color},meshModel=#{meshModel},meshSize=#{meshSize},
  703. angle=#{angle},coatingType=#{coatingType},filmNo=#{filmNo},stencilNo=#{stencilNo},
  704. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  705. </update>
  706. <delete id="deleteBMPrepressColor">
  707. delete from plm_bm_PrepressColor where id=#{id}
  708. </delete>
  709. <select id="checkPlmBmPrepressColorOrder" resultType="PlmBmPrepressColorData">
  710. select site from plm_bm_PrepressColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  711. </select>
  712. <select id="searchBMPrintOtherDetail" resultType="PlmBmPrintOtherData">
  713. select site,code_no,remark,[action],update_date,update_by,id
  714. from plm_bm_PrintOther where site=#{site} and code_no=#{codeNo}
  715. </select>
  716. <insert id="saveBMPrintOtherDetail">
  717. insert into plm_bm_PrintOther (site,code_no,remark,[action],update_date,update_by)
  718. values(#{site},#{codeNo},#{remark},#{action},GetDate(),#{updateBy})
  719. </insert>
  720. <update id="updateBMPrintOtherDetail">
  721. update plm_bm_PrintOther set remark=#{remark},[action]=#{action} where site=#{site} and code_no=#{codeNo}
  722. </update>
  723. <select id="searchBMPrintOtherColor" resultType="PlmBmPrintOtherColorData">
  724. select site,code_no,[order],seqNo,ink,[type],otherRef,update_date,update_by
  725. from plm_bm_PrintOtherColor where site=#{site} and code_no=#{codeNo} order by [order] ,seqNo
  726. </select>
  727. <insert id="saveBMPrintOtherColor">
  728. insert into plm_bm_PrintOtherColor (site,code_no,[order],seqNo,ink,[type],otherRef,update_by,update_date)
  729. values(#{site},#{codeNo},#{order},#{seqNo},#{ink},#{type},#{otherRef},#{updateBy},GetDate())
  730. </insert>
  731. <update id="updateBMPrintOtherColor">
  732. update plm_bm_PrintOtherColor set [order]=#{order},seqNo=#{seqNo},ink=#{ink},[type]=#{type},
  733. otherRef=#{otherRef},
  734. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  735. </update>
  736. <delete id="deleteBMPrintOtherColor">
  737. delete from plm_bm_PrintOtherColor where id=#{id}
  738. </delete>
  739. <select id="checkPlmBmPrintOtherColorOrder" resultType="PlmBmPrintOtherColorData">
  740. select site from plm_bm_PrintOtherColor where site=#{site} and code_no=#{codeNo} and [order]=#{order} and seqNo=#{seqNo}
  741. </select>
  742. <update id="updateBMModal">
  743. update plm_bm_model_header set properties_code_no=#{propertiesCodeNo} ,active=#{active} where site=#{site}
  744. and bu_no=#{buNo} and code_no=#{codeNo}
  745. </update>
  746. <select id="checkBMModelHeader" resultType="PlmBmModelHeaderData">
  747. select properties_code_no from plm_bm_model_header where site=#{site}
  748. and bu_no=#{buNo} and code_no=#{type}
  749. </select>
  750. <select id="searchBMPropertiesHeaderForBM" resultType="PlmBmModelHeaderData">
  751. select properties_code_no from plm_bm_model_header where site=#{site}
  752. and bu_no=#{buNo} and code_no=#{type}
  753. </select>
  754. <!-- Ink Mixing 油墨房-->
  755. <select id="searchBMInkMixingDetail" resultType="PlmBmInkMixingData">
  756. select site,code_no,colourMatch,visuallySetting,indicate,customerFile,remarks,[action],update_date,update_by
  757. from plm_bm_InkMixing where site=#{site} and code_no=#{codeNo}
  758. </select>
  759. <insert id="saveBMInkMixingDetail">
  760. insert into plm_bm_InkMixing (site,code_no,colourMatch,visuallySetting,indicate,customerFile,remarks,[action],update_date,update_by)
  761. values(#{site},#{codeNo},#{colourMatch},#{visuallySetting},#{indicate},#{customerFile},#{remarks},#{action},GetDate(),#{updateBy})
  762. </insert>
  763. <update id="updateBMInkMixingDetail">
  764. update plm_bm_InkMixing set colourMatch=#{colourMatch},visuallySetting=#{visuallySetting},indicate=#{indicate}
  765. ,customerFile=#{customerFile},[action]=#{action},remarks=#{remarks},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
  766. </update>
  767. <select id="searchBMInkMixingColor" resultType="PlmBmInkMixingColorData">
  768. select site,code_no,[order],color,[type],supplier,inkUsage,mixTime,standbyTime,Viscosity,RecycleTimes,update_by,update_date,id
  769. from plm_bm_InkMixingColor where site=#{site} and code_no=#{codeNo} order by [order]
  770. </select>
  771. <insert id="saveBMInkMixingColor">
  772. insert into plm_bm_InkMixingColor (site,code_no,[order],color,[type],supplier,inkUsage,mixTime,standbyTime,Viscosity,RecycleTimes,update_by,update_date)
  773. values(#{site},#{codeNo},#{order},#{color},#{type},#{supplier},#{inkUsage},#{mixTime},#{standbyTime},#{viscosity},#{recycleTimes},#{updateBy},GetDate())
  774. </insert>
  775. <update id="updateBMInkMixingColor">
  776. update plm_bm_InkMixingColor set [order]=#{order},color=#{color},[type]=#{type},supplier=#{supplier},inkUsage=#{inkUsage},
  777. mixTime=#{mixTime},standbyTime=#{standbyTime},Viscosity=#{viscosity},RecycleTimes=#{recycleTimes},
  778. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  779. </update>
  780. <delete id="deleteBMInkMixingColor">
  781. delete from plm_bm_InkMixingColor where id=#{id}
  782. </delete>
  783. <select id="checkPlmBmInkMixingColorOrder" resultType="PlmBmInkMixingColorData">
  784. select site from plm_bm_InkMixingColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  785. </select>
  786. <!-- Ink Formulation 油墨配方-->
  787. <select id="searchBMInkFormulationDetail" resultType="PlmBmInkFormulationData">
  788. select Site,code_no,remarks,label_size,qpa,[action],[cross],row,hp,vp,update_date,update_by
  789. from plm_bm_InkFormulation where site=#{site} and code_no=#{codeNo}
  790. </select>
  791. <insert id="saveBMInkFormulationDetail">
  792. insert into plm_bm_InkFormulation (Site,code_no,remarks,label_size,qpa,[action],[cross],row,hp,vp,update_date,update_by)
  793. values(#{site},#{codeNo},#{remarks},#{labelSize},#{qpa},#{action},#{cross},#{row},#{hp},#{vp},GetDate(),#{updateBy})
  794. </insert>
  795. <update id="updateBMInkFormulationDetail">
  796. update plm_bm_InkFormulation set remarks=#{remarks},label_size=#{labelSize},qpa=#{qpa},[action]=#{action},[cross]=#{cross}
  797. ,row=#{row},[hp]=#{hp},vp=#{vp},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
  798. </update>
  799. <select id="searchBMInkFormulationColor" resultType="PlmBmInkFormulationColorData">
  800. select site,code_no,[order],hardness,tartness,printingSide,energy,dry_speed,dry_time,dry_temp,dry_time2,update_date,update_by,
  801. id
  802. from plm_bm_InkFormulationColor where site=#{site} and code_no=#{codeNo} order by [order]
  803. </select>
  804. <insert id="saveBMInkFormulationColor">
  805. insert into plm_bm_InkFormulationColor (site,code_no,[order],hardness,tartness,printingSide,energy,dry_speed,dry_time,dry_temp,dry_time2,update_date,update_by)
  806. values(#{site},#{codeNo},#{order},#{hardness},#{tartness},#{printingSide},#{energy},#{drySpeed},#{dryTime},#{dryTemp},#{dryTime2},GetDate(),#{updateBy})
  807. </insert>
  808. <update id="updateBMInkFormulationColor">
  809. update plm_bm_InkFormulationColor set [order]=#{order},hardness=#{hardness},[tartness]=#{tartness},printingSide=#{printingSide},energy=#{energy},
  810. dry_speed=#{drySpeed},dry_time=#{dryTime},dry_temp=#{dryTemp},dry_time2=#{dryTime2},
  811. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  812. </update>
  813. <delete id="deleteBMInkFormulationColor">
  814. delete from plm_bm_InkFormulationColor where id=#{id}
  815. </delete>
  816. <select id="checkPlmBmInkFormulationColorOrder" resultType="PlmBmInkFormulationColorData">
  817. select site from plm_bm_InkFormulationColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  818. </select>
  819. <!-- Lamination 覆膜 -->
  820. <select id="searchBMLaminationDetail" resultType="PlmBmLaminationData">
  821. select site,code_no,[action],update_date,update_by,remark
  822. from plm_bm_Lamination where site=#{site} and code_no=#{codeNo}
  823. </select>
  824. <insert id="saveBMLaminationDetail">
  825. insert into plm_bm_Lamination (site,code_no,[action],update_date,update_by,remark)
  826. values(#{site},#{codeNo},#{action},GetDate(),#{updateBy},#{remark})
  827. </insert>
  828. <update id="updateBMLaminationDetail">
  829. update plm_bm_Lamination set remark=#{remark},[action]=#{action},
  830. update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
  831. </update>
  832. <select id="searchBMLaminationCut" resultType="PlmBmLaminationCutData">
  833. select site,code_no,[order],station,processStep,machine,laminationType,rm_partNo,rm_partNo2,film_partNo,lamination_side,remarks,
  834. update_date,update_by,id
  835. from plm_bm_LaminationCut where site=#{site} and code_no=#{codeNo} order by [order]
  836. </select>
  837. <insert id="saveBMLaminationCut">
  838. insert into plm_bm_LaminationCut (site,code_no,[order],station,processStep,machine,laminationType,rm_partNo,rm_partNo2,film_partNo,lamination_side,remarks,
  839. update_date,update_by)
  840. values(#{site},#{codeNo},#{order},#{station},#{processStep},#{machine},#{laminationType},#{rmPartNo},#{rmPartNo2},#{filmPartNo},#{laminationSide},#{remarks},
  841. GetDate(),#{updateBy})
  842. </insert>
  843. <update id="updateBMLaminationCut">
  844. update plm_bm_LaminationCut set [order]=#{order},station=#{station},[processStep]=#{processStep},machine=#{machine},laminationType=#{laminationType},
  845. rm_partNo=#{rmPartNo},rm_partNo2=#{rmPartNo2},film_partNo=#{filmPartNo},lamination_side=#{laminationSide},remarks=#{remarks},
  846. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  847. </update>
  848. <delete id="deleteBMLaminationCut">
  849. delete from plm_bm_LaminationCut where id=#{id}
  850. </delete>
  851. <select id="checkPlmBmLaminationCutOrder" resultType="PlmBmLaminationCutData">
  852. select site from plm_bm_LaminationCut where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  853. </select>
  854. <!-- Cnc -->
  855. <select id="searchBMCncDetail" resultType="PlmBmCncData">
  856. select site,code_no,[action],update_date,update_by
  857. from plm_bm_Cnc where site=#{site} and code_no=#{codeNo}
  858. </select>
  859. <insert id="saveBMCncDetail">
  860. insert into plm_bm_Cnc (site,code_no,[action],update_date,update_by)
  861. values(#{site},#{codeNo},#{action},GetDate(),#{updateBy})
  862. </insert>
  863. <update id="updateBMCncDetail">
  864. update plm_bm_Cnc set [action]=#{action},
  865. update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
  866. </update>
  867. <select id="searchBMCncCut" resultType="PlmBmCncCutData">
  868. select site,code_no,[order],cutting_machine,program_name,cutting_speed,spec,p2c,c2c,remarks,update_date,update_by,id
  869. from plm_bm_CncCut where site=#{site} and code_no=#{codeNo} order by [order]
  870. </select>
  871. <insert id="saveBMCncCut">
  872. insert into plm_bm_CncCut (site,code_no,[order],cutting_machine,program_name,cutting_speed,spec,p2c,c2c,remarks,update_date,update_by)
  873. values(#{site},#{codeNo},#{order},#{cuttingMachine},#{programName},#{cuttingSpeed},#{spec},#{p2c},#{c2c},#{remarks},
  874. GetDate(),#{updateBy})
  875. </insert>
  876. <update id="updateBMCncCut">
  877. update plm_bm_CncCut set [order]=#{order},cutting_machine=#{cuttingMachine},[program_name]=#{programName},cutting_speed=#{cuttingSpeed},spec=#{spec},
  878. p2c=#{p2c},c2c=#{c2c},remarks=#{remarks},
  879. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  880. </update>
  881. <delete id="deleteBMCncCut">
  882. delete from plm_bm_CncCut where id=#{id}
  883. </delete>
  884. <select id="checkPlmBmCncCutOrder" resultType="PlmBmCncCutData">
  885. select site from plm_bm_CncCut where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  886. </select>
  887. <!-- Cut -->
  888. <select id="searchBMCutDetail" resultType="PlmBmCutData">
  889. select site,code_no,[action],remarks,update_date,update_by
  890. from plm_bm_Cut where site=#{site} and code_no=#{codeNo}
  891. </select>
  892. <insert id="saveBMCutDetail">
  893. insert into plm_bm_Cut (site,code_no,[action],update_date,update_by,remarks)
  894. values(#{site},#{codeNo},#{action},GetDate(),#{updateBy},#{remarks})
  895. </insert>
  896. <update id="updateBMCutDetail">
  897. update plm_bm_Cut set [action]=#{action},remarks=#{remarks},
  898. update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
  899. </update>
  900. <select id="searchBMCutCut" resultType="PlmBmCutCutData">
  901. select site,code_no,[order],cutting_machine,cutting_type,cutting_tooling,cutter_no,cutter_layout,cutter_cost,program_name,
  902. program_path,p2c,c2c,update_by,update_date,id
  903. from plm_bm_CutCut where site=#{site} and code_no=#{codeNo} order by [order]
  904. </select>
  905. <insert id="saveBMCutCut">
  906. insert into plm_bm_CutCut (site,code_no,[order],cutting_machine,cutting_type,cutting_tooling,cutter_no,cutter_layout,cutter_cost,program_name,
  907. program_path,p2c,c2c,update_by,update_date)
  908. values(#{site},#{codeNo},#{order},#{cuttingMachine},#{cuttingType},#{cuttingTooling},#{cutterNo},#{cutterLayout},#{cutterCost},#{programName},
  909. #{programPath},#{p2c},#{c2c},#{updateBy},GetDate())
  910. </insert>
  911. <update id="updateBMCutCut">
  912. update plm_bm_CutCut set [order]=#{order},cutting_machine=#{cuttingMachine},[cutting_type]=#{cuttingType},cutting_tooling=#{cuttingTooling},cutter_no=#{cutterNo},
  913. cutter_layout=#{cutterLayout},cutter_cost=#{cutterCost},program_name=#{programName}, p2c=#{p2c},c2c=#{c2c},program_path=#{programPath},
  914. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  915. </update>
  916. <delete id="deleteBMCutCut">
  917. delete from plm_bm_CutCut where id=#{id}
  918. </delete>
  919. <select id="checkPlmBmCutCutOrder" resultType="PlmBmCutCutData">
  920. select site from plm_bm_CutCut where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  921. </select>
  922. <!-- printing 印刷-->
  923. <select id="searchBMPrintingDetail" resultType="PlmBmPrintingData">
  924. select site,code_no,colour_match,conditions,colour_indicat,customer_file,glossiness_requirement,comments,repeat,vp,label_size,
  925. down,plate_distortion_rate,actual_number,print_position,goods_roll_width,update_date,update_by,printLayout
  926. from plm_bm_Printing where site=#{site} and code_no=#{codeNo}
  927. </select>
  928. <insert id="saveBMPrintingDetail">
  929. insert into plm_bm_Printing (site,code_no,colour_match,conditions,colour_indicat,customer_file,glossiness_requirement,comments,repeat,vp,label_size,
  930. down,plate_distortion_rate,actual_number,print_position,goods_roll_width,update_date,update_by,printLayout)
  931. values(#{site},#{codeNo},#{colourMatch},#{conditions},#{colourIndicat},#{customerFile},#{glossinessRequirement},#{comments},
  932. #{repeat},#{vp},#{labelSize},#{down},#{plateDistortionRate},#{actualNumber},#{printPosition},#{goodsRollWidth},
  933. GetDate(),#{updateBy},#{printLayout})
  934. </insert>
  935. <update id="updateBMPrintingDetail">
  936. update plm_bm_Printing set printLayout=#{printLayout},colour_match=#{colourMatch},conditions=#{conditions},colour_indicat=#{colourIndicat},customer_file=#{customerFile},glossiness_requirement=#{glossinessRequirement},comments=#{comments},
  937. repeat=#{repeat},vp=#{vp},label_size=#{labelSize},down=#{down},plate_distortion_rate=#{plateDistortionRate},actual_number=#{actualNumber},print_position=#{printPosition},goods_roll_width=#{goodsRollWidth},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo}
  938. </update>
  939. <select id="searchBMPrintingColor" resultType="PlmBmPrintingColorData">
  940. select site,code_no,[order],ink_type,color_reference,color_match,bcm,speed,dry,gallus,mark_andy,lp,Hexiang,update_date,update_by,
  941. id
  942. from plm_bm_PrintingColor where site=#{site} and code_no=#{codeNo} order by [order]
  943. </select>
  944. <insert id="saveBMPrintingColor">
  945. insert into plm_bm_PrintingColor (site,code_no,[order],ink_type,color_reference,color_match,bcm,speed,dry,gallus,mark_andy,lp,Hexiang,update_by,update_date)
  946. values(#{site},#{codeNo},#{order},#{inkType},#{colorReference},#{colorMatch},#{bcm},#{speed},#{dry},#{gallus},#{markAndy},#{lp},#{hexiang},#{updateBy},GetDate())
  947. </insert>
  948. <update id="updateBMPrintingColor">
  949. update plm_bm_PrintingColor set [order]=#{order},ink_type=#{inkType},[color_reference]=#{colorReference},color_match=#{colorMatch},bcm=#{bcm},
  950. speed=#{speed},dry=#{dry},gallus=#{gallus},mark_andy=#{markAndy},lp=#{lp},Hexiang=#{hexiang},
  951. update_date=GetDate(),update_by=#{updateBy} where id=#{id}
  952. </update>
  953. <delete id="deleteBMPrintingColor">
  954. delete from plm_bm_PrintingColor where id=#{id}
  955. </delete>
  956. <select id="checkPlmBmPrintingColorOrder" resultType="PlmBmPrintingColorData">
  957. select site from plm_bm_PrintingColor where site=#{site} and code_no=#{codeNo} and [order]=#{order}
  958. </select>
  959. <select id="getBomNowRevNo" resultType="com.spring.modules.part.entity.BomHeaderEntity">
  960. select top 1 eng_chg_level,bom_type,site,part_no
  961. from plm_bom_header
  962. where site=#{site} and part_no=#{partNo}
  963. and GetDate()>eff_phase_in_date and isnull(eff_phase_out_date, DATEADD(d, 1, GETDATE())) >GetDate()
  964. </select>
  965. <select id="getTopOneBomAlternativeNo" resultType="com.spring.modules.part.entity.BomDetailEntity">
  966. select top 1 site,part_no,alternative_no,alternative_description,bom_type,eng_chg_level
  967. from plm_bom_detail where site=#{site} and part_no=#{partNo} and bom_type=#{bomType} and eng_chg_level=#{engChgLevel}
  968. </select>
  969. <select id="getRouteNowRevNo" resultType="com.spring.modules.part.entity.RoutingHeaderEntity">
  970. select top 1 site,part_no,routing_revision,routing_type
  971. from plm_routing_header
  972. where site=#{site} and part_no=#{partNo} and GetDate()>phase_in_date and isnull(phase_out_date, DATEADD(d, 1, GETDATE())) >GetDate()
  973. </select>
  974. <select id="getTopOneRouteAlternativeNo" resultType="com.spring.modules.part.entity.RoutingDetailEntity">
  975. select top 1 site,part_no,routing_revision,routing_type,alternative_no,alternative_description
  976. from plm_routing_detail
  977. where site=#{site} and part_no=#{partNo} and routing_type=#{routingType} and routing_revision=#{routingRevision}
  978. </select>
  979. <select id="getBMBomDetail" resultType="com.spring.modules.part.entity.BomDetailEntity">
  980. select a.site, a.bom_type, a.eng_chg_level, a.bom_alternative_no alternativeNo, b.final_part_no partNo
  981. from plm_technical_specification_sheet a
  982. left join view_Project_final_Part b on a.site = b.site and a.test_part_no = b.test_part_no
  983. left join plm_bom_detail c
  984. on a.site = c.site and b.final_part_no = c.part_no and a.eng_chg_level = c.eng_chg_level
  985. and a.bom_alternative_no = c.alternative_no and a.bom_type = c.bom_type
  986. where a.site = #{site}
  987. and a.code_no = #{codeNo}
  988. and a.project_id = b.project_id
  989. and c.status = 'Buildable'
  990. </select>
  991. <select id="getBMRouteDetail" resultType="com.spring.modules.part.entity.RoutingDetailEntity">
  992. select a.site, a.routing_type, a.routing_revision, a.routing_alternative_no alternativeNo, b.final_part_no partNo
  993. from plm_technical_specification_sheet a
  994. left join view_Project_final_Part b on a.site = b.site and a.test_part_no = b.test_part_no
  995. left join plm_routing_detail c
  996. on a.site = c.site and b.final_part_no = c.part_no AND a.routing_revision = c.routing_revision
  997. and a.routing_alternative_no = c.alternative_no and a.routing_type = c.routing_type
  998. where a.site = #{site}
  999. and a.code_no = #{codeNo}
  1000. and a.project_id = b.project_id
  1001. and c.status = 'Buildable'
  1002. </select>
  1003. <select id="searchBMBomDetail" resultType="com.spring.modules.part.vo.BomDetailVo">
  1004. select a.site,
  1005. a.part_no,
  1006. b.alternative_no,
  1007. b.alternative_description,
  1008. a.bom_type,
  1009. a.eng_chg_level,
  1010. b.min_lot_qty,
  1011. b.default_flag,
  1012. a.note_text,
  1013. a.create_date,
  1014. a.create_by,
  1015. a.update_date,
  1016. a.update_by,
  1017. b.status,
  1018. a.official_flag,
  1019. a.eff_phase_in_date,
  1020. a.eff_phase_out_date
  1021. from plm_bom_header a
  1022. left join plm_bom_detail b
  1023. on a.site = b.site and a.part_no = b.part_NO and a.bom_type = b.bom_type AND A.eng_chg_level = B.eng_chg_level
  1024. where a.part_no = #{partNo}
  1025. and a.site = #{site}
  1026. and a.bom_type != 'Repair'
  1027. and b.status = 'Buildable'
  1028. </select>
  1029. <update id="updateBMBomRev">
  1030. update plm_technical_specification_sheet set bom_type=#{bomType},eng_chg_level=#{engChgLevel,jdbcType=INTEGER},
  1031. bom_alternative_no=#{bomAlternativeNo} where site=#{site} and code_no=#{codeNo}
  1032. </update>
  1033. <update id="updateBMRouteRev">
  1034. update plm_technical_specification_sheet set routing_type=#{routingType},routing_revision=#{routingRevision,jdbcType=INTEGER},
  1035. routing_alternative_no=#{routingAlternativeNo} where site=#{site} and code_no=#{codeNo}
  1036. </update>
  1037. <select id="searchRouteDetail" resultType="com.spring.modules.part.vo.RoutingDetailVo">
  1038. select a.site,
  1039. a.part_no,
  1040. a.routing_revision,
  1041. a.routing_type,
  1042. b.alternative_no,
  1043. b.alternative_description,
  1044. b.status,
  1045. a.official_flag,
  1046. a.phase_in_date,
  1047. a.phase_out_date
  1048. from plm_routing_header a
  1049. left join plm_routing_detail b
  1050. on a.site = b.site and a.part_no = b.part_NO and a.routing_type = b.routing_type AND A.routing_revision = B.routing_revision
  1051. where a.site = #{site}
  1052. and a.part_no = #{partNo}
  1053. and a.routing_type != 'Repair'
  1054. and b.status = 'Buildable'
  1055. </select>
  1056. <select id="searchBMRemarkPage" resultType="PlmTechnicalSpecificationSheetData">
  1057. select site,remarkPage,code_no from plm_technical_specification_sheet where site=#{site} and code_no=#{codeNo}
  1058. </select>
  1059. <update id="updateBMRemarkPage">
  1060. update plm_technical_specification_sheet set remarkPage=#{remarkPage} where site=#{site} and code_no=#{codeNo}
  1061. </update>
  1062. <select id="searchPartLastQuotationNo" resultType="com.spring.modules.quotation.entity.QuotationHeader">
  1063. select top 1 a.site,a.quotation_no
  1064. from quotation_header a left join quotation_detail b on a.quotation_header_id=b.quotation_header_id
  1065. where b.site=#{site} and b.product_no=#{productNo} order by a.create_time desc
  1066. </select>
  1067. <select id="getSysProxyAddress" resultType="SysProxyAddress">
  1068. select physicalAddress,proxyAddress,remark from sys_proxy_address
  1069. </select>
  1070. <select id="searchBMprintFlexoColor" resultType="PlmBmPrintFlexoColorData">
  1071. select id,site,codeNo,printSide,[order],colorReference,inkCode,colorMatch,lpi,bcm,openFlag,gallus,markAndy,hexiang,temperature,
  1072. pressure,updateDate,updateBy from plm_bm_printFlexoColor
  1073. where site=#{site} and codeNo=#{codeNo}
  1074. order by printSide desc,[order]
  1075. </select>
  1076. <select id="checkBMprintFlexoColorOrder" resultType="PlmBmPrintFlexoColorData">
  1077. select id,site,codeNo,printSide,[order] from plm_bm_printFlexoColor
  1078. where site=#{site} and codeNo=#{codeNo} and printSide=#{printSide} and [order]=#{order}
  1079. </select>
  1080. <insert id="saveBMprintFlexoColor" >
  1081. insert into plm_bm_printFlexoColor(site,codeNo,printSide,[order],colorReference,inkCode,colorMatch,lpi,bcm,openFlag,gallus,markAndy,hexiang,temperature,
  1082. pressure,updateDate,updateBy,remark) values
  1083. (#{site},#{codeNo},#{printSide},#{order},#{colorReference},#{inkCode},#{colorMatch},#{lpi},#{bcm},#{openFlag},#{gallus},
  1084. #{markAndy},#{hexiang},#{temperature},#{pressure},GetDate(),#{updateBy},#{remark})
  1085. </insert>
  1086. <update id="updateBMprintFlexoColor" >
  1087. update plm_bm_printFlexoColor set printSide=#{printSide},[order]=#{order,jdbcType=INTEGER},colorReference=#{colorReference},inkCode=#{inkCode},
  1088. colorMatch=#{colorMatch},lpi=#{lpi},bcm=#{bcm},openFlag=#{openFlag},gallus=#{gallus},markAndy=#{markAndy},hexiang=#{hexiang},temperature=#{temperature},
  1089. pressure=#{pressure},updateDate=GetDate(),updateBy=#{updateBy},remark=#{remark} where id=#{id}
  1090. </update>
  1091. <delete id="deleteBMprintFlexoColor">
  1092. delete from plm_bm_printFlexoColor where id=#{id}
  1093. </delete>
  1094. <select id="searchBMprintIndigoColor" resultType="PlmBmPrintIndigoColorData">
  1095. select id,code_no,site,[order],printSide,colorReference,inkCode,colorMatch,printMotion,opticalDensity,lut,lpi,screenAngle,printHits,
  1096. blanketTemperture,remark,updateBy,updateDate from plm_bm_printIndigoColor
  1097. where site=#{site} and code_no=#{codeNo}
  1098. order by printSide desc,[order]
  1099. </select>
  1100. <select id="checkBMprintIndigoColorOrder" resultType="PlmBmPrintIndigoColorData">
  1101. select id,site,code_no,printSide,[order] from plm_bm_printIndigoColor
  1102. where site=#{site} and code_no=#{codeNo} and printSide=#{printSide} and [order]=#{order}
  1103. </select>
  1104. <insert id="saveBMprintIndigoColor" >
  1105. insert into plm_bm_printIndigoColor(site,code_no,[order],printSide,colorReference,inkCode,colorMatch,printMotion,opticalDensity,lut,lpi,screenAngle,printHits,
  1106. blanketTemperture,remark,updateBy,updateDate) values
  1107. (#{site},#{codeNo},#{order},#{printSide},#{colorReference},#{inkCode},#{colorMatch},#{printMotion},#{opticalDensity},#{lut},#{lpi},
  1108. #{screenAngle},#{printHits},#{blanketTemperture},#{remark},#{updateBy},GetDate())
  1109. </insert>
  1110. <update id="updateBMprintIndigoColor" >
  1111. update plm_bm_printIndigoColor set printSide=#{printSide},[order]=#{order,jdbcType=INTEGER},colorReference=#{colorReference},inkCode=#{inkCode},
  1112. colorMatch=#{colorMatch},printMotion=#{printMotion},opticalDensity=#{opticalDensity},lut=#{lut},lpi=#{lpi},screenAngle=#{screenAngle},printHits=#{printHits},blanketTemperture=#{blanketTemperture},
  1113. remark=#{remark},updateDate=GetDate(),updateBy=#{updateBy} where id=#{id}
  1114. </update>
  1115. <delete id="deleteBMprintIndigoColor">
  1116. delete from plm_bm_printIndigoColor where id=#{id}
  1117. </delete>
  1118. <select id="selectTechnicalSpecification" resultType="PlmTechnicalSpecificationSheet">
  1119. SELECT
  1120. id,site,code_no,proofing_no,project_id,test_part_no,status,rev_no,work_center_no,ECN_flag,ECN_no,ECN_address,remark,
  1121. create_date,create_by,update_date,update_by,picture_addess,customerPictureChangeRemark,productionFileComments,
  1122. ori_code_no,bom_type,eng_chg_level,bom_alternative_no,routing_type,routing_revision,routing_alternative_no,remarkPage,
  1123. process,stage,materialType,cqcOperator,faiOperator,overPrintOperator,printOperator,peOperater,csOperater,
  1124. step_id,reject_flag,reject_step_id,mpOperator,pod
  1125. FROM plm_technical_specification_sheet a
  1126. where a.site = #{site} and a.code_no = #{codeNo}
  1127. </select>
  1128. <update id="updateStatus" parameterType="PlmTechnicalSpecificationSheetData">
  1129. update plm_technical_specification_sheet
  1130. set status = #{status},
  1131. update_date = getDate(),
  1132. update_by = #{userName}
  1133. where site = #{site} and code_no = #{codeNo}
  1134. </update>
  1135. <select id="selectTechnicalSpecificationTeam" parameterType="string" resultType="PlmTechnicalSpecificationTeamData">
  1136. SELECT
  1137. a.site,
  1138. a.code_no,
  1139. a.operator_id,
  1140. a.type,
  1141. b.domain_control_account
  1142. FROM plm_technicalSpecification_team as a
  1143. left join sys_user as b on a.operator_id = b.username
  1144. where a.site = #{site} and a.code_no = #{codeNo}
  1145. </select>
  1146. <select id="getBMStatusDesc" resultType="PlmTechnicalSpecificationSheetData">
  1147. SELECT
  1148. id,site,code_no,dbo.plm_get_technicalBaseDesc(a.status,'status') statusDesc
  1149. FROM plm_technical_specification_sheet a
  1150. where a.site = #{site} and a.code_no = #{codeNo}
  1151. </select>
  1152. <select id="getFinalPartData" resultType="PlmProjectPartData">
  1153. Select
  1154. a.Final_Part_No,
  1155. a.Test_part_no,
  1156. a.Active,
  1157. a.Part_desc,
  1158. a.project_id,
  1159. pcpi.customer_part_no,
  1160. a.bu_no
  1161. from view_Project_final_Part a
  1162. left join plm_project_info c on a.site = c.site and a.project_id = c.project_id
  1163. 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
  1164. <where>
  1165. and a.site = #{query.site}
  1166. <if test="query.projectId!= null and query.projectId != ''">
  1167. AND a.project_id like #{query.projectId}
  1168. </if>
  1169. <if test="query.finalPartNo != null and query.finalPartNo != ''">
  1170. AND a.Final_Part_No like #{query.finalPartNo}
  1171. </if>
  1172. <if test="query.customerPartNo!= null and query.customerPartNo != ''">
  1173. AND pcpi.customer_part_no like #{query.customerPartNo}
  1174. </if>
  1175. <if test="query.testPartNo != null and query.testPartNo != ''">
  1176. AND a.Test_part_no like #{query.testPartNo}
  1177. </if>
  1178. <if test="query.partDesc!= null and query.partDesc != ''">
  1179. AND a.Part_desc like #{query.partDesc}
  1180. </if>
  1181. and a.RealFlag = 'Y'
  1182. </where>
  1183. </select>
  1184. <select id="getOADetailForBM" resultType="PlmTechnicalSpecificationSheetData">
  1185. select
  1186. top 1
  1187. d.is_reject,
  1188. d.node_id,
  1189. d.node_name,
  1190. dbo.get_plm_Approval_username (a.site, prh.workflow_id,d.node_id,a.code_no) as sp
  1191. from plm_technical_specification_sheet a
  1192. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'
  1193. 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
  1194. where a.site=#{site} and a.code_no=#{codeNo}
  1195. </select>
  1196. <select id="searchCopyPart" resultType="PlmProjectPartData">
  1197. Select a.Final_Part_No,a.Test_part_no,a.Active, a.Part_desc ,a.project_id,pcpi.customer_part_no,a.bu_no
  1198. from plm_project_info c
  1199. left join view_Project_Part a on a.site = c.site and a.project_id = c.project_id
  1200. 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
  1201. left join part p on a.Final_Part_No = p.part_no
  1202. left join plm_technical_specification_sheet ps on a.site=ps.site and a.Test_part_no=ps.Test_part_no
  1203. where a.project_id=#{projectId} and a.site=#{site} and a.Test_part_no!=#{testPartNo} and a.realFlag='Y' and ps.Test_part_no is null
  1204. and dbo.Get_PartHasRealBOMRoute(a.site,a.Final_Part_No) ='Y'
  1205. </select>
  1206. <select id="queryCustomerPartNo" resultType="java.lang.String">
  1207. select top 1 pcpi.customer_part_no
  1208. from plm_customer_part_info pcpi
  1209. where pcpi.site = #{site}
  1210. and pcpi.customer_no = #{customerId}
  1211. and pcpi.part_no = #{partNo}
  1212. </select>
  1213. <insert id="saveCustomerPartNo">
  1214. insert into plm_customer_part_info(site, customer_no, part_no, customer_part_no, create_date, create_by)
  1215. values (#{site},#{customerId},#{partNo},#{customerPartNo},getdate(),#{username})
  1216. </insert>
  1217. <update id="updateCustomerPartNo">
  1218. update plm_customer_part_info
  1219. set customer_part_no = #{customerPartNo},
  1220. update_by = #{username},
  1221. update_date = getdate()
  1222. where site = #{site}
  1223. and customer_no = #{customerId}
  1224. and part_no = #{partNo}
  1225. </update>
  1226. <select id="technicalSpecificationList"
  1227. resultType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
  1228. SELECT a.id,
  1229. a.site,
  1230. a.code_no as codeNo,
  1231. a.project_id as projectId,
  1232. a.test_part_no as testPartNo,
  1233. a.status,
  1234. a.rev_no as revNo,
  1235. a.work_center_no as workCenterNo,
  1236. a.ECN_flag as ecnFlag,
  1237. a.ECN_no as ecnNo,
  1238. a.ori_code_no as oriCodeNo,
  1239. a.ECN_address as ecnAddress,
  1240. a.remark,
  1241. a.create_date as createDate,
  1242. a.create_by as createBy,
  1243. a.update_date as updateDate,
  1244. a.update_by as updateBy,
  1245. b.final_part_no as finalPartNo,
  1246. b.part_type as partTypeDesc,
  1247. b.part_type as partType,
  1248. b.part_name as partName,
  1249. b.part_desc as partDesc,
  1250. b.part_spec as partSpec,
  1251. dbo.plm_get_technicalBaseDesc(a.status, 'status') as statusDesc,
  1252. a.proofing_no as proofingNo,
  1253. b.bu_no as buNo,
  1254. dbo.plm_get_bu_desc(a.site, b.bu_no) as buDesc,
  1255. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'engineer') as engineer,
  1256. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'technician') as technician,
  1257. process,
  1258. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'quotationOfficer') as quotationOfficer,
  1259. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'engineer') as engineerNo,
  1260. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'technician') as technicianNo,
  1261. c.customer_Id as customerId,
  1262. a.picture_addess as pictureAddess,
  1263. a.customerPictureChangeRemark,
  1264. a.productionFileComments,
  1265. a.bom_type as bomType,
  1266. a.eng_chg_level as engChgLevel,
  1267. a.bom_alternative_no as bomAlternativeNo,
  1268. a.routing_type as routingType,
  1269. a.routing_revision as routingRevision,
  1270. a.routing_alternative_no as routingAlternativeNo,
  1271. a.pod,
  1272. a.mpOperator,
  1273. dbo.get_userDisPlay(a.mpOperator) as mpOperatorName,
  1274. a.peOperater,
  1275. dbo.get_userDisPlay(a.peOperater) as peOperaterName,
  1276. a.csOperater,
  1277. dbo.get_userDisPlay(a.csOperater) as csOperaterName,
  1278. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'dcc') as dccOperaterName,
  1279. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'cqc') as cqcOperatorName,
  1280. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'fai') as faiOperatorName,
  1281. <!-- a.cqcOperator,-->
  1282. <!-- dbo.get_userDisPlay(a.cqcOperator) as cqcOperatorName,-->
  1283. <!-- a.faiOperator,-->
  1284. <!-- dbo.get_userDisPlay(a.faiOperator) as faiOperatorName,-->
  1285. d.is_reject as isReject,
  1286. d.node_id as nodeId,
  1287. d.node_name as nodeName,
  1288. pcpi.customer_part_no as customerPartNo,
  1289. dbo.get_plm_Approval_username(a.site, prh.workflow_id, d.node_id, a.code_no) as sp,
  1290. a.remarkPage,
  1291. a.rev,
  1292. a.customer_rev as customerRev,
  1293. b.plm_part_no as plmPartNo,
  1294. c.project_name as projectName
  1295. FROM plm_technical_specification_sheet a
  1296. left join view_Project_final_Part b
  1297. on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no
  1298. left join plm_project_info c on a.site = c.site and a.project_id = c.project_id
  1299. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'
  1300. left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and
  1301. prh.workflow_id = d.workflow_id and a.step_id = d.step_id
  1302. left join plm_customer_part_info pcpi
  1303. on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no
  1304. <if test="cutterNumber != null and cutterNumber != ''">
  1305. inner join plm_bm_prepress pbp on pbp.Site = a.site and pbp.code_no = a.code_no and
  1306. (plateNo like #{cutterNumber} or
  1307. cutterNumber like #{cutterNumber})
  1308. </if>
  1309. <where>
  1310. <if test="id != null">
  1311. AND a.id = #{id}
  1312. </if>
  1313. <if test="site != null and site != ''">
  1314. AND a.site = #{site}
  1315. </if>
  1316. <if test="ecnFlag != null and ecnFlag != ''">
  1317. AND a.ecn_flag = #{ecnFlag}
  1318. </if>
  1319. <if test="oriCodeNo != null and oriCodeNo != ''">
  1320. AND a.ori_code_no like #{oriCodeNo}
  1321. </if>
  1322. <if test="codeNo != null and codeNo != ''">
  1323. AND a.code_no like #{codeNo}
  1324. </if>
  1325. <if test="projectId != null and projectId != ''">
  1326. AND a.project_id like #{projectId}
  1327. </if>
  1328. <if test="testPartNo != null and testPartNo != ''">
  1329. AND (
  1330. a.test_part_no like #{testPartNo} or
  1331. b.final_part_no like #{testPartNo} or
  1332. a.relevance_part_no like #{testPartNo} or
  1333. pcpi.customer_part_no like #{testPartNo}
  1334. )
  1335. </if>
  1336. <if test="customerDesc != null and customerDesc != ''">
  1337. AND (
  1338. dbo.plm_get_customer_desc(c.site, c.customer_id) like #{customerDesc} or
  1339. dbo.plm_get_dictDataLabel('finalCustomer', c.final_customer_id, c.site) like #{customerDesc}
  1340. )
  1341. </if>
  1342. <if test="statusDesc != null and statusDesc != ''">
  1343. AND dbo.plm_get_technicalBaseDesc(a.status, 'status') like #{statusDesc}
  1344. </if>
  1345. <if test="buNo == null || buNo == ''">
  1346. AND b.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(#{site}, #{userName}))
  1347. </if>
  1348. <if test="buNo != null and buNo != ''">
  1349. AND b.bu_no like #{buNo}
  1350. </if>
  1351. </where>
  1352. order by a.ori_code_no desc, a.rev_no desc
  1353. </select>
  1354. <select id="queryTechnicalSpecificationCount" resultType="long">
  1355. SELECT
  1356. count(1)
  1357. FROM plm_technical_specification_sheet a
  1358. left join view_Project_final_Part b
  1359. on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no
  1360. left join plm_project_info c on a.site = c.site and a.project_id = c.project_id
  1361. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'
  1362. left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and
  1363. prh.workflow_id = d.workflow_id and a.step_id = d.step_id
  1364. left join plm_customer_part_info pcpi
  1365. on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no
  1366. <if test="cutterNumber != null and cutterNumber != ''">
  1367. inner join plm_bm_prepress pbp on pbp.Site = a.site and pbp.code_no = a.code_no and
  1368. (plateNo like #{cutterNumber} or
  1369. cutterNumber like #{cutterNumber})
  1370. </if>
  1371. <where>
  1372. <if test="id != null">
  1373. AND a.id = #{id}
  1374. </if>
  1375. <if test="site != null and site != ''">
  1376. AND a.site = #{site}
  1377. </if>
  1378. <if test="ecnFlag != null and ecnFlag != ''">
  1379. AND a.ecn_flag = #{ecnFlag}
  1380. </if>
  1381. <if test="oriCodeNo != null and oriCodeNo != ''">
  1382. AND a.ori_code_no like #{oriCodeNo}
  1383. </if>
  1384. <if test="codeNo != null and codeNo != ''">
  1385. AND a.code_no like #{codeNo}
  1386. </if>
  1387. <if test="projectId != null and projectId != ''">
  1388. AND a.project_id like #{projectId}
  1389. </if>
  1390. <if test="testPartNo != null and testPartNo != ''">
  1391. AND (
  1392. a.test_part_no like #{testPartNo} or
  1393. b.final_part_no like #{testPartNo} or
  1394. a.relevance_part_no like #{testPartNo} or
  1395. pcpi.customer_part_no like #{testPartNo}
  1396. )
  1397. </if>
  1398. <if test="customerDesc != null and customerDesc != ''">
  1399. AND (
  1400. dbo.plm_get_customer_desc(c.site, c.customer_id) like #{customerDesc} or
  1401. dbo.plm_get_dictDataLabel('finalCustomer', c.final_customer_id, c.site) like #{customerDesc}
  1402. )
  1403. </if>
  1404. <if test="statusDesc != null and statusDesc != ''">
  1405. AND dbo.plm_get_technicalBaseDesc(a.status, 'status') like #{statusDesc}
  1406. </if>
  1407. <if test="buNo == null || buNo == ''">
  1408. AND b.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(#{site}, #{userName}))
  1409. </if>
  1410. <if test="buNo != null and buNo != ''">
  1411. AND b.bu_no like #{buNo}
  1412. </if>
  1413. </where>
  1414. </select>
  1415. <select id="queryTechnicalSpecificationList"
  1416. resultType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
  1417. EXEC dbo.getTechnicalSpecificationPageWithSql #{sql}, #{page}, #{limit}
  1418. </select>
  1419. </mapper>