standardisation

This commit is contained in:
Deepthi
2021-04-01 14:15:45 +05:30
parent 1c1e8da68e
commit 37f73d5dfd
17 changed files with 1437 additions and 196 deletions

View File

@@ -15,11 +15,11 @@ Updation Date:
Author: compegence team
Function Call: select mmt_staging2.fn_BUDNI_ARC_ODS()
***************************************************************/
delete from mmt_ods.test_instance_engine_info where test_file_ref_no=273;
delete from mmt_ods.test_instance_tractor_info where test_file_ref_no=273;
delete from mmt_ods.budni_air_cleaner_perf_results where test_file_ref_no=273;
delete from mmt_ods.budni_test_observations where test_file_ref_no=273;
delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_ARC';
delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_ARC';
delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_ARC';
delete from mmt_ods.budni_air_cleaner_perf_results where test_file_sheet_format='BUDNI_ARC';
delete from mmt_ods.budni_test_observations where test_file_sheet_format='BUDNI_ARC';
SET search_path TO mmt_staging2;
@@ -153,7 +153,7 @@ test_file_format,
test_file_sheet_format,
tractor_make,
tractor_model,
srl_no,
sequence_number,
characteristic,
category_evaluative_or_non_evaluative,
requirements_as_per_is_12207_2008,
@@ -168,7 +168,7 @@ file_syspk,
file_format,
sheet_mnemonic,
make,model,
column3,
column3::int,
column4,
column5,
column6,

View File

