博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

主数据同步涉及到的表

Posted on 2012-12-10 14:00  奥客  阅读(599)  评论(0编辑  收藏  举报

以下是项目中将EBS中的数据导出,供其他系统使用。

注意:取出的数据都是 中文 环境下的数据。

1.组织主数据:

   使用的表:hr_all_organization_units、hr_locations_all 和 hr_locations_all_tl

   查询的sql:

  

  1. SELECT hou.organization_id, 
  2.              hou.name, 
  3.              la.location_code, 
  4.              la.country, 
  5.              la.address_line_1, 
  6.              la.address_line_2, 
  7.              hou.date_from, 
  8.              hou.date_to, 
  9.              hou.attribute1, 
  10.              hou.attribute2, 
  11.              hou.attribute3, 
  12.              hou.attribute4, 
  13.              hou.attribute5, 
  14.              hou.last_update_date, 
  15.              hou.last_updated_by, 
  16.              hou.last_update_login, 
  17.              hou.created_by, 
  18.              hou.creation_date 
  19.         FROM hr_locations_all          la, 
  20.              hr_all_organization_units hou, 
  21.              hr_locations_all_tl       lat 
  22.        WHERE hou.location_id = la.location_id(+) 
  23.          AND la.location_id = lat.location_id(+) 
  24.          AND lat.language(+) = 'ZHS'; 

 

2. 组织分类主数据:

    使用到的表:hr_organization_information和fnd_lookup_values

    查询的sql:

   

  1. SELECT info.org_information_id, 
  2.              info.organization_id, 
  3.              info.org_information1, 
  4.              flv.meaning org_information_meaning, 
  5.              info.org_information2, 
  6.              info.last_update_date, 
  7.              info.last_updated_by, 
  8.              info.last_update_login, 
  9.              info.created_by, 
  10.              info.creation_date 
  11.         FROM hr_organization_information info, fnd_lookup_values flv 
  12.        WHERE info.org_information1 = flv.lookup_code 
  13.          AND info.org_information_context = 'CLASS' 
  14.          AND flv.lookup_type = 'ORG_CLASS' 
  15.          AND flv.language = 'ZHS'

 

3. 单位主数据:

    使用到的表:mtl_units_of_measure_tl

    使用到的sql:

    

  1. SELECT uom.unit_of_measure , 
  2.              uom.uom_code, 
  3.              uom.uom_class, 
  4.              uom.base_uom_flag, 
  5.              uom.unit_of_measure_tl, 
  6.              uom.disable_date, 
  7.              uom.description, 
  8.              uom.last_update_date, 
  9.              uom.last_updated_by, 
  10.              uom.created_by, 
  11.              uom.creation_date, 
  12.              uom.last_update_login 
  13.         FROM mtl_units_of_measure_tl uom 
  14.        WHERE uom.language = 'ZHS'

 

4.  单位换算关系:

     使用到的表: mtl_uom_conversions

     使用到的sql:

    

  1. SELECT cov.uom_code uom_code, 
  2.        cov.inventory_item_id inventory_item_id, 
  3.        cov.unit_of_measure unit_of_measure, 
  4.        cov.uom_class uom_class, 
  5.        base_uom.uom_code base_uom_code, 
  6.        base_uom.unit_of_measure base_unit_of_measure, 
  7.        cov.conversion_rate conversion_rate, 
  8.        cov.disable_date disable_date, 
  9.        cov.last_update_date last_update_date, 
  10.        cov.last_updated_by last_updated_by, 
  11.        cov.created_by created_by, 
  12.        cov.creation_date creation_date, 
  13.        cov.last_update_login last_update_login 
  14.   FROM mtl_uom_conversions cov, 
  15.        (SELECT uom.uom_class, uom.uom_code, uom.unit_of_measure 
  16.           FROM mtl_units_of_measure_tl uom 
  17.          WHERE uom.language = 'ZHS' 
  18.            AND uom.base_uom_flag = 'Y' 
  19.          GROUP BY uom.uom_class, 
  20.                   uom.uom_code, 
  21.                   uom.unit_of_measure, 
  22.                   uom.base_uom_flag) base_uom 
  23. WHERE cov.uom_class = base_uom.uom_class; 

 

5. 销售员主数据:

    使用到的表:jtf_rs_resource_extns、jtf_rs_resource_extns_tl、jtf_objects_b、jtf_objects_tl 和 fnd_application_vl

    使用到的sql:

   

  1. SELECT rs.resource_id       resource_id, 
  2.        rs.category          category_code, 
  3.        obt.name             category_meaning, 
  4.        rs.resource_number   resource_number, 
  5.        rst.resource_name    resource_name, 
  6.        rs.source_id         source_id, 
  7.        rs.start_date_active start_date_active, 
  8.        rs.end_date_active   end_date_active, 
  9.        rs.last_update_date  last_update_date, 
  10.        rs.last_updated_by   last_updated_by, 
  11.        rs.created_by        created_by, 
  12.        rs.creation_date     creation_date, 
  13.        rs.last_update_login last_update_login 
  14.   FROM jtf_rs_resource_extns    rs, 
  15.        jtf_rs_resource_extns_tl rst, 
  16.        jtf_objects_b            ob, 
  17.        jtf_objects_tl           obt, 
  18.        fnd_application_vl       fav 
  19. WHERE rs.resource_id = rst.resource_id 
  20.    AND rst.language = 'ZHS' 
  21.    AND ob.object_code = obt.object_code 
  22.    AND rs.category = ob.object_code 
  23.    AND obt.language = 'ZHS' 
  24.    AND fav.APPLICATION_ID = ob.application_id(+) 
  25.    AND fav.APPLICATION_SHORT_NAME = 'JTF' 
  26.    AND rs.category = 'EMPLOYEE'

 

6. 采购员主数据:

   使用到的表:po_agents、hr_employees、po_ship_to_loc_org_v 和 mtl_categories_kfv

   使用到的sql:

  

  1. SELECT pa.agent_id buyer_id, 
  2.        pa.category_id category_id, 
  3.        pa.location_id location_id, 
  4.        he.full_name buyer_name, 
  5.        ca.concatenated_segments categoay_name, 
  6.        psv.LOCATION_CODE location_code, 
  7.        pa.start_date_active start_date_active, 
  8.        pa.end_date_active end_date_active, 
  9.        pa.last_update_date last_update_date, 
  10.        pa.last_updated_by last_updated_by, 
  11.        pa.created_by created_by, 
  12.        pa.creation_date creation_date, 
  13.        pa.last_update_login last_update_login 
  14.   FROM po_agents            pa, 
  15.        hr_employees         he, 
  16.        po_ship_to_loc_org_v psv, 
  17.        mtl_categories_kfv   ca 
  18. WHERE pa.agent_id = he.employee_id 
  19.    AND pa.location_id = psv.LOCATION_ID(+) 
  20.    AND PA.CATEGORY_ID = ca.category_id(+); 

 

7. 国家(地区)主数据:

    使用到的表:fnd_territories_tl 和 fnd_territories

    使用到的sql:

   

  1. SELECT b.territory_code territory_code, 
  2.        t.territory_short_name territory_short_name, 
  3.        t.description description, 
  4.        b.alternate_territory_code alternate_territory_code, 
  5.        b.address_style address_style, 
  6.        b.last_update_date last_update_date, 
  7.        b.last_updated_by last_updated_by, 
  8.        b.creation_date creation_date, 
  9.        b.created_by created_by, 
  10.        b.last_update_login  last_update_login 
  11.        FROM fnd_territories_tl t, fnd_territories b 
  12. WHERE B.TERRITORY_CODE = T.TERRITORY_CODE 
  13.    AND t.language = 'ZHS'

 

 

8. 员工主数据:

    使用到的表:per_all_people_f

    使用到的sql:

  

  1. SELECT per.person_id person_id, -- 员工id 
  2.              per.effective_start_date effective_start_date, --任职日期自 
  3.              per.effective_end_date effective_end_date, --任职日期至 
  4.              per.last_name last_name, --员工姓名  
  5.              per.employee_number employee_number, --员工编号 
  6.              DECODE(per.sex, 'M', '男', 'F', '女', NULL) gender, --性别 
  7.              per.work_telephone work_telephone, --工作电话  
  8.              per.email_address email_address, --email地址 
  9.              per.last_update_date last_update_date, 
  10.              per.last_updated_by last_updated_by, 
  11.              per.created_by created_by, 
  12.              per.creation_date creation_date, 
  13.              per.last_update_login 
  14.         FROM per_all_people_f per 

 

9. 员工分配主数据:

   使用到的表:per_all_assignments_f、per_jobs、per_jobs_tl、per_all_positions 和 hr_all_positions_f_tl

   使用到的sql:

  

  1. SELECT ass.assignment_id        assignment_id, --员工分配id 
  2.             ass.effective_start_date effective_start_date, --任职日期自 
  3.             ass.effective_end_date   effective_end_date, --任职日期至 
  4.             ass.person_id            person_id, --员工id  
  5.             ass.assignment_number    assignment_number, --员工分配编号 
  6.             ass.job_id               job_id, --职务id                      
  7.             t.name                   job_name, --职务名称 
  8.             ass.position_id          position_id, --职位id 
  9.             ht.name                  position_name, --职位名称 
  10.             ass.supervisor_id        supervisor_id, --上级主管员工id 
  11.             ass.organization_id      organization_id, --组织id, 
  12.             ass.last_update_date     last_update_date, 
  13.             ass.last_updated_by      last_updated_by, 
  14.             ass.created_by           created_by, 
  15.             ass.creation_date        creation_date, 
  16.             ass.last_update_login    last_update_login 
  17.        FROM per_all_assignments_f ass, --员工分配表 
  18.             per_jobs              b, --员工职务 
  19.             per_jobs_tl           t, --员工职务多语言表 
  20.             per_all_positions     pb, --员工职位表 
  21.             hr_all_positions_f_tl ht --员工职位多语言表 
  22.       WHERE ass.job_id = b.job_id(+) 
  23.         AND b.job_id = t.job_id(+) 
  24.         AND t.language(+) = 'ZHS' 
  25.         AND ass.position_id = pb.position_id(+) 
  26.         AND pb.position_id = ht.position_id(+) 
  27.         AND ht.language(+) = 'ZHS'