Prechádzať zdrojové kódy

建表删除已存在的表

wudla 4 rokov pred
rodič
commit
99dc56782b
4 zmenil súbory, kde vykonal 40 pridanie a 2 odobranie
  1. 4 2
      SQL/alarm.ddl.sql
  2. 5 0
      SQL/dic.ddl.sql
  3. 2 0
      SQL/dpt.ddl.sql
  4. 29 0
      SQL/org.ddl.sql

+ 4 - 2
SQL/alarm.ddl.sql

@@ -1,5 +1,6 @@
 ## 报警系统数据表
 # 报警条目表
+DROP TABLE IF EXISTS `alarm_item`;
 create table alarm_item
 (
     id varchar(40) not null primary key,
@@ -9,14 +10,15 @@ create table alarm_item
     alarm_category varchar(100) null,
     level varchar(40)  null,
     valid int null,
-    create_by varchar(40) null,
+    create_user varchar(40) null,
     create_time timestamp null,
-    update_by varchar(40) null,
+    update_user varchar(40) null,
     update_time timestamp null,
     remark varchar(500) null
 ) comment '报警条目表';
 
 # 报警记录表
+DROP TABLE IF EXISTS `alarm_record`;
 create table alarm_record
 (
     id varchar(40)  not null primary key,

+ 5 - 0
SQL/dic.ddl.sql

@@ -1,5 +1,6 @@
 ##数据字典表
 # 字典类型
+DROP TABLE IF EXISTS `dic_dt_type`;
 create table dic_dt_type
 (
     id varchar(20) not null primary key ,
@@ -16,6 +17,7 @@ create table dic_dt_type
 ) comment '字典类型';
 
 # 字典数据
+DROP TABLE IF EXISTS `dic_dt_data`;
 create table dic_dt_data
 (
     id varchar(20) not null primary key ,
@@ -33,6 +35,7 @@ create table dic_dt_data
 ) comment '字典数据';
 
 # 字典数据映射
+DROP TABLE IF EXISTS `dic_dt_data_map`;
 create table dic_dt_data_map
 (
     id varchar(20) not null primary key ,
@@ -51,6 +54,7 @@ create table dic_dt_data_map
 ) comment '字典数据映射';
 
 # 知识库类型
+DROP TABLE IF EXISTS `dic_kl_type`;
 create table dic_kl_type
 (
     id varchar(20) not null primary key ,
@@ -66,6 +70,7 @@ create table dic_kl_type
 ) comment '知识库类型';
 
 # 知识库数据
+DROP TABLE IF EXISTS `dic_kl_data`;
 create table dic_kl_data
 (
     id varchar(20) not null primary key ,

+ 2 - 0
SQL/dpt.ddl.sql

@@ -1,5 +1,6 @@
 ## 务调度系统数据表
 # 任务配置
+DROP TABLE IF EXISTS `dpt_task_cfg`;
 create table dpt_task_cfg
 (
     id  varchar(40) not null primary key ,
@@ -20,6 +21,7 @@ create table dpt_task_cfg
 ) comment '任务配置';
 
 # 任务执行记录
+DROP TABLE IF EXISTS `dpt_task_record`;
 create table dpt_task_record
 (
     id  varchar(40) not null primary key ,

+ 29 - 0
SQL/org.ddl.sql

@@ -1,5 +1,6 @@
 ## 人员组织权限
 # 1、集团(多租户)
+DROP TABLE IF EXISTS `org_group`;
 create table org_group
 (
     id varchar(40) not null primary key ,
@@ -13,6 +14,7 @@ create table org_group
 ) comment '集团';
 
 # 2、公司
+DROP TABLE IF EXISTS `org_company`;
 create table org_company
 (
     id varchar(40) not null primary key ,
@@ -27,6 +29,7 @@ create table org_company
 ) comment '公司';
 
 # 3、部门
+DROP TABLE IF EXISTS `org_dept`;
 create table org_dept
 (
     id varchar(40) not null primary key ,
@@ -44,6 +47,7 @@ create table org_dept
 ) comment '部门表';
 
 # 4、岗位
+DROP TABLE IF EXISTS `org_job`;
 create table org_job
 (
     id varchar(40) not null primary key ,
@@ -59,6 +63,7 @@ create table org_job
 ) comment '岗位';
 
 # 5、部门模板
+DROP TABLE IF EXISTS `org_dept_template`;
 create table org_dept_template
 (
     id varchar(40) not null primary key ,
@@ -72,6 +77,7 @@ create table org_dept_template
 ) comment '部门模板';
 
 # 6、部门层级结构模版
+DROP TABLE IF EXISTS `org_dept_lv_template`;
 create table org_dept_lv_template
 (
     id varchar(40) not null primary key ,
@@ -86,6 +92,7 @@ create table org_dept_lv_template
 ) comment '部门层级结构模板';
 
 # 7、岗位模版
+DROP TABLE IF EXISTS `org_job_template`;
 create table org_job_template
 (
     id varchar(40) not null primary key ,
@@ -99,6 +106,7 @@ create table org_job_template
 ) comment '岗位模版';
 
 # 8、岗位模版与部门模版关系表
+DROP TABLE IF EXISTS `org_job_dept_template`;
 create table org_job_dept_template
 (
     id varchar(40) not null primary key ,
@@ -114,6 +122,7 @@ create table org_job_dept_template
 
 
 # 9、人员
+DROP TABLE IF EXISTS `org_person`;
 create table org_person
 (
     id varchar(40) not null primary key ,
@@ -128,6 +137,7 @@ create table org_person
 ) comment '人员' ;
 
 # 10、账号
+DROP TABLE IF EXISTS `org_account`;
 create table org_account
 (
     id varchar(40) not null primary key ,
@@ -143,6 +153,7 @@ create table org_account
 ) comment '账号';
 
 # 11、项目数据权限
+DROP TABLE IF EXISTS `org_auth_prj_data`;
 create table org_auth_prj_data
 (
     id varchar(40) not null primary key ,
@@ -156,6 +167,7 @@ create table org_auth_prj_data
 ) comment '项目数据权限';
 
 # 12、公司下的项目数据权限表
+DROP TABLE IF EXISTS `org_auth_company_prj`;
 create table org_auth_company_prj
 (
     id varchar(40) not null primary key ,
@@ -170,6 +182,7 @@ create table org_auth_company_prj
 ) comment '公司下的项目数据权限表';
 
 # 13、项目下的公司数据表
+DROP TABLE IF EXISTS `org_rel_company_prj`;
 create table org_rel_company_prj
 (
     id varchar(40) not null primary key ,
@@ -184,6 +197,7 @@ create table org_rel_company_prj
 ) comment '项目下的公司数据表';
 
 # 14、部门的项目数据权限表
+DROP TABLE IF EXISTS `org_auth_dept_prj`;
 create table org_auth_dept_prj
 (
     id varchar(40) not null primary key ,
@@ -198,6 +212,7 @@ create table org_auth_dept_prj
 ) comment '部门的项目数据权限表';
 
 # 15、岗位&部门关系表
+DROP TABLE IF EXISTS `org_cfg_dept_job`;
 create table org_cfg_dept_job
 (
     id varchar(40) not null primary key ,
@@ -212,6 +227,7 @@ create table org_cfg_dept_job
 ) comment '岗位&部门关系表';
 
 # 16、人员配置公司管理权限
+DROP TABLE IF EXISTS `org_cfg_person_company`;
 create table org_cfg_person_company
 (
     id varchar(40) not null primary key ,
@@ -226,6 +242,7 @@ create table org_cfg_person_company
 ) comment '人员配置公司管理权限';
 
 # 17、人员配置项目数据权限
+DROP TABLE IF EXISTS `org_cfg_person_prj`;
 create table org_cfg_person_prj
 (
     id varchar(40) not null primary key ,
@@ -240,6 +257,7 @@ create table org_cfg_person_prj
 ) comment '人员配置项目数据权限';
 
 # 18、人员与部门关系表
+DROP TABLE IF EXISTS `org_cfg_person_dept`;
 create table org_cfg_person_dept
 (
     id varchar(40) not null primary key ,
@@ -255,6 +273,7 @@ create table org_cfg_person_dept
 ) comment '人员与部门关系表';
 
 # 19、人员与岗位关系表
+DROP TABLE IF EXISTS `org_cfg_person_job`;
 create table org_cfg_person_job
 (
     id varchar(40) not null primary key ,
@@ -269,6 +288,7 @@ create table org_cfg_person_job
 ) comment '人员与岗位关系表';
 
 # 20、产品线
+DROP TABLE IF EXISTS `org_product`;
 create table org_product
 (
     id varchar(40) not null primary key ,
@@ -282,6 +302,7 @@ create table org_product
 ) comment '产品线';
 
 # 21、应用
+DROP TABLE IF EXISTS `org_application`;
 create table org_application
 (
     id varchar(40) not null primary key ,
@@ -296,6 +317,7 @@ create table org_application
 ) comment '应用';
 
 # 22、功能
+DROP TABLE IF EXISTS `org_function`;
 create table org_function
 (
     id varchar(40) not null primary key ,
@@ -310,6 +332,7 @@ create table org_function
 ) comment '功能';
 
 # 23、功能层级
+DROP TABLE IF EXISTS `org_function_lv`;
 create table org_function_lv
 (
     id varchar(40) not null primary key ,
@@ -325,6 +348,7 @@ create table org_function_lv
 
 
 # 24、集团配置应用
+DROP TABLE IF EXISTS `org_cfg_group_app`;
 create table org_cfg_group_app
 (
     id varchar(40) not null primary key ,
@@ -340,6 +364,7 @@ create table org_cfg_group_app
 
 
 # 25、集团配置功能
+DROP TABLE IF EXISTS `org_cfg_group_func`;
 create table org_cfg_group_func
 (
     id varchar(40) not null primary key ,
@@ -354,6 +379,7 @@ create table org_cfg_group_func
 ) comment '集团配置功能';
 
 # 26、项目配置应用
+DROP TABLE IF EXISTS `org_cfg_prj_app`;
 create table org_cfg_prj_app
 (
     id varchar(40) not null primary key ,
@@ -370,6 +396,7 @@ create table org_cfg_prj_app
 
 
 # 27、项目配置功能
+DROP TABLE IF EXISTS `org_cfg_prj_func`;
 create table org_cfg_prj_func
 (
     id varchar(40) not null primary key ,
@@ -385,6 +412,7 @@ create table org_cfg_prj_func
 ) comment '项目配置功能';
 
 # 28、岗位配置应用
+DROP TABLE IF EXISTS `org_cfg_job_app`;
 create table org_cfg_job_app
 (
     id varchar(40) not null primary key ,
@@ -400,6 +428,7 @@ create table org_cfg_job_app
 ) comment '岗位配置应用';
 
 # 29、岗位配置功能
+DROP TABLE IF EXISTS `org_cfg_job_func`;
 create table org_cfg_job_func
 (
     id varchar(40) not null primary key ,