This commit is contained in:
dheepa
2021-08-09 11:14:23 +00:00
parent a0d3257be0
commit f3cf5e1d2d
89 changed files with 4769 additions and 1508 deletions

View File

@@ -165,7 +165,7 @@ from staging2.stg_specific_table_IHTNST_NST a
join transactional.source_config b
on a.row_number >=row_number_start
and (a.row_number< row_read_end or row_read_end is null)
and f1_modified=''BY STANDERS NOISE''
and f1_modified=''BY STANDERS NOISE''
and b.file_mnemonic='''||p_file_mnemonic||''' and b.file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
execute 'insert into staging2.stg_process_table_IHTNST_NST
@@ -248,6 +248,7 @@ file_syspk='||p_file_syspk||',
file_mnemonic='''||p_file_mnemonic||''',
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
insert into staging2.IHTNST_NST_H1_Block
(
dummy_f,
@@ -255,6 +256,8 @@ Test_Request_no,
Sample_Receipt_Date,
Test_report_No,
Tractor_Model,
tractor_power_hp,
variant,
Generation,
Customer_Name,
Test_Engineer,
@@ -263,6 +266,8 @@ No_of_Sample,
Test_Start_Date,
Test_End_Date,
Tractor_Sr_No,
drive,
platform,
Test_Facility,
Operator_Name,
Project_Group,
@@ -277,10 +282,9 @@ FROM crosstab(
, row_number() OVER ()
, unnest(ARRAY[c2::text]) AS val
FROM staging2.IHTNST_NST_H1_INT
ORDER BY generate_series(1,15),2'
ORDER BY generate_series(1,23),2'
) t (col text,a_1 text,a_2 text,a_3 text,a_4 text,a_5 text,a_6 text,a_7 text,a_8 text,
a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text,a_19 text);
a_9 text,a_10 text,a_11 text,a_12 text,a_13 text,a_14 text,a_15 text,a_16 text,a_17 text,a_18 text,a_19 text,a_20 text,a_21 text,a_22 text,a_23 text);
delete from staging2.IHTNST_NST_H1_Block where dummy_f is null ;
update staging2.IHTNST_NST_H1_Block set model=__model;
@@ -583,7 +587,7 @@ where block_tag='IHTNST_NST_STAND_Noise'
order by block_row_number;
update staging2.IHTNST_NST_STAND_Noise_Block
set column2=column3 where column4 is null and block_row_number in (2,6);
set column2=column3 where column4 is null and column3 like 'Mode%';
update staging2.IHTNST_NST_STAND_Noise_Block
set column1=column3 where column4 is null and block_row_number =1;
@@ -612,8 +616,20 @@ sum(case when column2 is null then 0 else 1 end) over (order by block_row_number
ORDER BY block_row_number ASC
) as q) b where a.block_row_number = b.block_row_number;
update staging2.IHTNST_NST_STAND_Noise_Block
set trx_record=0 where block_row_number <>5;
update staging2.IHTNST_NST_STAND_Noise_Block
set trx_record=0;
update staging2.IHTNST_NST_STAND_Noise_Block
set trx_record=1 where
column3 is not null and
column4 is not null and
column5 is not null and
column6 is not null and
column7 is not null and
column8 is not null and
column9 is not null
;
update staging2.IHTNST_NST_STAND_Noise_Block
set remarks=(select column3
@@ -637,6 +653,13 @@ where lower(column7)='acceptance criteria'
and block_tag='IHTNST_NST_STAND_Noise'
));
update staging2.IHTNST_NST_OEL_Noise_Block
set trx_record = 0
where column3 = 'Remarks';
update staging2.IHTNST_NST_STAND_Noise_Block set model=__model;
execute 'update staging2.IHTNST_NST_STAND_Noise_Block set
client_id='||p_client_id||',
@@ -666,7 +689,7 @@ where block_tag='IHTNST_NST_OEL_Noise'
order by block_row_number;
update staging2.IHTNST_NST_OEL_Noise_Block
set column2=column3 where column4 is null and block_row_number in (2,8,14);
set column2=column3 where column4 is null and column3 like 'Mode%';
update staging2.IHTNST_NST_OEL_Noise_Block
set column1=column3 where column4 is null and block_row_number =1;
@@ -695,8 +718,19 @@ sum(case when column2 is null then 0 else 1 end) over (order by block_row_number
ORDER BY block_row_number ASC
) as q) b where a.block_row_number = b.block_row_number;
update staging2.IHTNST_NST_OEL_Noise_Block
set trx_record=0 where block_row_number in (1,2,3,4,8,9,10,14,15,16,17,18);
set trx_record=0;
update staging2.IHTNST_NST_OEL_Noise_Block
set trx_record=1 where
column5 is not null and
column6 is not null
;
update staging2.IHTNST_NST_OEL_Noise_Block
set trx_record=0 where column4 like 'L%';
update staging2.IHTNST_NST_OEL_Noise_Block
set remarks=(select column3
@@ -728,6 +762,18 @@ file_syspk='||p_file_syspk||',
file_mnemonic='''||p_file_mnemonic||''',
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
update staging2.IHTNST_NST_OEL_Noise_Block
set trx_record = 0
where column3 = 'Remarks';
update staging2.IHTNST_NST_OEL_Noise_Block
set trx_record = 0
where block_row_number =
(select block_row_number+1 from staging2.IHTNST_NST_OEL_Noise_Block where column3 = 'Remarks' );
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTNST_NST_OEL_Noise_Block');
/*block starts - IHTNST_NST_OEL_Noise_Block */
@@ -748,7 +794,7 @@ where block_tag='IHTNST_NST_OEL_Noise_Load'
order by block_row_number;
update staging2.IHTNST_NST_OEL_Noise_Load_Block
set column2=column3 where column4 is null and block_row_number in (2,5,11);
set column2=column3 where column4 is null and column3 like 'Mode%';
update staging2.IHTNST_NST_OEL_Noise_Load_Block
set column1=column3 where column4 is null and block_row_number =1;
@@ -778,7 +824,16 @@ ORDER BY block_row_number ASC
) as q) b where a.block_row_number = b.block_row_number;
update staging2.IHTNST_NST_OEL_Noise_Load_Block
set trx_record=0 where block_row_number not in (8,9,10,14,15,16);
set trx_record=0;
update staging2.IHTNST_NST_OEL_Noise_Load_Block
set trx_record=1 where
column5 is not null and
column6 is not null and
column7 is not null and
column8 is not null and
column9 is not null
;
update staging2.IHTNST_NST_OEL_Noise_Load_Block
set remarks=(select column3
@@ -810,6 +865,17 @@ file_syspk='||p_file_syspk||',
file_mnemonic='''||p_file_mnemonic||''',
file_sheet_mnemonic='''||p_file_sheet_mnemonic||'''';
update staging2.IHTNST_NST_OEL_Noise_Load_Block
set trx_record = 0
where column3 = 'Remarks';
update staging2.IHTNST_NST_OEL_Noise_Load_Block
set trx_record = 0
where block_row_number =
(select block_row_number+1 from staging2.IHTNST_NST_OEL_Noise_load_Block where column3 = 'Remarks' );
perform fw_core.fn_jobctl_block_end(__file_syspk,'IHTNST_NST_OEL_Noise_Load_Block');