@@ -0,0 +1,462 @@
drop function if exists mmt_staging2.fn_BUDNI_BRK_ODS;
CREATE OR REPLACE FUNCTION mmt_staging2.fn_BUDNI_BRK_ODS()
RETURNS void AS $$
declare __test_instance_id int;
declare __file_syspk int;
begin
/************************************************************
Function Name:fn_BUDNI_BRK_ODS
Function Desc: This function populates data into ODS
File Format: BUDNI
Sheet Format: BUDNI_BRK
Creation Date:
Updation Date:
Author: compegence team
Function Call: select mmt_staging2.fn_BUDNI_BRK_ODS()
***************************************************************/
delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_BRK';
delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_BRK';
delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_BRK';
delete from mmt_ods.budni_brake_perf_parking_brake_test_results
where test_file_sheet_format='BUDNI_BRK';
delete from mmt_ods.budni_brake_perf_service_brake_test_results
where test_file_sheet_format='BUDNI_BRK';
delete from mmt_ods.budni_test_observations
where test_file_sheet_format='BUDNI_BRK';
SET search_path TO mmt_staging2;
insert into mmt_ods.test_instance_tractor_info
(
client_id,
function_id,
test_file_ref_no,
test_file_format,
test_file_sheet_format,
tractor_make,
tractor_model,
tractor_engine_hp,
brake_type,
brake_free_play_lh,
brake_free_play_rh,
unballasted_max_speed_kmph,
road_ballasted_max_speed_kmph
)
select
client_id,
function_id,
file_syspk,
file_format,
sheet_mnemonic,
make,
model,
tractor_HP::numeric tractor_engine_hp,
Type_of_brake,
brake_free_play_lh::numeric ,
brake_free_play_rh::numeric ,
maximum_attainable_speed_kmph_unballasted::numeric ,
maximum_attainable_speed_kmph_ballasted::numeric
from mmt_staging2.BUDNI_BRK_Spec_H1_block;
insert into mmt_ods.test_instance
(
client_id,
function_id,
test_file_ref_no,
test_file_format,
test_file_sheet_format,
tractor_make,
tractor_model,
type_of_road
)
select
client_id,
function_id,
file_syspk,
file_format,
sheet_mnemonic,
make,model,
type_of_track
from
mmt_staging2.BUDNI_BRK_Spec_H1_block;
insert into mmt_ods.test_instance_engine_info
(
client_id,
function_id,
test_file_ref_no,
test_file_format,
test_file_sheet_format,
tractor_make,
tractor_model,
rated_rpm
)
select
client_id,
function_id,
file_syspk,
file_format,
sheet_mnemonic,
make,model,
rated_rpm::int
from mmt_staging2.BUDNI_BRK_Spec_H1_block;
/*block */
insert into mmt_ods.budni_brake_perf_service_brake_test_results
(
client_id,
function_id,
test_file_ref_no,
test_file_format,
test_file_sheet_format,
tractor_make,
tractor_model,
brake_test_type,
brake_test_name,
speed_condition,
ballast_condition,
braking_device_control_force_n,
mean_deceleration_msec2,
stopping_dist_m
)
select
client_id,
function_id,
file_syspk,
file_format,
sheet_mnemonic,
make,model,
brake_test_type,
brake_test_name,
speed_condition,
ballast_condition,
Braking_device_control_force_N::numeric ,
Mean_deceleration_m_sec2::numeric ,
Stopping_distance_m ::numeric
from mmt_staging2.budni_brk_service_cold_ballasted_25kmph_block;
insert into mmt_ods.budni_brake_perf_service_brake_test_results
(
client_id,
function_id,
test_file_ref_no,
test_file_format,
test_file_sheet_format,
tractor_make,
tractor_model,
brake_test_type,
brake_test_name,
speed_condition,
ballast_condition,
braking_device_control_force_n,
mean_deceleration_msec2,
stopping_dist_m
)
select
client_id,
function_id,
file_syspk,
file_format,
sheet_mnemonic,
make,model,
brake_test_type,
brake_test_name,
speed_condition,
ballast_condition,
Braking_device_control_force_N::numeric ,
Mean_deceleration_m_sec2::numeric ,
Stopping_distance_m ::numeric
from mmt_staging2.budni_brk_service_cold_ballasted_maximum_block;
insert into mmt_ods.budni_brake_perf_service_brake_test_results
(
client_id,
function_id,
test_file_ref_no,
test_file_format,
test_file_sheet_format,
tractor_make,
tractor_model,
brake_test_type,
brake_test_name,
speed_condition,
ballast_condition,
braking_device_control_force_n,
mean_deceleration_msec2,
stopping_dist_m
)
select
client_id,
function_id,
file_syspk,
file_format,
sheet_mnemonic,
make,model,
brake_test_type,
brake_test_name,
speed_condition,
ballast_condition,
Braking_device_control_force_N::numeric ,
Mean_deceleration_m_sec2::numeric ,
Stopping_distance_m ::numeric
from mmt_staging2.budni_brk_service_cold_standard_25kmph_block;
insert into mmt_ods.budni_brake_perf_service_brake_test_results
(
client_id,
function_id,
test_file_ref_no,
test_file_format,
test_file_sheet_format,
tractor_make,
tractor_model,
brake_test_type,
brake_test_name,
speed_condition,
ballast_condition,
braking_device_control_force_n,
mean_deceleration_msec2,
stopping_dist_m
)
select
client_id,
function_id,
file_syspk,
file_format,
sheet_mnemonic,
make,model,
brake_test_type,
brake_test_name,
speed_condition,
ballast_condition,
Braking_device_control_force_N::numeric ,
Mean_deceleration_m_sec2::numeric ,
Stopping_distance_m ::numeric
from mmt_staging2.budni_brk_service_cold_standard_maximum_block;
insert into mmt_ods.budni_brake_perf_service_brake_test_results
(
client_id,
function_id,
test_file_ref_no,
test_file_format,
test_file_sheet_format,
tractor_make,
tractor_model,
brake_test_type,
brake_test_name,
speed_condition,
ballast_condition,
braking_device_control_force_n,
mean_deceleration_msec2,
stopping_dist_m
)
select
client_id,
function_id,
file_syspk,
file_format,
sheet_mnemonic,
make,model,
brake_test_type,
brake_test_name,
speed_condition,
ballast_condition,
Braking_device_control_force_N::numeric ,
Mean_deceleration_m_sec2::numeric ,
Stopping_distance_m ::numeric
from mmt_staging2.budni_brk_service_fade_standard_maximum_block;
insert into mmt_ods.budni_brake_perf_service_brake_test_results
(
client_id,
function_id,
test_file_ref_no,
test_file_format,
test_file_sheet_format,
tractor_make,
tractor_model,
brake_test_type,
brake_test_name,
speed_condition,
ballast_condition,
braking_device_control_force_n,
mean_deceleration_msec2,
stopping_dist_m
)
select
client_id,
function_id,
file_syspk,
file_format,
sheet_mnemonic,
make,model,
brake_test_type,
brake_test_name,
speed_condition,
ballast_condition,
Braking_device_control_force_N::numeric ,
Mean_deceleration_m_sec2::numeric ,
Stopping_distance_m ::numeric
from mmt_staging2.budni_brk_service_fade_ballasted_25kmph_block;
update mmt_ods.budni_brake_perf_service_brake_test_results
set max_dev_of_tractor_from_its_org_course_m =column3,
abnormal_vibration=column5,
the_brakes_were_heated_by =column7
from mmt_staging2.budni_brk_other_observations_Block where ods_record =1;
insert into mmt_ods.budni_brake_perf_parking_brake_test_results
(
client_id,
function_id,
test_file_ref_no,
test_file_format,
test_file_sheet_format,
tractor_make,
tractor_model,
test_condition
)
select
client_id,
function_id,
file_syspk,
file_format,
sheet_mnemonic,
make,model,
particulars
from mmt_staging2.budni_brk_parking_barke_test_block where particulars is not null;
update mmt_ods.budni_brake_perf_parking_brake_test_results
set braking_device_control_force_n_facing_up = (select
Braking_device_control_force::numeric
from mmt_staging2.budni_brk_parking_barke_test_block
where facing='Facing up' and particulars='18 percent slope')
where test_condition='18 percent slope';
update mmt_ods.budni_brake_perf_parking_brake_test_results
set braking_device_control_force_n_facing_down = (select
Braking_device_control_force::numeric
from mmt_staging2.budni_brk_parking_barke_test_block
where facing='Facing Down' and particulars='18 percent slope')
where test_condition='18 percent slope';
update mmt_ods.budni_brake_perf_parking_brake_test_results
set efficacy_of_parking_brake_facing_down = (select
Efficacy_of_parking_brake
from mmt_staging2.budni_brk_parking_barke_test_block
where facing='Facing Down' and particulars='18 percent slope')
where test_condition='18 percent slope';
update mmt_ods.budni_brake_perf_parking_brake_test_results
set efficacy_of_parking_brake_facing_up = (select
Efficacy_of_parking_brake
from mmt_staging2.budni_brk_parking_barke_test_block
where facing='Facing up' and particulars='18 percent slope')
where test_condition='18 percent slope';
update mmt_ods.budni_brake_perf_parking_brake_test_results
set braking_device_control_force_n_facing_up = (select
Braking_device_control_force::numeric
from mmt_staging2.budni_brk_parking_barke_test_block
where facing='Facing up' and particulars='12 percent slope with trailer of 2.55 tonnes.')
where test_condition='12 percent slope with trailer of 2.55 tonnes.';
update mmt_ods.budni_brake_perf_parking_brake_test_results
set braking_device_control_force_n_facing_down = (select
Braking_device_control_force::numeric
from mmt_staging2.budni_brk_parking_barke_test_block
where facing='Facing Down' and particulars='12 percent slope with trailer of 2.55 tonnes.')
where test_condition='12 percent slope with trailer of 2.55 tonnes.';
update mmt_ods.budni_brake_perf_parking_brake_test_results
set efficacy_of_parking_brake_facing_down = (select
Efficacy_of_parking_brake
from mmt_staging2.budni_brk_parking_barke_test_block
where facing='Facing Down' and particulars='12 percent slope with trailer of 2.55 tonnes.')
where test_condition='12 percent slope with trailer of 2.55 tonnes.';
update mmt_ods.budni_brake_perf_parking_brake_test_results
set efficacy_of_parking_brake_facing_up = (select
Efficacy_of_parking_brake
from mmt_staging2.budni_brk_parking_barke_test_block
where facing='Facing up' and particulars='12 percent slope with trailer of 2.55 tonnes.')
where test_condition='12 percent slope with trailer of 2.55 tonnes.';
delete from mmt_ods.budni_brake_perf_parking_brake_test_results a
using mmt_ods.budni_brake_perf_parking_brake_test_results b
where a.syspk < b.syspk and a.test_condition =b.test_condition ;
insert into mmt_ods.budni_test_observations
(
client_id,
function_id,
test_file_ref_no,
test_file_format,
test_file_sheet_format,
tractor_make,
tractor_model,
characteristic,
category_evaluative_or_non_evaluative,
requirements_as_per_is_12207_2008,
values_declared_by_the_applicant_d_rqmt,
as_observed,
whether_meets_the_requirements_yn
)
select
client_id,
function_id,
file_syspk,
file_format,
sheet_mnemonic,
make,model,
column3,
column4,
column5,
column6,
column7,
column8
from mmt_staging2.BUDNI_BRK_test_obs_summary_block where ods_record=1;
select file_syspk into __file_syspk from mmt_staging2.BUDNI_BRK_Spec_H1_block;
select syspk into __test_instance_id from mmt_ods.test_instance where test_file_ref_no =__file_syspk;
update mmt_ods.test_instance_engine_info
set test_instance_id=__test_instance_id
where test_file_ref_no=__file_syspk;
update mmt_ods.test_instance_tractor_info
set test_instance_id=__test_instance_id
where test_file_ref_no=__file_syspk;
update mmt_ods.budni_brake_perf_parking_brake_test_results
set test_instance_id=__test_instance_id
where test_file_ref_no=__file_syspk;
update mmt_ods.budni_brake_perf_service_brake_test_results
set test_instance_id=__test_instance_id
where test_file_ref_no=__file_syspk;
update mmt_ods.budni_test_observations
set test_instance_id=__test_instance_id
where test_file_ref_no=__file_syspk;
end
$$ LANGUAGE plpgsql;

