338fe843bea58a154a4757a21334d2c5930ec7a0.svn-base 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. <?xml version="1.0" encoding='UTF-8'?>
  2. <queryMap desc="材质检测录入界面">
  3. <query id="JHY02.SMP_D_SELECT" desc="查询委托信息">
  4. select t1.smp_no,
  5. t1.specimen_no,
  6. t1.heat_no,
  7. t1.batch_no,
  8. t1.inspection_lot,
  9. t1.freq_code,
  10. t1.freq_name,
  11. t1.material_no,
  12. t1.smp_type_code,
  13. t1.smp_type_name,
  14. t1.consign_no,
  15. t1.consign_no_seq,
  16. t1.test_qty,
  17. t1.smp_qty,
  18. t1.smp_location,
  19. t1.board_no,
  20. t1.quote_consign_no,
  21. t1.old_consign_no,
  22. t1.pline_code,
  23. t1.pline_name,
  24. t1.status,
  25. t1.validflag,
  26. t1.source,
  27. t1.guid,
  28. t1.send_id,
  29. t1.send_name,
  30. to_char(t1.send_time,'yyyy-MM-dd hh24:mi:ss') send_time,
  31. t1.chem_item,
  32. t1.product_cnt,
  33. to_char(t1.create_time,'yyyy-MM-dd hh24:mi:ss') create_time,
  34. t1.smp_location_code,
  35. t1.memo,
  36. t2.psc,
  37. t2.psc_desc,
  38. t2.smp_catg,
  39. t2.cert_inst_code,
  40. t2.cert_inst_name,
  41. t2.grade_code,
  42. t2.grade_name,
  43. t2.memo ordermemo,
  44. t1.send_flag,
  45. t1.gyh
  46. from jhy_weito_m t1, qcm_jhy_sample_consign_m t2
  47. where t1.smp_no = t2.smp_no(+)
  48. and exists
  49. (select 1
  50. from (select '0' send_flag from dual union select '1' send_flag from dual) tt
  51. where tt.send_flag = t1.send_flag)
  52. and t1.pline_name = nvl(?, t1.pline_name)
  53. and to_char(t1.create_time, 'yyyyMMddhh24miss') between
  54. nvl(?, t1.create_time) and nvl(?, t1.create_time)
  55. and t1.batch_no like ?||'%'
  56. order by t1.gyh desc
  57. </query>
  58. <query id="JHY02.SMP_D_ITEM_SELECT" desc="查询委托明细条目信息">
  59. select phy_code_l qlty_cd_2,
  60. phy_code_s qlty_cd_3,
  61. phy_name_s qlty_cd_3_nm,
  62. smp_no,
  63. --specimen_no,
  64. seq
  65. from (select t.phy_code_l,
  66. t.phy_code_s,
  67. phy_name_s,
  68. row_number() over(partition by t.phy_name_s order by t.seq) xh,
  69. t.smp_no,
  70. t.specimen_no,
  71. t.seq
  72. from qcm_jhy_sample_consign_d_item t
  73. where t.smp_no = ?
  74. union
  75. select 'HA' phy_code_l,
  76. 'ER' phy_code_s,
  77. '面积' phy_name_s,
  78. 1 xh,
  79. t.smp_no,
  80. t.specimen_no,
  81. 0 seq
  82. from tbb10_qlty_qcmval t
  83. where t.smp_no = ?
  84. and t.qlty_cd_2 = 'HA'
  85. group by t.smp_no, t.specimen_no)
  86. where xh = 1
  87. order by seq
  88. </query>
  89. <query id="JHY02.QLTY_QCM_SELECT" desc="查询检验明细信息">
  90. select distinct t.*
  91. from (select nvl(t3.qlty_ope_cd, t1.qlty_ope_cd) qlty_ope_cd,
  92. nvl(t3.qlty_dis_seq, 1) qlty_dis_seq,
  93. nvl(t3.qlty_ope_cfnm, t1.qlty_ope_cfnm) qlty_ope_cfnm
  94. from tbb10_qlty_qcmval t1, tbb10_qlty_qcm t3
  95. where t1.qlty_cd_2 = t3.line_range(+)
  96. and t1.smp_cut_loc = t3.qlty_cd_2(+)
  97. and t1.smp_no = ?
  98. and t1.qlty_cd_after = ?
  99. order by t1.smp_no_type, t3.qlty_dis_seq) t
  100. order by t.qlty_dis_seq
  101. </query>
  102. <query id="JHY02.QLTY_QCMVAL_SELECT" desc="纵转横">
  103. with t1 as
  104. (select t3.smp_no smp_no1,
  105. t3.specimen_no specimen_no1,
  106. t3.smp_no_type smp_no_type1,
  107. t3.smp_cut_loc smp_cut_loc1
  108. {1}
  109. from tbb10_qlty_qcmval t3
  110. where t3.smp_no = ?
  111. group by t3.smp_no, t3.specimen_no, t3.smp_no_type, t3.smp_cut_loc)
  112. select t.smp_cut_loc,
  113. t.qlty_cd_2,
  114. t.qlty_ope_cfnm,
  115. decode(t.qlty_cd_after,
  116. 'ER',
  117. '面积',
  118. t2.phy_name_s || ' ' || t2.item_name_t || ' ' ||
  119. t2.item_name_d || ' ' || t2.item_name_s) qlty_cd_cfnm,
  120. t.qlty_val,
  121. t.qlty_cd_after,
  122. t.smp_no,
  123. t.specimen_no,
  124. t.smp_no_type,
  125. t.qlty_cd,
  126. t4.material_no,
  127. t1.*
  128. from tbb10_qlty_qcmval t, t1, qcm_jhy_sample_consign_d_item t2,qcm_jhy_sample_consign_d t4
  129. where t.smp_no = t1.smp_no1(+)
  130. and t.specimen_no = t1.specimen_no1(+)
  131. and t.smp_no_type = t1.smp_no_type1(+)
  132. and nvl(t.smp_cut_loc, '0') = nvl(t1.smp_cut_loc1(+), '0')
  133. and t.smp_no = t2.smp_no(+)
  134. and t.specimen_no = t2.specimen_no(+)
  135. and t.qlty_cd = t2.seq(+)
  136. and t.smp_no = t4.smp_no(+)
  137. and t.specimen_no = t4.specimen_no(+)
  138. and t.qlty_cd_2 = ?
  139. and t.qlty_cd_after = ?
  140. and t.smp_no = ?
  141. order by t.smp_no, t.specimen_no, t.smp_no_type, t.qlty_ope_cd
  142. </query>
  143. <query id="JHY02.QLTY_QCMVAL_IMPORT_SELECT" desc="原始数据录入">
  144. select t1.qlty_ope_cfnm,
  145. t1.qlty_ope_cd,
  146. t1.smp_cut_loc,
  147. decode(nvl(t1.qlty_type, '1'), '2', t3.comp_cal2, t3.comp_cal) comp_cal,
  148. decode(nvl(t1.qlty_type, '1'), '2', t3.qlty_dis_len2, t3.qlty_dis_len) qlty_dis_len,
  149. decode(nvl(t1.qlty_type, '1'), '2', t3.crct_reg2, t3.crct_reg) crct_reg,
  150. t3.qlty_dis_seq,
  151. t1.qlty_val,
  152. t1.qlty_val1,
  153. t1.qlty_val2,
  154. t1.qlty_val3,
  155. t3.edit_tp
  156. from tbb10_qlty_qcmval t1,
  157. tbb10_qlty_qcm t3
  158. where t1.smp_cut_loc = t3.qlty_cd_2(+)
  159. and t1.qlty_ope_cd = t3.qlty_ope_cd(+)
  160. and t1.smp_no = ?
  161. and t1.specimen_no = ?
  162. and t1.smp_no_type = ?
  163. and nvl(t1.smp_cut_loc, '0') = ?
  164. and t1.qlty_cd_2 = ?
  165. and t1.qlty_ope_cd in
  166. (select t.qlty_ope_cd
  167. from tbb10_qlty_qcm t
  168. where instr(t.qlty_ope_grp, ?) > 0)
  169. order by t3.qlty_dis_seq
  170. </query>
  171. <query id="JHY02.QLTY_QCMVAL_VALUE_SELECT" desc="原始数据录入">
  172. select t1.qlty_ope_cd,
  173. t1.qlty_val,
  174. t1.qlty_val1,
  175. t1.qlty_val2,
  176. t1.qlty_val3
  177. from tbb10_qlty_qcmval t1,
  178. tbb10_qlty_qcm t3
  179. where t1.smp_cut_loc = t3.qlty_cd_2(+)
  180. and t1.qlty_ope_cd = t3.qlty_ope_cd(+)
  181. and t1.smp_no = ?
  182. and t1.specimen_no = ?
  183. and t1.smp_no_type = ?
  184. <!--and nvl(t1.smp_cut_loc, '0') = ?
  185. and t1.qlty_cd_2 = ?
  186. and t1.qlty_ope_cd in
  187. (select t.qlty_ope_cd
  188. from tbb10_qlty_qcm t
  189. where instr(t.qlty_ope_grp, ?) > 0)-->
  190. </query>
  191. <query id="JHY02.QLTY_QCMVAL_IMPORT_SELECT2" desc="原始数据录入">
  192. select t1.qlty_ope_cfnm,
  193. t1.qlty_ope_cd,
  194. t1.smp_cut_loc,
  195. decode(nvl(t1.qlty_type, '1'), '2', t3.comp_cal2, t3.comp_cal) comp_cal,
  196. decode(nvl(t1.qlty_type, '1'), '2', t3.qlty_dis_len2, t3.qlty_dis_len) qlty_dis_len,
  197. decode(nvl(t1.qlty_type, '1'), '2', t3.crct_reg2, t3.crct_reg) crct_reg,
  198. t3.qlty_dis_seq,
  199. t1.qlty_val,
  200. t1.qlty_val1,
  201. t1.qlty_val2,
  202. t1.qlty_val3,
  203. t3.edit_tp
  204. from tbb10_qlty_qcmval t1,
  205. tbb10_qlty_qcm t3
  206. where t1.smp_cut_loc = t3.qlty_cd_2(+)
  207. and t1.qlty_ope_cd = t3.qlty_ope_cd(+)
  208. and t1.smp_no = ?
  209. and t1.specimen_no = ?
  210. and t1.smp_no_type = ?
  211. and nvl(t1.smp_cut_loc, '0') = ?
  212. and t1.qlty_cd_2 = ?
  213. and t1.qlty_ope_cd = ?
  214. </query>
  215. <query id="JHY02.QLTY_QCMVAL_VALUE_SELECT2" desc="原始数据录入">
  216. select t1.qlty_ope_cd,
  217. t1.qlty_val,
  218. t1.qlty_val1,
  219. t1.qlty_val2,
  220. t1.qlty_val3
  221. from tbb10_qlty_qcmval t1,
  222. tbb10_qlty_qcm t3
  223. where t1.smp_cut_loc = t3.qlty_cd_2(+)
  224. and t1.qlty_ope_cd = t3.qlty_ope_cd(+)
  225. and t1.smp_no = ?
  226. and t1.specimen_no = ?
  227. and t1.smp_no_type = ?
  228. <!--and nvl(t1.smp_cut_loc, '0') = ?
  229. and t1.qlty_cd_2 = ?
  230. and t1.qlty_ope_cd = ?-->
  231. </query>
  232. <query id="JHY02.QLTY_ITEM_VALUE_SELECT" desc="查询检验结果">
  233. select t1.specimen_no,
  234. t1.seq,
  235. t1.smp_no,
  236. t1.phy_name_l,
  237. t1.phy_code_l,
  238. t1.phy_code_m,
  239. t1.phy_name_m,
  240. t1.phy_code_s,
  241. t1.phy_name_s,
  242. t1.item_code_d,
  243. t1.item_name_d,
  244. t1.item_code_t,
  245. t1.item_name_t,
  246. t1.item_code_s,
  247. t1.item_name_s,
  248. t1.item_code_l,
  249. t1.item_desc_l,
  250. t2.qlty_val
  251. from qcm_jhy_sample_consign_d_item t1, tbb10_qlty_qcmval t2
  252. where t1.smp_no = t2.smp_no(+)
  253. and t1.specimen_no = t2.specimen_no(+)
  254. and t1.seq = t2.qlty_cd(+)
  255. and t1.smp_no = ?
  256. order by t1.smp_no, t1.specimen_no, t1.seq
  257. </query>
  258. <query id="JHY02.QLTY_SEND_ITEM_VALUE_SELECT" desc="查询要发送的检验结果">
  259. select phy_name_s,
  260. item_name_d,
  261. create_name,
  262. phy_name_m,
  263. phy_name_l,
  264. item_code_t,
  265. item_code_s,
  266. group_seq,
  267. to_char(create_time, 'yyyy-MM-dd hh24:mi:ss') create_time,
  268. item_code_l,
  269. '0' defect_flag,
  270. memo,
  271. phy_code_m,
  272. phy_code_l,
  273. item_desc_l,
  274. item_code_d,
  275. phy_code_s,
  276. sys_guid() guid,
  277. phy_unit unti,
  278. --max_val,
  279. item_name_t,
  280. item_name_s,
  281. test_qty,
  282. t2.val1,
  283. t2.val2,
  284. t2.val3,
  285. t2.val4,
  286. t2.val5,
  287. t2.val6,
  288. t2.val7,
  289. t2.val8,
  290. t2.val9,
  291. --min_val,
  292. t1.seq --,
  293. --avg_val
  294. from qcm_jhy_sample_consign_d_item t1,
  295. (select t1.smp_no,
  296. t1.specimen_no,
  297. t1.seq,
  298. max(t1.val1) val1,
  299. max(t1.val2) val2,
  300. max(t1.val3) val3,
  301. max(t1.val4) val4,
  302. max(t1.val5) val5,
  303. max(t1.val6) val6,
  304. max(t1.val7) val7,
  305. max(t1.val8) val8,
  306. max(t1.val9) val9
  307. from (with t2 as (select t.smp_no,
  308. t.specimen_no,
  309. t.qlty_cd,
  310. t.qlty_val,
  311. row_number() over(partition by t.smp_no, t.specimen_no, t.qlty_cd order by t.qlty_ope_cd) xh
  312. from tbb10_qlty_qcmval t
  313. where t.specimen_no = ?)
  314. select t1.smp_no,
  315. t1.specimen_no,
  316. t1.seq,
  317. decode(t2.xh, 1, t2.qlty_val, '') val1,
  318. decode(t2.xh, 2, t2.qlty_val, '') val2,
  319. decode(t2.xh, 3, t2.qlty_val, '') val3,
  320. decode(t2.xh, 4, t2.qlty_val, '') val4,
  321. decode(t2.xh, 5, t2.qlty_val, '') val5,
  322. decode(t2.xh, 6, t2.qlty_val, '') val6,
  323. decode(t2.xh, 7, t2.qlty_val, '') val7,
  324. decode(t2.xh, 8, t2.qlty_val, '') val8,
  325. decode(t2.xh, 9, t2.qlty_val, '') val9
  326. from qcm_jhy_sample_consign_d_item t1, t2
  327. where t1.smp_no = t2.smp_no(+)
  328. and t1.specimen_no = t2.specimen_no(+)
  329. and t1.seq = t2.qlty_cd(+)
  330. and t1.specimen_no = ?) t1
  331. group by t1.smp_no, t1.specimen_no, t1.seq
  332. ) t2
  333. where t1.smp_no = t2.smp_no(+)
  334. and t1.specimen_no = t2.specimen_no(+)
  335. and t1.seq = t2.seq(+)
  336. and t1.specimen_no = ?
  337. order by t1.seq
  338. </query>
  339. <query id="JHY02.EXPORT_PULL_SELECT" desc="导出拉力原始记录">
  340. with t3 as
  341. (select t3.smp_no,
  342. t3.specimen_no,
  343. t3.smp_no_type,
  344. t3.smp_cut_loc,
  345. max(decode('a', t3.qlty_ope_cd, t3.qlty_val1, null)) "a01",
  346. max(decode('b', t3.qlty_ope_cd, t3.qlty_val1, null)) "b01",
  347. max(decode('a', t3.qlty_ope_cd, t3.qlty_val2, null)) "a02",
  348. max(decode('b', t3.qlty_ope_cd, t3.qlty_val2, null)) "b02",
  349. max(decode('a', t3.qlty_ope_cd, t3.qlty_val3, null)) "a03",
  350. max(decode('b', t3.qlty_ope_cd, t3.qlty_val3, null)) "b03",
  351. max(decode('Fe', t3.qlty_ope_cd, t3.qlty_val, null)) "FeL/FeH",
  352. max(decode('Fm', t3.qlty_ope_cd, t3.qlty_val, null)) "Fm",
  353. max(decode('Lo', t3.qlty_ope_cd, t3.qlty_val, null)) "Lo",
  354. max(decode('Lu', t3.qlty_ope_cd, t3.qlty_val, null)) "Lu"
  355. from tbb10_qlty_qcmval t3
  356. where instr(? , t3.specimen_no) > 0
  357. and t3.qlty_cd_2 = 'HA'
  358. group by t3.smp_no, t3.specimen_no, t3.smp_no_type, t3.smp_cut_loc),
  359. t4 as
  360. (select t.specimen_no, t.item_code_s
  361. from qcm_jhy_sample_consign_d_item t
  362. where instr(? , t.specimen_no) > 0
  363. and t.phy_code_l = 'HA'
  364. group by t.specimen_no, t.item_code_s)
  365. select t.gyh, t2.grade_name, t.batch_no, t.material_thk, t3.*,
  366. t4.item_code_s
  367. from jhy_weito_m t, qcm_jhy_sample_consign_m t2,t3, t4
  368. where t.smp_no = t2.smp_no(+)
  369. and t.specimen_no = t3.specimen_no(+)
  370. and t.specimen_no = t4.specimen_no(+)
  371. and instr(? , t.specimen_no) > 0
  372. and t4.item_code_s = ?
  373. </query>
  374. <query id="JHY02.EXPORT_CJ_SELECT" desc="导出冲击原始记录">
  375. with t3 as
  376. (select t3.smp_no,
  377. t3.specimen_no,
  378. t3.smp_no_type,
  379. t3.smp_cut_loc,
  380. t2.item_name_d,
  381. t2.item_name_t,
  382. max(decode('A1', t3.qlty_ope_cd, t3.qlty_val, null)) "J1",
  383. max(decode('A2', t3.qlty_ope_cd, t3.qlty_val, null)) "J2",
  384. max(decode('A3', t3.qlty_ope_cd, t3.qlty_val, null)) "J3"
  385. from tbb10_qlty_qcmval t3, qcm_jhy_sample_consign_d_item t2
  386. where t3.smp_no = t2.smp_no(+)
  387. and t3.specimen_no = t2.specimen_no(+)
  388. and t3.qlty_cd = t2.seq(+)
  389. and instr(? , t3.specimen_no) > 0
  390. and t3.qlty_cd_2 = 'HC'
  391. group by t3.smp_no,
  392. t3.specimen_no,
  393. t3.smp_no_type,
  394. t3.smp_cut_loc,
  395. t2.item_name_d,
  396. t2.item_name_t)
  397. select t.gyh, t2.grade_name, t.batch_no, t.material_thk, t3.*
  398. from jhy_weito_m t, qcm_jhy_sample_consign_m t2, t3
  399. where t.smp_no = t2.smp_no(+)
  400. and t.specimen_no = t3.specimen_no(+)
  401. and instr(? , t.specimen_no) > 0
  402. </query>
  403. <query id="JHY02_1.CALL" desc="原始数据保存">
  404. {call jhy02.save_work_val1(?,?,?,?,?,?,?,?,?,?,?,?,?)}
  405. </query>
  406. <query id="JHY02_2.CALL" desc="原始数据保存">
  407. {call jhy02.save_work_val2(?,?,?,?,?,?,?,?,?,?,?,?,?)}
  408. </query>
  409. <query id="JHY02_3.CALL" desc="原始数据保存">
  410. {call jhy02.save_work_val3(?,?,?,?,?,?,?,?,?,?,?,?,?)}
  411. </query>
  412. <query id="JHY02.UPDATE_SEND_FLAG" desc="修改发送状态">
  413. update jhy_weito_m t set t.send_flag = '1' where t.specimen_no = ?
  414. </query>
  415. </queryMap>