79: CURSOR c_active_hier( cp_bus_grp_id number
80: ,cp_hier_ver_id number
81: ,cp_eff_date date ) IS
82: select 1
83: from per_gen_hierarchy_versions
84: where business_group_id = cp_bus_grp_id
85: and hierarchy_version_id = cp_hier_ver_id
86: and cp_eff_date between date_from and nvl(date_to,cp_eff_date)
87: and status = 'A';
90: ,cp_node_type varchar2
91: ,cp_entity_id varchar2
92: ,cp_eff_date date ) IS
93: select 1
94: from per_gen_hierarchy_nodes pghn
95: ,per_gen_hierarchy_versions pghv
96: ,per_gen_hierarchy pgh
97: where pghn.business_group_id = cp_bus_grp_id
98: and pghn.node_type = cp_node_type
91: ,cp_entity_id varchar2
92: ,cp_eff_date date ) IS
93: select 1
94: from per_gen_hierarchy_nodes pghn
95: ,per_gen_hierarchy_versions pghv
96: ,per_gen_hierarchy pgh
97: where pghn.business_group_id = cp_bus_grp_id
98: and pghn.node_type = cp_node_type
99: and pghn.entity_id = cp_entity_id
92: ,cp_eff_date date ) IS
93: select 1
94: from per_gen_hierarchy_nodes pghn
95: ,per_gen_hierarchy_versions pghv
96: ,per_gen_hierarchy pgh
97: where pghn.business_group_id = cp_bus_grp_id
98: and pghn.node_type = cp_node_type
99: and pghn.entity_id = cp_entity_id
100: and pghv.business_group_id = cp_bus_grp_id
110: ,cp_node_type varchar2
111: ,cp_par_hier_node_id number
112: ,cp_entity_id varchar2 ) IS
113: select 1
114: from per_gen_hierarchy_nodes
115: where business_group_id = cp_bus_grp_id
116: and hierarchy_version_id = cp_hier_ver_id
117: and node_type = cp_node_type
118: and nvl(parent_hierarchy_node_id, -999) = nvl(cp_par_hier_node_id, -999)
302: --
303: -- CURSOR c_child_node_exists( cp_hier_node_id number
304: -- ,cp_ovn number) IS
305: -- select 1
306: -- from per_gen_hierarchy_nodes
307: -- where parent_hierarchy_node_id = cp_hier_node_id
308: -- and object_version_number = cp_ovn;
309: --
310: -- CURSOR c_get_node_value( cp_hier_node_id number
309: --
310: -- CURSOR c_get_node_value( cp_hier_node_id number
311: -- ,cp_ovn number) IS
312: -- select entity_id, node_type
313: -- from per_gen_hierarchy_nodes
314: -- where hierarchy_node_id = cp_hier_node_id
315: -- and object_version_number = cp_ovn;
316: --
317: -- CURSOR c_asg_loc_exists( cp_loc_id number ) IS
406: IS
407:
408: CURSOR c_get_node_val( cp_hier_node_id number ) IS
409: select business_group_id, hierarchy_version_id
410: from per_gen_hierarchy_nodes
411: where hierarchy_node_id = cp_hier_node_id;
412:
413: CURSOR c_active_hier( cp_bus_grp_id number
414: ,cp_hier_ver_id number
413: CURSOR c_active_hier( cp_bus_grp_id number
414: ,cp_hier_ver_id number
415: ,cp_eff_date date ) IS
416: select 1
417: from per_gen_hierarchy_versions
418: where business_group_id = cp_bus_grp_id
419: and hierarchy_version_id = cp_hier_ver_id
420: and cp_eff_date between date_from and nvl(date_to,cp_eff_date)
421: and status = 'A';
494:
495: CURSOR c_hier_status( cp_hier_ver_id number
496: ,cp_version_no number ) IS
497: select business_group_id, status
498: from per_gen_hierarchy_versions
499: where hierarchy_version_id = cp_hier_ver_id
500: and version_number = cp_version_no;
501:
502: CURSOR c_get_nodes( cp_bus_grp_id number
501:
502: CURSOR c_get_nodes( cp_bus_grp_id number
503: ,cp_hier_ver_id number) IS
504: select node_type, entity_id
505: from per_gen_hierarchy_nodes
506: where business_group_id = cp_bus_grp_id
507: and hierarchy_version_id = cp_hier_ver_id
508: and node_type in ( 'MX LEGAL EMPLOYER', 'MX GRE' );
509:
511: ,cp_node_type varchar2
512: ,cp_entity_id varchar2
513: ,cp_eff_date date ) IS
514: select 1
515: from per_gen_hierarchy_nodes pghn
516: ,per_gen_hierarchy_versions pghv
517: ,per_gen_hierarchy pgh
518: where pghn.business_group_id = cp_bus_grp_id
519: and pghn.node_type = cp_node_type
512: ,cp_entity_id varchar2
513: ,cp_eff_date date ) IS
514: select 1
515: from per_gen_hierarchy_nodes pghn
516: ,per_gen_hierarchy_versions pghv
517: ,per_gen_hierarchy pgh
518: where pghn.business_group_id = cp_bus_grp_id
519: and pghn.node_type = cp_node_type
520: and pghn.entity_id = cp_entity_id
513: ,cp_eff_date date ) IS
514: select 1
515: from per_gen_hierarchy_nodes pghn
516: ,per_gen_hierarchy_versions pghv
517: ,per_gen_hierarchy pgh
518: where pghn.business_group_id = cp_bus_grp_id
519: and pghn.node_type = cp_node_type
520: and pghn.entity_id = cp_entity_id
521: and pghv.business_group_id = cp_bus_grp_id