|
|
@@ -125,6 +125,8 @@ drop table if exists `xg_dorm_bed_student`;
|
|
|
create table `xg_dorm_bed_student` (
|
|
|
`id` bigint(20) not null comment '主键ID',
|
|
|
`college_id` bigint(20) not null comment '分配学院ID',
|
|
|
+ `major_id` bigint(20) not null comment '分配专业ID',
|
|
|
+ `class_id` bigint(20) not null comment '分配班级ID',
|
|
|
`student_id` bigint(20) not null comment '分配学生ID',
|
|
|
`bed_id` bigint(20) not null comment '床位ID',
|
|
|
`room_id` bigint(20) not null comment '房间ID',
|
|
|
@@ -200,73 +202,73 @@ create table `xg_dorm_manager_source` (
|
|
|
key `idx_auth_source` (`auth_source`)
|
|
|
) engine=innodb default charset=utf8mb4 comment='管理员授权关系表';
|
|
|
|
|
|
--- 9. 管理员宿舍楼权限关系表
|
|
|
-drop table if exists `xg_dorm_manager_building`;
|
|
|
-create table `xg_dorm_manager_building` (
|
|
|
- `id` bigint(20) not null comment '主键ID',
|
|
|
- `manager_id` bigint(20) not null comment '管理员ID',
|
|
|
- `building_id` bigint(20) not null comment '宿舍楼ID',
|
|
|
- `status` char(1) default '0' comment '状态(0有效 1已撤销)',
|
|
|
- `deleted` char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
|
|
|
- `tenant_id` bigint(20) default '0' comment '租户编号',
|
|
|
- `create_by` bigint(20) default null comment '创建者',
|
|
|
- `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
|
|
- `create_time` datetime default null comment '创建时间',
|
|
|
- `update_by` bigint(20) default null comment '更新者',
|
|
|
- `update_time` datetime default null comment '更新时间',
|
|
|
- `remark` varchar(500) default null comment '备注',
|
|
|
- primary key (`id`),
|
|
|
- unique key `uk_manager_building` (`manager_id`, `building_id`),
|
|
|
- key `idx_manager_id` (`manager_id`),
|
|
|
- key `idx_building_id` (`building_id`)
|
|
|
-) engine=innodb default charset=utf8mb4 comment='管理员宿舍楼权限关系表';
|
|
|
+-- 9. 管理员宿舍楼权限关系表 -- 废弃,使用管理员授权关系表来代替
|
|
|
+-- drop table if exists `xg_dorm_manager_building`;
|
|
|
+-- create table `xg_dorm_manager_building` (
|
|
|
+-- `id` bigint(20) not null comment '主键ID',
|
|
|
+-- `manager_id` bigint(20) not null comment '管理员ID',
|
|
|
+-- `building_id` bigint(20) not null comment '宿舍楼ID',
|
|
|
+-- `status` char(1) default '0' comment '状态(0有效 1已撤销)',
|
|
|
+-- `deleted` char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
|
|
|
+-- `tenant_id` bigint(20) default '0' comment '租户编号',
|
|
|
+-- `create_by` bigint(20) default null comment '创建者',
|
|
|
+-- `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
|
|
+-- `create_time` datetime default null comment '创建时间',
|
|
|
+-- `update_by` bigint(20) default null comment '更新者',
|
|
|
+-- `update_time` datetime default null comment '更新时间',
|
|
|
+-- `remark` varchar(500) default null comment '备注',
|
|
|
+-- primary key (`id`),
|
|
|
+-- unique key `uk_manager_building` (`manager_id`, `building_id`),
|
|
|
+-- key `idx_manager_id` (`manager_id`),
|
|
|
+-- key `idx_building_id` (`building_id`)
|
|
|
+-- ) engine=innodb default charset=utf8mb4 comment='管理员宿舍楼权限关系表';
|
|
|
|
|
|
--- 10. 二级学院宿舍管理员信息表
|
|
|
-drop table if exists `xg_dorm_college_manager`;
|
|
|
-create table `xg_dorm_college_manager` (
|
|
|
- `id` bigint(20) not null comment '主键ID',
|
|
|
- `manager_name` varchar(100) not null comment '管理员姓名',
|
|
|
- `college_id` bigint(20) not null comment '所属学院ID',
|
|
|
- `user_id` bigint(20) default null comment '关联用户ID',
|
|
|
- `phone` varchar(20) default null comment '联系电话',
|
|
|
- `gender` char(1) default '0' comment '性别(0男 1女 2未知)',
|
|
|
- `status` char(1) default '0' comment '状态(0正常 1停用)',
|
|
|
- `deleted` char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
|
|
|
- `tenant_id` bigint(20) default '0' comment '租户编号',
|
|
|
- `create_by` bigint(20) default null comment '创建者',
|
|
|
- `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
|
|
- `create_time` datetime default null comment '创建时间',
|
|
|
- `update_by` bigint(20) default null comment '更新者',
|
|
|
- `update_time` datetime default null comment '更新时间',
|
|
|
- `remark` varchar(500) default null comment '备注',
|
|
|
- primary key (`id`),
|
|
|
- key `idx_college_id` (`college_id`),
|
|
|
- key `idx_user_id` (`user_id`)
|
|
|
-) engine=innodb default charset=utf8mb4 comment='二级学院宿舍管理员信息表';
|
|
|
+-- 10. 二级学院宿舍管理员信息表 -- 废弃,使用角色来作为二级学院管理员
|
|
|
+-- drop table if exists `xg_dorm_college_manager`;
|
|
|
+-- create table `xg_dorm_college_manager` (
|
|
|
+-- `id` bigint(20) not null comment '主键ID',
|
|
|
+-- `manager_name` varchar(100) not null comment '管理员姓名',
|
|
|
+-- `college_id` bigint(20) not null comment '所属学院ID',
|
|
|
+-- `user_id` bigint(20) default null comment '关联用户ID',
|
|
|
+-- `phone` varchar(20) default null comment '联系电话',
|
|
|
+-- `gender` char(1) default '0' comment '性别(0男 1女 2未知)',
|
|
|
+-- `status` char(1) default '0' comment '状态(0正常 1停用)',
|
|
|
+-- `deleted` char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
|
|
|
+-- `tenant_id` bigint(20) default '0' comment '租户编号',
|
|
|
+-- `create_by` bigint(20) default null comment '创建者',
|
|
|
+-- `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
|
|
+-- `create_time` datetime default null comment '创建时间',
|
|
|
+-- `update_by` bigint(20) default null comment '更新者',
|
|
|
+-- `update_time` datetime default null comment '更新时间',
|
|
|
+-- `remark` varchar(500) default null comment '备注',
|
|
|
+-- primary key (`id`),
|
|
|
+-- key `idx_college_id` (`college_id`),
|
|
|
+-- key `idx_user_id` (`user_id`)
|
|
|
+-- ) engine=innodb default charset=utf8mb4 comment='二级学院宿舍管理员信息表';
|
|
|
|
|
|
--- 11. 二级学院床位绑定关系表
|
|
|
-drop table if exists `xg_dorm_college_bed`;
|
|
|
-create table `xg_dorm_college_bed` (
|
|
|
- `id` bigint(20) not null comment '主键ID',
|
|
|
- `college_id` bigint(20) not null comment '学院ID',
|
|
|
- `bed_id` bigint(20) not null comment '床位ID',
|
|
|
- `building_id` bigint(20) not null comment '宿舍楼ID',
|
|
|
- `room_id` bigint(20) not null comment '房间ID',
|
|
|
- `status` char(1) default '0' comment '状态(0正常 1已解除)',
|
|
|
- `assign_time` datetime default null comment '分配时间',
|
|
|
- `release_time` datetime default null comment '到期解除时间',
|
|
|
- `deleted` char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
|
|
|
- `tenant_id` bigint(20) default '0' comment '租户编号',
|
|
|
- `create_by` bigint(20) default null comment '创建者',
|
|
|
- `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
|
|
- `create_time` datetime default null comment '创建时间',
|
|
|
- `update_by` bigint(20) default null comment '更新者',
|
|
|
- `update_time` datetime default null comment '更新时间',
|
|
|
- `remark` varchar(500) default null comment '备注',
|
|
|
- primary key (`id`),
|
|
|
- unique key `uk_college_bed` (`college_id`, `bed_id`),
|
|
|
- key `idx_college_id` (`college_id`),
|
|
|
- key `idx_bed_id` (`bed_id`),
|
|
|
- key `idx_building_id` (`building_id`),
|
|
|
- key `idx_room_id` (`room_id`)
|
|
|
-) engine=innodb default charset=utf8mb4 comment='二级学院床位绑定关系表';
|
|
|
+-- 11. 二级学院床位绑定关系表 --废弃
|
|
|
+-- drop table if exists `xg_dorm_college_bed`;
|
|
|
+-- create table `xg_dorm_college_bed` (
|
|
|
+-- `id` bigint(20) not null comment '主键ID',
|
|
|
+-- `college_id` bigint(20) not null comment '学院ID',
|
|
|
+-- `bed_id` bigint(20) not null comment '床位ID',
|
|
|
+-- `building_id` bigint(20) not null comment '宿舍楼ID',
|
|
|
+-- `room_id` bigint(20) not null comment '房间ID',
|
|
|
+-- `status` char(1) default '0' comment '状态(0正常 1已解除)',
|
|
|
+-- `assign_time` datetime default null comment '分配时间',
|
|
|
+-- `release_time` datetime default null comment '到期解除时间',
|
|
|
+-- `deleted` char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
|
|
|
+-- `tenant_id` bigint(20) default '0' comment '租户编号',
|
|
|
+-- `create_by` bigint(20) default null comment '创建者',
|
|
|
+-- `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
|
|
+-- `create_time` datetime default null comment '创建时间',
|
|
|
+-- `update_by` bigint(20) default null comment '更新者',
|
|
|
+-- `update_time` datetime default null comment '更新时间',
|
|
|
+-- `remark` varchar(500) default null comment '备注',
|
|
|
+-- primary key (`id`),
|
|
|
+-- unique key `uk_college_bed` (`college_id`, `bed_id`),
|
|
|
+-- key `idx_college_id` (`college_id`),
|
|
|
+-- key `idx_bed_id` (`bed_id`),
|
|
|
+-- key `idx_building_id` (`building_id`),
|
|
|
+-- key `idx_room_id` (`room_id`)
|
|
|
+-- ) engine=innodb default charset=utf8mb4 comment='二级学院床位绑定关系表';
|