View File

@@ -15,10 +15,10 @@ Updation Date:
Author: compegence team
Function Call: select mmt_staging2.fn_BUDNI_DBP_ODS()
***************************************************************/
delete from mmt_ods.test_instance_engine_info where test_file_ref_no=261;
delete from mmt_ods.test_instance_tractor_info where test_file_ref_no=261;
delete from mmt_ods.budni_drawbar_perf_results where test_file_ref_no=261;
delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_DBP';
delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_DBP';
delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_DBP';
delete from mmt_ods.budni_drawbar_perf_results where test_file_sheet_format='BUDNI_DBP';
insert into mmt_ods.test_instance_tractor_info
(

View File

@@ -16,15 +16,17 @@ Author: compegence team
Function Call: select mmt_staging2.fn_BUDNI_FLD_ODS()
***************************************************************/
delete from mmt_ods.test_instance_engine_info where test_file_ref_no=261;
delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_FLD';
delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_FLD';
delete from mmt_ods.test_instance_tractor_info where test_file_ref_no=261;
delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_FLD';
delete from mmt_ods.test_instance_implement_info where test_file_ref_no=261;
delete from mmt_ods.test_instance_implement_info where test_file_sheet_format='BUDNI_FLD';
delete from mmt_ods.budni_field_perf_results where test_file_ref_no=261;
delete from mmt_ods.budni_field_perf_results where test_file_sheet_format='BUDNI_FLD';
delete from mmt_ods.budni_test_observations where test_file_ref_no=261;
delete from mmt_ods.budni_test_observations where test_file_sheet_format='BUDNI_FLD';
insert into mmt_ods.test_instance_tractor_info
(

View File

@@ -16,19 +16,29 @@ Author: compegence team
Function Call: select mmt_staging2.fn_BUDNI_HDL_ODS()
***************************************************************/
delete from mmt_ods.test_instance_engine_info where test_file_ref_no=261;
delete from mmt_ods.test_instance
where test_file_sheet_format='BUDNI_HDL';
delete from mmt_ods.test_instance_tractor_info where test_file_ref_no=261;
delete from mmt_ods.test_instance_engine_info
where test_file_sheet_format='BUDNI_HDL';
delete from mmt_ods.test_instance_tractor_info_misc where test_file_ref_no=261;
delete from mmt_ods.test_instance_tractor_info
where test_file_sheet_format='BUDNI_HDL';
delete from mmt_ods.budni_hydraulic_maint_of_lift_load_results where test_file_ref_no=261;
delete from mmt_ods.test_instance_tractor_info_misc
where test_file_sheet_format='BUDNI_HDL';
delete from mmt_ods.budni_hydraulic_power_test_results where test_file_ref_no=261;
delete from mmt_ods.budni_hydraulic_maint_of_lift_load_results
where test_file_sheet_format='BUDNI_HDL';
delete from mmt_ods.budni_hydraulic_lifting_capacity_test_results where test_file_ref_no=261;
delete from mmt_ods.budni_hydraulic_power_test_results
where test_file_sheet_format='BUDNI_HDL';
delete from mmt_ods.budni_test_observations where test_file_ref_no=261;
delete from mmt_ods.budni_hydraulic_lifting_capacity_test_results
where test_file_sheet_format='BUDNI_HDL';
delete from mmt_ods.budni_test_observations
where test_file_sheet_format='BUDNI_HDL';
insert into mmt_ods.test_instance_tractor_info

View File

@@ -15,16 +15,16 @@ Updation Date:
Author: compegence team
Function Call: select mmt_staging2.fn_BUDNI_HLG_ODS()
***************************************************************/
delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_HLG';
delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_HLG';
delete from mmt_ods.test_instance_engine_info where test_file_ref_no=261;
delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_HLG';
delete from mmt_ods.budni_haulage_perf_results where test_file_sheet_format='BUDNI_HLG';
delete from mmt_ods.test_instance_tractor_info where test_file_ref_no=261;
delete from mmt_ods.budni_haulage_perf_results where test_file_ref_no=261;
delete from mmt_ods.budni_test_observations where test_file_ref_no=261;
delete from mmt_ods.budni_test_observations where test_file_sheet_format='BUDNI_HLG';
insert into mmt_ods.test_instance_tractor_info
@@ -160,7 +160,7 @@ test_file_format,
test_file_sheet_format,
tractor_make,
tractor_model,
srl_no,
sequence_number ,
characteristic,
category_evaluative_or_non_evaluative,
requirements_as_per_is_12207_2008,
@@ -175,7 +175,7 @@ file_syspk,
file_format,
sheet_mnemonic,
make,model,
column3,
column3::numeric ,
column4,
column5,
column6,

View File

@@ -16,13 +16,13 @@ Author: compegence team
Function Call: select mmt_staging2.fn_BUDNI_LCG_ODS()
***************************************************************/
delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_LCG';
delete from mmt_ods.test_instance_engine_info where test_file_ref_no=261;
delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_LCG';
delete from mmt_ods.test_instance_tractor_info where test_file_ref_no=261;
delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_LCG';
delete from mmt_ods.budni_centre_of_gravity_location where test_file_ref_no=261;
delete from mmt_ods.budni_centre_of_gravity_location where test_file_ref_no =261;

View File

@@ -17,19 +17,18 @@ Author: compegence team
Function Call: select mmt_staging2.fn_BUDNI_NMT_ODS()
***************************************************************/
delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_NMT';
delete from mmt_ods.test_instance_engine_info where test_file_ref_no=261;
delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_NMT';
delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_NMT';
delete from mmt_ods.test_instance_tractor_info where test_file_ref_no=261;
delete from mmt_ods.budni_noise_atmospheric_conditions where test_file_sheet_format='BUDNI_NMT';
delete from mmt_ods.budni_noise_atmospheric_conditions where test_file_ref_no=261;
delete from mmt_ods.budni_noise_measurement_results where test_file_sheet_format='BUDNI_NMT';
delete from mmt_ods.budni_noise_measurement_results where test_file_ref_no=261;
delete from mmt_ods.budni_test_observations where test_file_ref_no=261;
delete from mmt_ods.budni_test_observations where test_file_sheet_format='BUDNI_NMT';
@@ -252,7 +251,7 @@ test_file_format,
test_file_sheet_format,
tractor_make,
tractor_model,
srl_no,
sequence_number,
characteristic,
category_evaluative_or_non_evaluative,
requirements_as_per_is_12207_2008,
@@ -267,7 +266,7 @@ file_syspk,
file_format,
sheet_mnemonic,
make,model,
column3,
column3::numeric,
column4,
column5,
column6,

View File

@@ -16,16 +16,17 @@ Author: compegence team
Function Call: select mmt_staging2.fn_BUDNI_PTO_ODS()
***************************************************************/
delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_PTO';
delete from mmt_ods.test_instance_engine_info where test_file_ref_no=261;
delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_PTO';
delete from mmt_ods.test_instance_tractor_info where test_file_ref_no=261;
delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_PTO';
delete from mmt_ods.budni_pto_perf_results_summary where test_file_ref_no=261;
delete from mmt_ods.budni_pto_perf_results_summary where test_file_sheet_format='BUDNI_PTO';
delete from mmt_ods.budni_test_observations where test_file_ref_no=261;
delete from mmt_ods.budni_test_observations where test_file_sheet_format='BUDNI_PTO';
delete from mmt_ods.budni_pto_perf_results_details where test_file_ref_no=261;
delete from mmt_ods.budni_pto_perf_results_details where test_file_sheet_format='BUDNI_PTO';
insert into mmt_ods.test_instance_tractor_info
(

View File

@@ -16,15 +16,16 @@ Author: compegence team
Function Call: select mmt_staging2.fn_BUDNI_VMT_ODS()
***************************************************************/
delete from mmt_ods.test_instance where test_file_sheet_format='BUDNI_VMT';
delete from mmt_ods.test_instance_engine_info where test_file_ref_no=261;
delete from mmt_ods.test_instance_engine_info where test_file_sheet_format='BUDNI_VMT';
delete from mmt_ods.test_instance_tractor_info where test_file_ref_no=261;
delete from mmt_ods.test_instance_tractor_info where test_file_sheet_format='BUDNI_VMT';
delete from mmt_ods.budni_vibration_measurements where test_file_ref_no=261;
delete from mmt_ods.budni_vibration_measurement where test_file_sheet_format='BUDNI_VMT';
delete from mmt_ods.budni_test_observations where test_file_ref_no=261;
delete from mmt_ods.budni_test_observations where test_file_sheet_format='BUDNI_VMT';
insert into mmt_ods.test_instance_tractor_info
@@ -144,7 +145,7 @@ test_file_format,
test_file_sheet_format,
tractor_make,
tractor_model,
sequence_number,
srl_no,
characteristic,
category_evaluative_or_non_evaluative,
requirements_as_per_is_12207_2008,