organization --form 表单中organization 数据来源
操作菜单:Inventory\Setup\Organizations\Organizations
这个界面中它会用到的是视图“PER_ORG_STRUCTURE_ELEMENTS_V2”它的SQL语句如下:
CREATE OR REPLACE VIEW "APPS"."PER_ORG_STRUCTURE_ELEMENTS_V2"
(
"ORG_STRUCTURE_ELEMENT_ID",
"ROW_ID",
"ORG_STRUCTURE_VERSION_ID",
"ORG_STRUCTURE_HIERARCHY",
"PARENT_NAME",
"BUSINESS_GROUP_ID",
"ORGANIZATION_ID_PARENT",
"ORGANIZATION_ID_CHILD",
"REQUEST_ID",
"PROGRAM_APPLICATION_ID",
"PROGRAM_ID",
"PROGRAM_UPDATE_DATE",
"LAST_UPDATE_DATE",
"LAST_UPDATED_BY",
"LAST_UPDATE_LOGIN",
"CREATED_BY",
"CREATION_DATE",
"POSITION_CONTROL_ENABLED_FLAG"
)
AS SELECT
POSE.ORG_STRUCTURE_ELEMENT_ID,
POSE.ROWID ,
POSV.ORG_STRUCTURE_VERSION_ID ,
POS.NAME ,
POUTL.NAME ,
POSE.BUSINESS_GROUP_ID ,
POSE.ORGANIZATION_ID_PARENT ,
POSE.ORGANIZATION_ID_CHILD ,
POSE.REQUEST_ID ,
POSE.PROGRAM_APPLICATION_ID ,
POSE.PROGRAM_ID ,
POSE.PROGRAM_UPDATE_DATE ,
POSE.LAST_UPDATE_DATE ,
POSE.LAST_UPDATED_BY ,
POSE.LAST_UPDATE_LOGIN ,
POSE.CREATED_BY ,
POSE.CREATION_DATE ,
POSE.POSITION_CONTROL_ENABLED_FLAG
FROM
PER_ORG_STRUCTURE_VERSIONS POSV ,
PER_ORG_STRUCTURE_ELEMENTS POSE ,
PER_ORGANIZATION_STRUCTURESPOS ,
HR_ALL_ORGANIZATION_UNITS POU ,
HR_ALL_ORGANIZATION_UNITS_TL POUTL
WHERE
POSV.ORG_STRUCTURE_VERSION_ID = POSE.ORG_STRUCTURE_VERSION_ID
AND POS.ORGANIZATION_STRUCTURE_ID = POSV.ORGANIZATION_STRUCTURE_ID
AND POSE.ORGANIZATION_ID_PARENT = POU.ORGANIZATION_ID
AND POU.ORGANIZATION_ID = POUTL.ORGANIZATION_ID
AND POUTL.LANGUAGE = userenv('LANG')
其中 用到的HR 的五个表分别是:
HR_ALL_ORGANIZATION_UNITS
HR_ALL_ORGANIZATION_UNITS_TL
PER_ORGANIZATION_STRUCTURES
PER_ORG_STRUCTURE_ELEMENTS
PER_ORG_STRUCTURE_VERSIONS
HR_ALL_ORGNIZATION_UNITS
存入了所有创建的组织(交易组织、人组织、企业组织、组织下的子组织信息)
主键:organization_id
唯一字段: NAME, BUSINESS_GROUP_ID
HR_ALL_ORGNIZATION_UNITS_TL
表中定义“HR_ALL_ORGNIZATION_UNITS” 表字段的多语言说明
主键:ORGANIZATION_ID
LANGUAGE
PER_ORGNIZATION_STRUCTURESPOS
表中存储各组织之间的层次关系
主键:ORG_STRUCTURE_ELEMENT_ID
主键二:ORG_STUCTURE_VERSION_ID
ORGNIZATION_ID_CHILD
PEA_ORG_STRUCTURE_ELEMENTS
父子组织阶级之间的关系
主键:ORG_STRUCTURE_ELEMENT_ID
主键二:ORG_STUCTURE_VERSION_ID
ORGNIZATION_ID_CHILD
PEA_ORG_STRUCTURE_VERSIONS
特定组织的版本控制数据
ORG_STRUCTURE_VERSION_ID
- 剩余三个表与HR_ALL_ORGANIZATION_UNITS 之间的关系:
“PER_ORGANIZATION_STRUCTURES”和“HR_ALL_ORGANIZATION_UNITS”表之部的关联是:
PER_ORG_STRUCTURE_ELEMENTS.BUSINESS_GROUP_ID
=
HR_ALL_ORGANIZATION_UNITS. ORGANIZATION_ID
PER_ORG_STRUCTURE_ELEMENTS.ORGANIZATION_ID_PARENT
=
HR_ALL_ORGANIZATION_UNITS. ORGANIZATION_ID
“PER_ORG_STRUCTURE_ELEMENTS”和“HR_ALL_ORGANIZATION_UNITS”之间的关联:
PER_ORG_STRUCTURE_ELEMENTS.BUSINESS_GROUP_ID
=
HR_ALL_ORGANIZATION_UNITS. ORGANIZATION_ID
PER_ORG_STRUCTURE_ELEMENTS.ORGANIZATION_ID_PARENT
=
HR_ALL_ORGANIZATION_UNITS. ORGANIZATION_ID
PER_ORG_STRUCTURE_ELEMENTS.ORGANIZATION_ID_CHILD
=
HR_ALL_ORGANIZATION_UNITS. ORGANIZATION_ID
“PER_ORG_STRUCTURE_VERSIONS”和“HR_ALL_ORGANIZATION_UNITS”之间的关联:
PER_ORG_STRUCTURE_VERSIONS.BUSINESS_GROUP_ID
=
HR_ALL_ORGANIZATION_UNITS. ORGANIZATION_ID