| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432 |
- <?xml version="1.0" encoding='UTF-8'?>
- <queryMap desc="材质检测录入界面">
- <query id="JHY02.SMP_D_SELECT" desc="查询委托信息">
- select t1.smp_no,
- t1.specimen_no,
- t1.heat_no,
- t1.batch_no,
- t1.inspection_lot,
- t1.freq_code,
- t1.freq_name,
- t1.material_no,
- t1.smp_type_code,
- t1.smp_type_name,
- t1.consign_no,
- t1.consign_no_seq,
- t1.test_qty,
- t1.smp_qty,
- t1.smp_location,
- t1.board_no,
- t1.quote_consign_no,
- t1.old_consign_no,
- t1.pline_code,
- t1.pline_name,
- t1.status,
- t1.validflag,
- t1.source,
- t1.guid,
- t1.send_id,
- t1.send_name,
- to_char(t1.send_time,'yyyy-MM-dd hh24:mi:ss') send_time,
- t1.chem_item,
- t1.product_cnt,
- to_char(t1.create_time,'yyyy-MM-dd hh24:mi:ss') create_time,
- t1.smp_location_code,
- t1.memo,
- t2.psc,
- t2.psc_desc,
- t2.smp_catg,
- t2.cert_inst_code,
- t2.cert_inst_name,
- t2.grade_code,
- t2.grade_name,
- t2.memo ordermemo,
- t1.send_flag,
- t1.gyh
- from jhy_weito_m t1, qcm_jhy_sample_consign_m t2
- where t1.smp_no = t2.smp_no(+)
- and exists
- (select 1
- from (select '0' send_flag from dual union select '1' send_flag from dual) tt
- where tt.send_flag = t1.send_flag)
- and t1.pline_name = nvl(?, t1.pline_name)
- and to_char(t1.create_time, 'yyyyMMddhh24miss') between
- nvl(?, t1.create_time) and nvl(?, t1.create_time)
- and t1.batch_no like ?||'%'
- order by t1.gyh desc
- </query>
- <query id="JHY02.SMP_D_ITEM_SELECT" desc="查询委托明细条目信息">
- select phy_code_l qlty_cd_2,
- phy_code_s qlty_cd_3,
- phy_name_s qlty_cd_3_nm,
- smp_no,
- --specimen_no,
- seq
- from (select t.phy_code_l,
- t.phy_code_s,
- phy_name_s,
- row_number() over(partition by t.phy_name_s order by t.seq) xh,
- t.smp_no,
- t.specimen_no,
- t.seq
- from qcm_jhy_sample_consign_d_item t
- where t.smp_no = ?
- union
- select 'HA' phy_code_l,
- 'ER' phy_code_s,
- '面积' phy_name_s,
- 1 xh,
- t.smp_no,
- t.specimen_no,
- 0 seq
- from tbb10_qlty_qcmval t
- where t.smp_no = ?
- and t.qlty_cd_2 = 'HA'
- group by t.smp_no, t.specimen_no)
- where xh = 1
- order by seq
- </query>
- <query id="JHY02.QLTY_QCM_SELECT" desc="查询检验明细信息">
- select distinct t.*
- from (select nvl(t3.qlty_ope_cd, t1.qlty_ope_cd) qlty_ope_cd,
- nvl(t3.qlty_dis_seq, 1) qlty_dis_seq,
- nvl(t3.qlty_ope_cfnm, t1.qlty_ope_cfnm) qlty_ope_cfnm
- from tbb10_qlty_qcmval t1, tbb10_qlty_qcm t3
- where t1.qlty_cd_2 = t3.line_range(+)
- and t1.smp_cut_loc = t3.qlty_cd_2(+)
- and t1.smp_no = ?
- and t1.qlty_cd_after = ?
- order by t1.smp_no_type, t3.qlty_dis_seq) t
- order by t.qlty_dis_seq
- </query>
- <query id="JHY02.QLTY_QCMVAL_SELECT" desc="纵转横">
- with t1 as
- (select t3.smp_no smp_no1,
- t3.specimen_no specimen_no1,
- t3.smp_no_type smp_no_type1,
- t3.smp_cut_loc smp_cut_loc1
- {1}
- from tbb10_qlty_qcmval t3
- where t3.smp_no = ?
- group by t3.smp_no, t3.specimen_no, t3.smp_no_type, t3.smp_cut_loc)
- select t.smp_cut_loc,
- t.qlty_cd_2,
- t.qlty_ope_cfnm,
- decode(t.qlty_cd_after,
- 'ER',
- '面积',
- t2.phy_name_s || ' ' || t2.item_name_t || ' ' ||
- t2.item_name_d || ' ' || t2.item_name_s) qlty_cd_cfnm,
- t.qlty_val,
- t.qlty_cd_after,
- t.smp_no,
- t.specimen_no,
- t.smp_no_type,
- t.qlty_cd,
- t4.material_no,
- t1.*
- from tbb10_qlty_qcmval t, t1, qcm_jhy_sample_consign_d_item t2,qcm_jhy_sample_consign_d t4
- where t.smp_no = t1.smp_no1(+)
- and t.specimen_no = t1.specimen_no1(+)
- and t.smp_no_type = t1.smp_no_type1(+)
- and nvl(t.smp_cut_loc, '0') = nvl(t1.smp_cut_loc1(+), '0')
- and t.smp_no = t2.smp_no(+)
- and t.specimen_no = t2.specimen_no(+)
- and t.qlty_cd = t2.seq(+)
- and t.smp_no = t4.smp_no(+)
- and t.specimen_no = t4.specimen_no(+)
- and t.qlty_cd_2 = ?
- and t.qlty_cd_after = ?
- and t.smp_no = ?
- order by t.smp_no, t.specimen_no, t.smp_no_type, t.qlty_ope_cd
- </query>
- <query id="JHY02.QLTY_QCMVAL_IMPORT_SELECT" desc="原始数据录入">
- select t1.qlty_ope_cfnm,
- t1.qlty_ope_cd,
- t1.smp_cut_loc,
- decode(nvl(t1.qlty_type, '1'), '2', t3.comp_cal2, t3.comp_cal) comp_cal,
- decode(nvl(t1.qlty_type, '1'), '2', t3.qlty_dis_len2, t3.qlty_dis_len) qlty_dis_len,
- decode(nvl(t1.qlty_type, '1'), '2', t3.crct_reg2, t3.crct_reg) crct_reg,
- t3.qlty_dis_seq,
- t1.qlty_val,
- t1.qlty_val1,
- t1.qlty_val2,
- t1.qlty_val3,
- t3.edit_tp
- from tbb10_qlty_qcmval t1,
- tbb10_qlty_qcm t3
- where t1.smp_cut_loc = t3.qlty_cd_2(+)
- and t1.qlty_ope_cd = t3.qlty_ope_cd(+)
- and t1.smp_no = ?
- and t1.specimen_no = ?
- and t1.smp_no_type = ?
- and nvl(t1.smp_cut_loc, '0') = ?
- and t1.qlty_cd_2 = ?
- and t1.qlty_ope_cd in
- (select t.qlty_ope_cd
- from tbb10_qlty_qcm t
- where instr(t.qlty_ope_grp, ?) > 0)
- order by t3.qlty_dis_seq
- </query>
- <query id="JHY02.QLTY_QCMVAL_VALUE_SELECT" desc="原始数据录入">
- select t1.qlty_ope_cd,
- t1.qlty_val,
- t1.qlty_val1,
- t1.qlty_val2,
- t1.qlty_val3
- from tbb10_qlty_qcmval t1,
- tbb10_qlty_qcm t3
- where t1.smp_cut_loc = t3.qlty_cd_2(+)
- and t1.qlty_ope_cd = t3.qlty_ope_cd(+)
- and t1.smp_no = ?
- and t1.specimen_no = ?
- and t1.smp_no_type = ?
- <!--and nvl(t1.smp_cut_loc, '0') = ?
- and t1.qlty_cd_2 = ?
- and t1.qlty_ope_cd in
- (select t.qlty_ope_cd
- from tbb10_qlty_qcm t
- where instr(t.qlty_ope_grp, ?) > 0)-->
- </query>
- <query id="JHY02.QLTY_QCMVAL_IMPORT_SELECT2" desc="原始数据录入">
- select t1.qlty_ope_cfnm,
- t1.qlty_ope_cd,
- t1.smp_cut_loc,
- decode(nvl(t1.qlty_type, '1'), '2', t3.comp_cal2, t3.comp_cal) comp_cal,
- decode(nvl(t1.qlty_type, '1'), '2', t3.qlty_dis_len2, t3.qlty_dis_len) qlty_dis_len,
- decode(nvl(t1.qlty_type, '1'), '2', t3.crct_reg2, t3.crct_reg) crct_reg,
- t3.qlty_dis_seq,
- t1.qlty_val,
- t1.qlty_val1,
- t1.qlty_val2,
- t1.qlty_val3,
- t3.edit_tp
- from tbb10_qlty_qcmval t1,
- tbb10_qlty_qcm t3
- where t1.smp_cut_loc = t3.qlty_cd_2(+)
- and t1.qlty_ope_cd = t3.qlty_ope_cd(+)
- and t1.smp_no = ?
- and t1.specimen_no = ?
- and t1.smp_no_type = ?
- and nvl(t1.smp_cut_loc, '0') = ?
- and t1.qlty_cd_2 = ?
- and t1.qlty_ope_cd = ?
- </query>
- <query id="JHY02.QLTY_QCMVAL_VALUE_SELECT2" desc="原始数据录入">
- select t1.qlty_ope_cd,
- t1.qlty_val,
- t1.qlty_val1,
- t1.qlty_val2,
- t1.qlty_val3
- from tbb10_qlty_qcmval t1,
- tbb10_qlty_qcm t3
- where t1.smp_cut_loc = t3.qlty_cd_2(+)
- and t1.qlty_ope_cd = t3.qlty_ope_cd(+)
- and t1.smp_no = ?
- and t1.specimen_no = ?
- and t1.smp_no_type = ?
- <!--and nvl(t1.smp_cut_loc, '0') = ?
- and t1.qlty_cd_2 = ?
- and t1.qlty_ope_cd = ?-->
- </query>
- <query id="JHY02.QLTY_ITEM_VALUE_SELECT" desc="查询检验结果">
- select t1.specimen_no,
- t1.seq,
- t1.smp_no,
- t1.phy_name_l,
- t1.phy_code_l,
- t1.phy_code_m,
- t1.phy_name_m,
- t1.phy_code_s,
- t1.phy_name_s,
- t1.item_code_d,
- t1.item_name_d,
- t1.item_code_t,
- t1.item_name_t,
- t1.item_code_s,
- t1.item_name_s,
- t1.item_code_l,
- t1.item_desc_l,
- t2.qlty_val
- from qcm_jhy_sample_consign_d_item t1, tbb10_qlty_qcmval t2
- where t1.smp_no = t2.smp_no(+)
- and t1.specimen_no = t2.specimen_no(+)
- and t1.seq = t2.qlty_cd(+)
- and t1.smp_no = ?
- order by t1.smp_no, t1.specimen_no, t1.seq
- </query>
- <query id="JHY02.QLTY_SEND_ITEM_VALUE_SELECT" desc="查询要发送的检验结果">
- select phy_name_s,
- item_name_d,
- create_name,
- phy_name_m,
- phy_name_l,
- item_code_t,
- item_code_s,
- group_seq,
- to_char(create_time, 'yyyy-MM-dd hh24:mi:ss') create_time,
- item_code_l,
- '0' defect_flag,
- memo,
- phy_code_m,
- phy_code_l,
- item_desc_l,
- item_code_d,
- phy_code_s,
- sys_guid() guid,
- phy_unit unti,
- --max_val,
- item_name_t,
- item_name_s,
- test_qty,
- t2.val1,
- t2.val2,
- t2.val3,
- t2.val4,
- t2.val5,
- t2.val6,
- t2.val7,
- t2.val8,
- t2.val9,
- --min_val,
- t1.seq --,
- --avg_val
- from qcm_jhy_sample_consign_d_item t1,
- (select t1.smp_no,
- t1.specimen_no,
- t1.seq,
- max(t1.val1) val1,
- max(t1.val2) val2,
- max(t1.val3) val3,
- max(t1.val4) val4,
- max(t1.val5) val5,
- max(t1.val6) val6,
- max(t1.val7) val7,
- max(t1.val8) val8,
- max(t1.val9) val9
- from (with t2 as (select t.smp_no,
- t.specimen_no,
- t.qlty_cd,
- t.qlty_val,
- row_number() over(partition by t.smp_no, t.specimen_no, t.qlty_cd order by t.qlty_ope_cd) xh
- from tbb10_qlty_qcmval t
- where t.specimen_no = ?)
- select t1.smp_no,
- t1.specimen_no,
- t1.seq,
- decode(t2.xh, 1, t2.qlty_val, '') val1,
- decode(t2.xh, 2, t2.qlty_val, '') val2,
- decode(t2.xh, 3, t2.qlty_val, '') val3,
- decode(t2.xh, 4, t2.qlty_val, '') val4,
- decode(t2.xh, 5, t2.qlty_val, '') val5,
- decode(t2.xh, 6, t2.qlty_val, '') val6,
- decode(t2.xh, 7, t2.qlty_val, '') val7,
- decode(t2.xh, 8, t2.qlty_val, '') val8,
- decode(t2.xh, 9, t2.qlty_val, '') val9
- from qcm_jhy_sample_consign_d_item t1, t2
- where t1.smp_no = t2.smp_no(+)
- and t1.specimen_no = t2.specimen_no(+)
- and t1.seq = t2.qlty_cd(+)
- and t1.specimen_no = ?) t1
- group by t1.smp_no, t1.specimen_no, t1.seq
- ) t2
- where t1.smp_no = t2.smp_no(+)
- and t1.specimen_no = t2.specimen_no(+)
- and t1.seq = t2.seq(+)
- and t1.specimen_no = ?
- order by t1.seq
- </query>
- <query id="JHY02.EXPORT_PULL_SELECT" desc="导出拉力原始记录">
- with t3 as
- (select t3.smp_no,
- t3.specimen_no,
- t3.smp_no_type,
- t3.smp_cut_loc,
- max(decode('a', t3.qlty_ope_cd, t3.qlty_val1, null)) "a01",
- max(decode('b', t3.qlty_ope_cd, t3.qlty_val1, null)) "b01",
- max(decode('a', t3.qlty_ope_cd, t3.qlty_val2, null)) "a02",
- max(decode('b', t3.qlty_ope_cd, t3.qlty_val2, null)) "b02",
- max(decode('a', t3.qlty_ope_cd, t3.qlty_val3, null)) "a03",
- max(decode('b', t3.qlty_ope_cd, t3.qlty_val3, null)) "b03",
- max(decode('Fe', t3.qlty_ope_cd, t3.qlty_val, null)) "FeL/FeH",
- max(decode('Fm', t3.qlty_ope_cd, t3.qlty_val, null)) "Fm",
- max(decode('Lo', t3.qlty_ope_cd, t3.qlty_val, null)) "Lo",
- max(decode('Lu', t3.qlty_ope_cd, t3.qlty_val, null)) "Lu"
- from tbb10_qlty_qcmval t3
- where instr(? , t3.specimen_no) > 0
- and t3.qlty_cd_2 = 'HA'
- group by t3.smp_no, t3.specimen_no, t3.smp_no_type, t3.smp_cut_loc),
- t4 as
- (select t.specimen_no, t.item_code_s
- from qcm_jhy_sample_consign_d_item t
- where instr(? , t.specimen_no) > 0
- and t.phy_code_l = 'HA'
- group by t.specimen_no, t.item_code_s)
- select t.gyh, t2.grade_name, t.batch_no, t.material_thk, t3.*,
- t4.item_code_s
- from jhy_weito_m t, qcm_jhy_sample_consign_m t2,t3, t4
- where t.smp_no = t2.smp_no(+)
- and t.specimen_no = t3.specimen_no(+)
- and t.specimen_no = t4.specimen_no(+)
- and instr(? , t.specimen_no) > 0
- and t4.item_code_s = ?
- </query>
- <query id="JHY02.EXPORT_CJ_SELECT" desc="导出冲击原始记录">
- with t3 as
- (select t3.smp_no,
- t3.specimen_no,
- t3.smp_no_type,
- t3.smp_cut_loc,
- t2.item_name_d,
- t2.item_name_t,
- max(decode('A1', t3.qlty_ope_cd, t3.qlty_val, null)) "J1",
- max(decode('A2', t3.qlty_ope_cd, t3.qlty_val, null)) "J2",
- max(decode('A3', t3.qlty_ope_cd, t3.qlty_val, null)) "J3"
- from tbb10_qlty_qcmval t3, qcm_jhy_sample_consign_d_item t2
- where t3.smp_no = t2.smp_no(+)
- and t3.specimen_no = t2.specimen_no(+)
- and t3.qlty_cd = t2.seq(+)
- and instr(? , t3.specimen_no) > 0
- and t3.qlty_cd_2 = 'HC'
- group by t3.smp_no,
- t3.specimen_no,
- t3.smp_no_type,
- t3.smp_cut_loc,
- t2.item_name_d,
- t2.item_name_t)
- select t.gyh, t2.grade_name, t.batch_no, t.material_thk, t3.*
- from jhy_weito_m t, qcm_jhy_sample_consign_m t2, t3
- where t.smp_no = t2.smp_no(+)
- and t.specimen_no = t3.specimen_no(+)
- and instr(? , t.specimen_no) > 0
- </query>
- <query id="JHY02_1.CALL" desc="原始数据保存">
- {call jhy02.save_work_val1(?,?,?,?,?,?,?,?,?,?,?,?,?)}
- </query>
- <query id="JHY02_2.CALL" desc="原始数据保存">
- {call jhy02.save_work_val2(?,?,?,?,?,?,?,?,?,?,?,?,?)}
- </query>
- <query id="JHY02_3.CALL" desc="原始数据保存">
- {call jhy02.save_work_val3(?,?,?,?,?,?,?,?,?,?,?,?,?)}
- </query>
- <query id="JHY02.UPDATE_SEND_FLAG" desc="修改发送状态">
- update jhy_weito_m t set t.send_flag = '1' where t.specimen_no = ?
- </query>
- </queryMap>
|