|
@@ -0,0 +1,416 @@
|
|
|
|
+## 人员组织权限
|
|
|
|
+# 1、集团(多租户)
|
|
|
|
+create table org_group
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ code varchar(40) null,
|
|
|
|
+ name varchar(255) null,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500) null
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 2、公司
|
|
|
|
+create table org_company
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ name varchar(40) null,
|
|
|
|
+ group_code varchar(40) not null ,
|
|
|
|
+ parent_id varchar(40) null,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null ,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500) null
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 3、部门
|
|
|
|
+create table org_dept
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ name varchar(40) not null ,
|
|
|
|
+ parent_dept_id varchar(40) not null ,
|
|
|
|
+ parent_company_id varchar(40) not null ,
|
|
|
|
+ project_id varchar(40) not null ,
|
|
|
|
+ group_code varchar(40) not null ,
|
|
|
|
+ type varchar(40) not null comment '部门分类',
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 4、岗位
|
|
|
|
+create table org_job
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ name varchar(40) not null ,
|
|
|
|
+ project_id varchar(40) not null ,
|
|
|
|
+ group_code varchar(40) not null ,
|
|
|
|
+ type varchar(40) not null comment '岗位类型',
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 5、部门模板
|
|
|
|
+create table org_dept_template
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ name varchar(40) not null ,
|
|
|
|
+ group_code varchar(40) not null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 6、部门层级结构模版
|
|
|
|
+create table org_dept_lv_template
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ name varchar(40) not null ,
|
|
|
|
+ parent_id varchar(40) not null ,
|
|
|
|
+ group_code varchar(40) not null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 7、岗位模版
|
|
|
|
+create table org_job_template
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ name varchar(40) not null ,
|
|
|
|
+ group_code varchar(40) not null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 8、岗位模版与部门模版关系表
|
|
|
|
+create table org_job_dept_template
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ name varchar(40) not null ,
|
|
|
|
+ parent_id varchar(40) not null ,
|
|
|
|
+ group_code varchar(40) not null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500) null
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+# 9、人员
|
|
|
|
+create table org_person
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ person_name varchar(40) null ,
|
|
|
|
+ gender int null ,
|
|
|
|
+ status int not null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 10、账号
|
|
|
|
+create table org_account
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ username varchar(40) null ,
|
|
|
|
+ password varchar(40) null ,
|
|
|
|
+ person_id varchar(40) null ,
|
|
|
|
+ status int not null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 11、项目数据权限
|
|
|
|
+create table org_auth_prj_data
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ name varchar(40) not null ,
|
|
|
|
+ group_code varchar(40) null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 12、公司下的项目数据权限表
|
|
|
|
+create table org_auth_company_prj
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ company_id varchar(40) not null ,
|
|
|
|
+ project_id varchar(40) not null ,
|
|
|
|
+ group_code varchar(40) not null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 13、项目下的公司数据表
|
|
|
|
+create table org_rel_company_prj
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ company_id varchar(40) not null ,
|
|
|
|
+ project_id varchar(40) not null ,
|
|
|
|
+ group_code varchar(40) not null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 14、部门的项目数据权限表
|
|
|
|
+create table org_auth_dept_prj
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ dept_id varchar(40) not null ,
|
|
|
|
+ project_id varchar(40) not null ,
|
|
|
|
+ group_code varchar(40) not null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 15、岗位&部门关系表
|
|
|
|
+create table org_cfg_dept_job
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ dept_id varchar(40) not null comment '部门id',
|
|
|
|
+ job_id varchar(40) not null comment '岗位id',
|
|
|
|
+ status int not null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 16、人员配置公司管理权限
|
|
|
|
+create table org_cfg_person_company
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ person_id varchar(40) not null comment '账号id',
|
|
|
|
+ company_id varchar(40) not null comment '公司id',
|
|
|
|
+ status int not null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 17、人员配置项目数据权限
|
|
|
|
+create table org_cfg_person_prj
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ person_id varchar(40) not null comment '账号id',
|
|
|
|
+ project_id varchar(40) not null comment '项目id',
|
|
|
|
+ status int not null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 18、人员与部门关系表
|
|
|
|
+create table org_cfg_person_dept
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ person_id varchar(40) not null comment '账号id',
|
|
|
|
+ dept_id varchar(40) not null comment '部门id',
|
|
|
|
+ major_dept int not null comment '是否为主部门',
|
|
|
|
+ status int not null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 19、人员与岗位关系表
|
|
|
|
+create table org_cfg_person_job
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ person_id varchar(40) not null comment '账号id',
|
|
|
|
+ dept_job_id varchar(40) not null comment '部门岗位关系id',
|
|
|
|
+ status int not null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 20、产品线
|
|
|
|
+create table org_product
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ code varchar(40) not null ,
|
|
|
|
+ name varchar(40) not null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 21、应用
|
|
|
|
+create table org_application
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ code varchar(40) not null ,
|
|
|
|
+ name varchar(40) not null ,
|
|
|
|
+ category varchar(40) not null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 22、功能
|
|
|
|
+create table org_function
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ code varchar(40) not null ,
|
|
|
|
+ name varchar(40) not null ,
|
|
|
|
+ app_code varchar(40) not null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 23、功能层级
|
|
|
|
+create table org_function_lv
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ code varchar(40) not null ,
|
|
|
|
+ name varchar(40) not null ,
|
|
|
|
+ parent_id varchar(40) null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+# 24、集团配置应用
|
|
|
|
+create table org_cfg_group_app
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ app_code varchar(40) not null ,
|
|
|
|
+ group_code varchar(40) not null ,
|
|
|
|
+ status int not null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+# 25、集团配置功能
|
|
|
|
+create table org_cfg_group_func
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ func_code varchar(40) not null ,
|
|
|
|
+ group_code varchar(40) not null ,
|
|
|
|
+ status int not null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 26、项目配置应用
|
|
|
|
+create table org_cfg_prj_app
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ app_code varchar(40) not null ,
|
|
|
|
+ project_id varchar(40) not null ,
|
|
|
|
+ group_code varchar(40) not null ,
|
|
|
|
+ status int not null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+# 27、项目配置功能
|
|
|
|
+create table org_cfg_prj_func
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ func_code varchar(40) not null ,
|
|
|
|
+ project_id varchar(40) not null ,
|
|
|
|
+ group_code varchar(40) not null ,
|
|
|
|
+ status int not null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 28、岗位配置应用
|
|
|
|
+create table org_cfg_job_app
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ app_code varchar(40) not null ,
|
|
|
|
+ job_id varchar(40) not null ,
|
|
|
|
+ group_code varchar(40) not null ,
|
|
|
|
+ status int not null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+# 29、岗位配置功能
|
|
|
|
+create table org_cfg_job_func
|
|
|
|
+(
|
|
|
|
+ id varchar(40) not null primary key ,
|
|
|
|
+ func_code varchar(40) not null ,
|
|
|
|
+ app_code varchar(40) not null ,
|
|
|
|
+ job_id varchar(40) not null ,
|
|
|
|
+ group_code varchar(40) not null ,
|
|
|
|
+ status int not null ,
|
|
|
|
+ create_by varchar(40) null,
|
|
|
|
+ create_time timestamp null,
|
|
|
|
+ update_by varchar(40) null,
|
|
|
|
+ update_time timestamp null,
|
|
|
|
+ remark varchar(500)
|
|
|
|
+);
|