Gaokun Wang 4 mesiacov pred
rodič
commit
66338993bd

+ 1 - 1
eco-common/com-orm/src/main/java/org/eco/vip/orm/domain/BaseEntity.java

@@ -47,7 +47,7 @@ public class BaseEntity implements Serializable, TransPojo {
     /**
      * 状态(1有效,0失效)
      */
-    private String status;
+    private Integer status;
 
     /**
      * 搜索值

+ 93 - 0
eco-start/src/main/resources/db/dm/V1_0_0_1__sys-init-ddl.sql

@@ -0,0 +1,93 @@
+drop table if exists "eco-boot".system_user_t;
+create table "eco-boot"."system_user_t"
+(
+    "id" bigint not null,
+    "dept_id" bigint,
+    "account" varchar(30),
+    "user_name" varchar(30),
+    "nick_name" varchar(30),
+    "user_type" varchar(10),
+    "email" varchar(50),
+    "phone_number" varchar(11),
+    "gender" int,
+    "avatar" bigint,
+    "password" varchar(100),
+    "login_ip" varchar(128),
+    "login_date" timestamp(6),
+    "tenant_id" bigint,
+    "status" char(10) default 1,
+    "version" int,
+    "del_flag" bit,
+    "create_by" bigint,
+    "create_time" timestamp(6),
+    "update_by" bigint,
+    "update_time" timestamp(6),
+    "remark" VARCHAR2(1000)) storage(on "main", clusterbtr) ;
+
+comment on table "eco-boot".system_user_t is '用户表';
+comment on column "eco-boot".system_user_t."id" is '用户id';
+comment on column "eco-boot".system_user_t."dept_id" is '部门id';
+comment on column "eco-boot".system_user_t."account" is '账号';
+comment on column "eco-boot".system_user_t."user_name" is '姓名';
+comment on column "eco-boot".system_user_t."nick_name" is '昵称';
+comment on column "eco-boot".system_user_t."user_type" is '类型(sys_user系统用户)';
+comment on column "eco-boot".system_user_t."email" is '邮箱';
+comment on column "eco-boot".system_user_t."phone_number" is '手机号码';
+comment on column "eco-boot".system_user_t."gender" is '性别(0男 1女 2未知)';
+comment on column "eco-boot".system_user_t."avatar" is '头像';
+comment on column "eco-boot".system_user_t."password" is '密码';
+comment on column "eco-boot".system_user_t."login_ip" is '最后登陆ip';
+comment on column "eco-boot".system_user_t."login_date" is '最后登陆时间';
+comment on column "eco-boot".system_user_t."tenant_id" is '租户编号';
+comment on column "eco-boot".system_user_t."status" is '状态(1正常 0停用)';
+comment on column "eco-boot".system_user_t."version" is '乐观锁';
+comment on column "eco-boot".system_user_t."del_flag" is '删除标志(1已删除 0存在)';
+comment on column "eco-boot".system_user_t."create_by" is '创建者';
+comment on column "eco-boot".system_user_t."create_time" is '创建时间';
+comment on column "eco-boot".system_user_t."update_by" is '更新者';
+comment on column "eco-boot".system_user_t."update_time" is '更新时间';
+comment on column "eco-boot".system_user_t."remark" is '备注';
+
+create or replace unique  index "eco-boot"."system_user_index" on "eco-boot"."system_user_t"("id" asc) storage(on "main", clusterbtr) ;
+
+
+drop table if exists "eco-boot".system_dept_t;
+create table "eco-boot"."system_dept_t"
+(
+    "id" bigint not null,
+    "parent_id" bigint,
+    "dept_name" varchar(30),
+    "leader_id" bigint,
+    "phone"     varchar(11),
+    "email"       varchar(50),
+    "sort_code" int,
+    "tenant_id" bigint,
+    "status" char(10) default 1,
+    "version" int,
+    "del_flag" bit,
+    "create_by" bigint,
+    "create_time" timestamp(6),
+    "update_by" bigint,
+    "update_time" timestamp(6),
+    "remark" VARCHAR2(1000)) storage(on "main", clusterbtr) ;
+
+comment on table "eco-boot".system_dept_t is '部门表';
+comment on column "eco-boot".system_dept_t."id" is '部门id';
+comment on column "eco-boot".system_dept_t."parent_id" is '父id';
+comment on column "eco-boot".system_dept_t."dept_name" is '部门名称';
+comment on column "eco-boot".system_dept_t."leader_id" is '负责人';
+comment on column "eco-boot".system_dept_t."phone" is '部门电话';
+comment on column "eco-boot".system_dept_t."email" is '邮箱';
+comment on column "eco-boot".system_dept_t."sort_code" is '排序';
+comment on column "eco-boot".system_dept_t."tenant_id" is '租户编号';
+comment on column "eco-boot".system_dept_t."status" is '状态(1正常 0停用)';
+comment on column "eco-boot".system_dept_t."version" is '乐观锁';
+comment on column "eco-boot".system_dept_t."del_flag" is '删除标志(1已删除 0存在)';
+comment on column "eco-boot".system_dept_t."create_by" is '创建者';
+comment on column "eco-boot".system_dept_t."create_time" is '创建时间';
+comment on column "eco-boot".system_dept_t."update_by" is '更新者';
+comment on column "eco-boot".system_dept_t."update_time" is '更新时间';
+comment on column "eco-boot".system_dept_t."remark" is '备注';
+
+
+create or replace unique  index "eco-boot"."system_dept_index" on "eco-boot"."system_dept_t"("id" asc) storage(on "main", clusterbtr) ;

+ 7 - 0
eco-start/src/main/resources/db/dm/V1_0_0_2__sys-init-dml.sql

@@ -0,0 +1,7 @@
+insert into system_user_t (user_id, dept_id, account, user_name, nick_name, user_type, email, phone_number, gender, avatar, password, login_ip, login_date, tenant_id, status, version, del_flag, create_by, create_time, update_by, update_time, remark)
+values  (1, 1, 'superAdmin', '王大明', '超级管理员', 'sys_user', 'eco@eco.com', '15888888888', 1, null, '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0:0:0:0:0:0:0:1', '2024-07-02 18:10:18', 1, '1', 0, 0, 1, '2025-03-10 21:32:28', 1, '2025-03-10 21:32:28', '超级管理员'),
+        (2, 1, 'admin', '王小明', '管理员', 'sys_user', 'eco@eco.com', '15888888888', 1, null, '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0:0:0:0:0:0:0:1', '2024-07-02 18:10:18', 1, '1', 0, 0, 1, '2025-03-10 21:32:28', 1, '2025-03-10 21:32:28', '管理员');
+
+insert into system_dept_t (dept_id, parent_id, dept_name, order_num, leader_id, phone, email, tenant_id, status, version, del_flag, create_by, create_time, update_by, update_time)
+values  (1, 0, '集团', 0, 1, '18888888888', 'ecoadmin@wo.cn', 1, '1', 0, 0, 1, '2025-03-10 21:32:28', 1, '2025-03-10 21:32:28'),
+        (2, 1, '研发部', 2, 1, '', null, 1, '1', 0, 0, 2, '2025-03-10 21:32:28', 2, '2025-03-10 21:32:28');

+ 11 - 10
eco-start/src/main/resources/db/mysql/V1_0_0_1__sys-init-ddl.sql

@@ -1,3 +1,4 @@
+drop table if exists system_user_t;
 create table system_user_t
 (
     id      bigint                   not null comment '用户ID'
@@ -9,40 +10,40 @@ create table system_user_t
     user_type    varchar(10)         null comment '用户类型(sys_user系统用户)',
     email        varchar(50)         null comment '用户邮箱',
     phone_number varchar(11)         null comment '手机号码',
-    gender       int                 null comment '用户性别(0男 1女 2未知)',
+    gender       tinyint             null comment '用户性别(0男 1女 2未知)',
     avatar       bigint              null comment '头像地址',
     password     varchar(100)        null comment '密码',
     login_ip     varchar(128)        null comment '最后登陆IP',
     login_date   datetime            null comment '最后登陆时间',
     tenant_id    bigint              null comment '租户编号',
-    status       char    default '1' null comment '帐号状态(1正常 0停用)',
-    version      int     default 0   null comment '乐观锁',
-    del_flag     tinyint default 0   null comment '删除标志(1代表已删除 0代表存在)',
+    status       tinyint default 1   null comment '帐号状态(1正常 0停用)',
+    version      int                 null comment '乐观锁',
+    del_flag     tinyint             null comment '删除标志(1代表已删除 0代表存在)',
     create_by    bigint              null comment '创建者',
     create_time  datetime            null comment '创建时间',
     update_by    bigint              null comment '更新者',
     update_time  datetime            null comment '更新时间',
-    remark       text                null comment '备注'
+    remark       varchar2(1000)      null comment '备注'
 )
     comment '用户信息表' collate = utf8mb4_bin
                          row_format = DYNAMIC;
 
 
-
+drop table if exists system_dept_t;
 create table system_dept_t
 (
     id     bigint                   not null comment '部门ID'
         primary key,
     parent_id   bigint              null comment '父部门ID',
     dept_name   varchar(30)         null comment '部门名称',
-    order_num   int                 null comment '显示顺序',
+    order_num   tinyint                 null comment '显示顺序',
     leader_id   bigint              null comment '负责人',
     phone       varchar(11)         null comment '联系电话',
     email       varchar(50)         null comment '邮箱',
     tenant_id   bigint              null comment '租户编号',
-    status      char    default '1' null comment '部门状态(1正常 0停用)',
-    version     int     default 0   null comment '乐观锁',
-    del_flag    tinyint default 0   null comment '删除标志(1代表已删除 0代表存在)',
+    status      tinyint default 1   null comment '部门状态(1正常 0停用)',
+    version     int                 null comment '乐观锁',
+    del_flag    tinyint             null comment '删除标志(1代表已删除 0代表存在)',
     create_by   bigint              null comment '创建者',
     create_time datetime            null comment '创建时间',
     update_by   bigint              null comment '更新者',