Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
K
kb
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 2
    • Issues 2
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • granite
  • kb
  • Wiki
    • Lake
  • ic_employee

ic_employee · Changes

Page history
搬运lake.wiki中的内容 authored Feb 22, 2021 by 吴一博's avatar 吴一博
Hide whitespace changes
Inline Side-by-side
Showing with 74 additions and 0 deletions
+74 -0
  • lake/ic_employee.md lake/ic_employee.md +74 -0
  • No files found.
lake/ic_employee.md 0 → 100644
View page @ 06367b0a
# 工商主体-主要人员
目前主要人员数据存储mongo库中的两个地方,utn_ic.ic 和 utn_ic.company_employee
# 数据存储
* host: s-uf679e7a2557fa84.mongodb.rds.aliyuncs.com:3717,s-uf61ad41d3e0fe14.mongodb.rds.aliyuncs.com:3717
* username: ***
* password: ***
* database: utn_ic
* collection: ic、company_employee
# 数据结构
## utn_ic.ic
ic表的存储形式为将一个主体的所有信息放在一个doc中,主要人员的格式如下:
```json
{
"employees": [
{
"employee_name": "名称",
"position": "职位",
"person_id": "人名去重id"
},
...
],
"employee_size": "人员列表大小"
}
```
* 存储的信息都为当前的最新状态,employees列表中不存储历史只要人员
* employees列表中会有一个人员多条记录的情况,其差别在于职位不同,即employees没有根据employee_name去重合并
* 由于mongo中单个文档的大小限制在16M,ic表的存储形式不可取,会逐步将子维度分表存储
## utn_ic.company_employee
主要人员维度表,包括历史主要人员和当前主要人员,一个主体的一个高管信息存为一个doc,格式如下:
```json
{
"company_name_digest": "主体唯一键",
"employee_name": "人员名称",
"position": "职位",
"person_id": "人名去重id",
"is_history": "是否是历史主要人员,1:是历史主要人员,0:当前主要人员",
"include_date": "主要人员进入日期",
"remove_date": "主要人员退出日期",
"create_time": "入库时间",
"lastupdatetime": "最后更新时间"
}
```
## 数据字典
| 字段名 | 字段类型 | 注释 |
| ------ | ------ | ------ |
| company_name_digest | string | 主体唯一键 |
| employee_name | string | 人员名称 |
| position | string | 职位 |
| person_id | string | 人名去重id |
| is_history | int | 是否是历史主要人员,1:是历史主要人员,0:当前主要人员 |
| include_date | date | 主要人员进入日期 |
| remove_date | date | 主要人员退出日期 |
| create_time | date | 入库时间 |
| lastupdatetime | date | 最后更新时间 |
* 可以认为该表的唯一键为company_name_digest + employee_name
* 用is_history字段区分历史主要人员和当前主要人员
* 历史主要人员来源于:1: 从变更记录中解析,2: 例行更新时保留退出的主要人员
* 该表将来会替代ic表中的employees字段
# lake-mysql
Clone repository
  • README
  • basic_guidelines
  • basic_guidelines
    • basic_guidelines
    • dev_guide
    • project_build
    • 开发流程
  • best_practice
  • best_practice
    • AlterTable
    • RDS
    • azkaban
    • create_table
    • design
    • elasticsearch
    • elasticsearch
      • ES运维
    • logstash
View All Pages