提交代码
This commit is contained in:
1 parent
7a4881592a
commit
d6924b211f
16 files changed
+3857
No files matched your search
@@ -0,0 +1,105 @@
|
||||
-- ----------------------------
|
||||
-- 假期留宿管理表
|
||||
-- 模块:学工管理-宿舍管理
|
||||
-- 功能:管理学生假期留宿申请、审批、入住等全流程
|
||||
-- 作者:系统设计
|
||||
-- 创建时间:2025-01-27
|
||||
-- ----------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `xg_holiday_stay`;
|
||||
CREATE TABLE `xg_holiday_stay` (
|
||||
-- =============基础字段(强制性)=============
|
||||
`id` bigint(20) NOT NULL COMMENT '主键ID',
|
||||
`tenant_id` varchar(20) NOT NULL DEFAULT '000000' COMMENT '租户编号',
|
||||
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
||||
`create_by` bigint(20) DEFAULT NULL COMMENT '创建者',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` bigint(20) DEFAULT NULL COMMENT '更新者',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`deleted` tinyint(1) DEFAULT 0 COMMENT '删除标志(0代表存在 1代表删除)',
|
||||
|
||||
-- =============业务关联字段=============
|
||||
`student_id` bigint(20) NOT NULL COMMENT '学生ID,关联xg_student_msg.id',
|
||||
`student_name` varchar(50) NOT NULL COMMENT '学生姓名',
|
||||
`student_no` varchar(20) NOT NULL COMMENT '学号',
|
||||
`class_id` bigint(20) DEFAULT NULL COMMENT '班级ID',
|
||||
`class_name` varchar(100) DEFAULT NULL COMMENT '班级名称',
|
||||
`major_id` bigint(20) DEFAULT NULL COMMENT '专业ID',
|
||||
`major_name` varchar(100) DEFAULT NULL COMMENT '专业名称',
|
||||
`college_id` bigint(20) DEFAULT NULL COMMENT '学院ID',
|
||||
`college_name` varchar(100) DEFAULT NULL COMMENT '学院名称',
|
||||
|
||||
-- =============宿舍信息字段=============
|
||||
`campus_id` bigint(20) DEFAULT NULL COMMENT '校区ID,关联xg_dorm_campus.id',
|
||||
`campus_name` varchar(100) DEFAULT NULL COMMENT '校区名称',
|
||||
`area_id` bigint(20) DEFAULT NULL COMMENT '宿舍区ID,关联xg_dorm_area.id',
|
||||
`area_name` varchar(100) DEFAULT NULL COMMENT '宿舍区名称',
|
||||
`building_id` bigint(20) DEFAULT NULL COMMENT '宿舍楼ID,关联xg_dorm_building.id',
|
||||
`building_name` varchar(100) DEFAULT NULL COMMENT '宿舍楼名称',
|
||||
`room_id` bigint(20) DEFAULT NULL COMMENT '房间ID,关联xg_dorm_room.id',
|
||||
`room_name` varchar(100) DEFAULT NULL COMMENT '房间名称',
|
||||
`bed_id` bigint(20) DEFAULT NULL COMMENT '床位ID,关联xg_dorm_bed.id',
|
||||
`bed_name` varchar(100) DEFAULT NULL COMMENT '床位名称',
|
||||
|
||||
-- =============申请信息字段=============
|
||||
`holiday_type` varchar(50) NOT NULL COMMENT '假期类型(寒假、暑假、春节假期、国庆假期等)',
|
||||
`apply_start_date` date NOT NULL COMMENT '申请留宿开始日期',
|
||||
`apply_end_date` date NOT NULL COMMENT '申请留宿结束日期',
|
||||
`stay_reason` text NOT NULL COMMENT '留宿原因(必填)',
|
||||
`stay_reason_type` varchar(20) DEFAULT NULL COMMENT '留宿原因类型(学习、实习、家庭困难、其他)',
|
||||
|
||||
-- =============联系信息字段=============
|
||||
`student_phone` varchar(20) NOT NULL COMMENT '学生联系电话',
|
||||
`emergency_contact` varchar(50) NOT NULL COMMENT '紧急联系人姓名',
|
||||
`emergency_phone` varchar(20) NOT NULL COMMENT '紧急联系人电话',
|
||||
`parent_consent` char(1) NOT NULL DEFAULT '1' COMMENT '家长同意(0否 1是)',
|
||||
|
||||
-- =============附件字段=============
|
||||
`attachment_oss_ids` varchar(1000) DEFAULT NULL COMMENT '附件OSS文件ID,多个用逗号分隔(申请材料、证明文件等)',
|
||||
|
||||
-- =============扩展字段=============
|
||||
`ext_field1` varchar(200) DEFAULT NULL COMMENT '扩展字段1',
|
||||
`ext_field2` varchar(200) DEFAULT NULL COMMENT '扩展字段2',
|
||||
`ext_field3` varchar(500) DEFAULT NULL COMMENT '扩展字段3',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '备注信息',
|
||||
|
||||
-- =============索引定义=============
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
|
||||
-- 基础索引(必须)
|
||||
KEY `idx_tenant_id` (`tenant_id`),
|
||||
KEY `idx_deleted` (`deleted`),
|
||||
KEY `idx_create_time` (`create_time`),
|
||||
KEY `idx_tenant_deleted` (`tenant_id`, `deleted`),
|
||||
|
||||
-- 业务索引
|
||||
KEY `idx_student_id` (`student_id`),
|
||||
KEY `idx_student_no` (`student_no`)
|
||||
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='假期留宿管理表';
|
||||
|
||||
-- =============表说明=============
|
||||
/*
|
||||
表功能说明:
|
||||
1. 支持学生假期留宿申请的全流程管理
|
||||
2. 记录申请信息、管理员处理信息、实际入住信息
|
||||
3. 支持费用管理和缴费状态跟踪
|
||||
4. 关联宿舍管理相关表(校区、宿舍区、宿舍楼、房间、床位)
|
||||
5. 支持附件上传和扩展字段
|
||||
6. 遵循项目数据库设计规范(强制性基础字段、雪花ID、逻辑删除)
|
||||
|
||||
状态说明:
|
||||
- 0:申请中 - 学生提交申请,等待管理员处理
|
||||
- 1:已安排 - 管理员已安排宿舍,可以入住
|
||||
- 2:已取消 - 申请被取消(管理员取消或学生取消)
|
||||
- 3:已入住 - 学生已办理入住手续
|
||||
- 4:已退宿 - 学生已办理退宿手续
|
||||
|
||||
使用场景:
|
||||
- 寒假、暑假期间学生留宿申请和管理
|
||||
- 春节、国庆等长假期间住宿管理
|
||||
- 宿舍管理员直接安排和管理假期留宿学生
|
||||
- 留宿费用收取和管理
|
||||
- 安全管理和紧急联系人管理
|
||||
- 简化流程,提高管理效率
|
||||
*/
|
||||
@@ -0,0 +1,40 @@
|
||||
-- ----------------------------
|
||||
-- 假期留宿管理相关字典数据
|
||||
-- 模块:学工管理-宿舍管理
|
||||
-- 功能:为假期留宿管理提供字典数据支持
|
||||
-- 创建时间:2025-01-27
|
||||
-- ----------------------------
|
||||
|
||||
-- =============假期类型字典=============
|
||||
-- 1. 假期类型字典类型
|
||||
INSERT INTO `sys_dict_type` (`dict_id`, `tenant_id`, `dict_name`, `dict_type`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
|
||||
VALUES (1700000001, '000000', '假期类型', 'xg_holiday_type', 1, now(), 1, now(), '学生假期留宿申请中的假期类型选项');
|
||||
|
||||
-- 2. 假期类型字典数据
|
||||
INSERT INTO `sys_dict_data` (`dict_code`, `tenant_id`, `sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES
|
||||
(1700000001, '000000', 1, '寒假', 'winter_vacation', 'xg_holiday_type', '', 'primary', 'N', 1, now(), 1, now(), '寒假期间留宿'),
|
||||
(1700000002, '000000', 2, '暑假', 'summer_vacation', 'xg_holiday_type', '', 'success', 'N', 1, now(), 1, now(), '暑假期间留宿'),
|
||||
(1700000003, '000000', 3, '春节假期', 'spring_festival', 'xg_holiday_type', '', 'warning', 'N', 1, now(), 1, now(), '春节长假期间留宿'),
|
||||
(1700000004, '000000', 4, '国庆假期', 'national_day', 'xg_holiday_type', '', 'info', 'N', 1, now(), 1, now(), '国庆长假期间留宿'),
|
||||
(1700000005, '000000', 5, '五一假期', 'labor_day', 'xg_holiday_type', '', 'default', 'N', 1, now(), 1, now(), '五一假期留宿'),
|
||||
(1700000006, '000000', 6, '清明假期', 'tomb_sweeping_day', 'xg_holiday_type', '', 'default', 'N', 1, now(), 1, now(), '清明假期留宿'),
|
||||
(1700000007, '000000', 7, '端午假期', 'dragon_boat_festival', 'xg_holiday_type', '', 'default', 'N', 1, now(), 1, now(), '端午假期留宿'),
|
||||
(1700000008, '000000', 8, '中秋假期', 'mid_autumn_festival', 'xg_holiday_type', '', 'default', 'N', 1, now(), 1, now(), '中秋假期留宿'),
|
||||
(1700000009, '000000', 9, '其他假期', 'other_holiday', 'xg_holiday_type', '', 'default', 'N', 1, now(), 1, now(), '其他类型假期留宿');
|
||||
|
||||
-- =============留宿原因类型字典=============
|
||||
-- 1. 留宿原因类型字典类型
|
||||
INSERT INTO `sys_dict_type` (`dict_id`, `tenant_id`, `dict_name`, `dict_type`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
|
||||
VALUES (1700000002, '000000', '留宿原因类型', 'xg_stay_reason_type', 1, now(), 1, now(), '学生假期留宿的原因类型分类');
|
||||
|
||||
-- 2. 留宿原因类型字典数据
|
||||
INSERT INTO `sys_dict_data` (`dict_code`, `tenant_id`, `sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES
|
||||
(1700000011, '000000', 1, '学习研究', 'study', 'xg_stay_reason_type', '', 'primary', 'Y', 1, now(), 1, now(), '因学习、科研等需要留宿'),
|
||||
(1700000012, '000000', 2, '实习工作', 'internship', 'xg_stay_reason_type', '', 'success', 'N', 1, now(), 1, now(), '因实习、兼职工作等需要留宿'),
|
||||
(1700000013, '000000', 3, '家庭困难', 'family_difficulty', 'xg_stay_reason_type', '', 'warning', 'N', 1, now(), 1, now(), '因家庭经济困难无法回家'),
|
||||
(1700000014, '000000', 4, '路程遥远', 'long_distance', 'xg_stay_reason_type', '', 'info', 'N', 1, now(), 1, now(), '因家距离学校较远,回家不便'),
|
||||
(1700000015, '000000', 5, '考试准备', 'exam_preparation', 'xg_stay_reason_type', '', 'primary', 'N', 1, now(), 1, now(), '因准备各类考试需要留宿'),
|
||||
(1700000016, '000000', 6, '项目开发', 'project_development', 'xg_stay_reason_type', '', 'success', 'N', 1, now(), 1, now(), '因参与项目开发需要留宿'),
|
||||
(1700000017, '000000', 7, '社会实践', 'social_practice', 'xg_stay_reason_type', '', 'info', 'N', 1, now(), 1, now(), '因参与社会实践活动需要留宿'),
|
||||
(1700000018, '000000', 8, '身体原因', 'health_reason', 'xg_stay_reason_type', '', 'warning', 'N', 1, now(), 1, now(), '因身体健康原因无法回家'),
|
||||
(1700000019, '000000', 9, '其他原因', 'other', 'xg_stay_reason_type', '', 'default', 'N', 1, now(), 1, now(), '其他特殊原因');
|
||||
@@ -0,0 +1,259 @@
|
||||
-- ----------------------------
|
||||
-- 假期留宿管理表示例数据(简化流程版)
|
||||
-- 模块:学工管理-宿舍管理
|
||||
-- 功能:提供假期留宿管理的测试和演示数据
|
||||
-- 创建时间:2025-01-27
|
||||
-- 更新时间:2025-01-27 - 简化流程,移除审批环节
|
||||
-- 注意:本文件仅用于开发测试,生产环境请勿执行
|
||||
-- ----------------------------
|
||||
|
||||
-- =============示例数据说明=============
|
||||
/*
|
||||
示例数据涵盖以下简化后的流程场景:
|
||||
1. 申请中 - 学生刚提交的申请
|
||||
2. 已安排 - 管理员已安排宿舍
|
||||
3. 已取消 - 申请被取消
|
||||
4. 已入住 - 正在留宿中
|
||||
5. 已退宿 - 完成留宿流程
|
||||
|
||||
涵盖多种假期类型和留宿原因,提供完整的业务场景测试数据
|
||||
新流程:学生申请 → 管理员直接安排 → 入住 → 退宿
|
||||
*/
|
||||
|
||||
-- 清理现有示例数据(开发环境)
|
||||
-- DELETE FROM xg_holiday_stay WHERE tenant_id = '000000' AND remark LIKE '%示例数据%';
|
||||
|
||||
-- =============示例数据1:申请中的寒假留宿申请=============
|
||||
INSERT INTO `xg_holiday_stay` (
|
||||
`id`, `tenant_id`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `deleted`,
|
||||
`student_id`, `student_name`, `student_no`, `class_id`, `class_name`, `major_id`, `major_name`, `college_id`, `college_name`,
|
||||
`holiday_type`, `apply_start_date`, `apply_end_date`, `stay_duration`, `stay_reason`, `stay_reason_type`,
|
||||
`student_phone`, `emergency_contact`, `emergency_phone`, `emergency_relation`, `parent_consent`,
|
||||
`status`, `safety_commitment`, `rule_commitment`,
|
||||
`accommodation_fee`, `water_fee`, `electricity_fee`, `total_fee`, `payment_status`,
|
||||
`remark`
|
||||
) VALUES (
|
||||
1800000001, '000000', 103, 2001, now(), 2001, now(), 0,
|
||||
2100000001, '张三', '2021001001', 2200000001, '计算机科学与技术2021级1班', 2300000001, '计算机科学与技术', 2400000001, '信息工程学院',
|
||||
'winter_vacation', '2025-01-25', '2025-02-20', 26, '需要准备研究生入学考试,寒假期间需要在图书馆学习', 'exam_preparation',
|
||||
'13812345001', '张父', '13812345002', 'father', '1',
|
||||
'0', '1', '1',
|
||||
200.00, 50.00, 100.00, 350.00, '0',
|
||||
'示例数据 - 申请中的寒假留宿申请'
|
||||
);
|
||||
|
||||
-- =============示例数据2:已安排的暑假留宿申请=============
|
||||
INSERT INTO `xg_holiday_stay` (
|
||||
`id`, `tenant_id`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `deleted`,
|
||||
`student_id`, `student_name`, `student_no`, `class_id`, `class_name`, `major_id`, `major_name`, `college_id`, `college_name`,
|
||||
`campus_id`, `campus_name`, `area_id`, `area_name`, `building_id`, `building_name`, `room_id`, `room_name`, `bed_id`, `bed_name`,
|
||||
`holiday_type`, `apply_start_date`, `apply_end_date`, `stay_duration`, `stay_reason`, `stay_reason_type`,
|
||||
`student_phone`, `emergency_contact`, `emergency_phone`, `emergency_relation`, `parent_consent`,
|
||||
`status`, `handle_by`, `handle_name`, `handle_time`, `handle_remark`,
|
||||
`safety_commitment`, `rule_commitment`,
|
||||
`manager_id`, `manager_name`,
|
||||
`accommodation_fee`, `water_fee`, `electricity_fee`, `total_fee`, `payment_status`,
|
||||
`remark`
|
||||
) VALUES (
|
||||
1800000002, '000000', 103, 2001, now(), 2001, now(), 0,
|
||||
2100000002, '李四', '2021001002', 2200000002, '软件工程2021级1班', 2300000002, '软件工程', 2400000001, '信息工程学院',
|
||||
3100000001, '主校区', 3200000001, '学生宿舍区A区', 3300000001, 'A1栋', 3400000002, 'A1-102', 3500000002, 'A1-102-1',
|
||||
'summer_vacation', '2024-07-15', '2024-08-25', 41, '参与导师的科研项目开发,需要在暑假期间继续在实验室工作', 'project_development',
|
||||
'13812345003', '李母', '13812345004', 'mother', '1',
|
||||
'1', 4001, '王宿管', '2024-07-10 14:30:00', '科研需要,已安排A1-102床位,请及时缴费',
|
||||
'1', '1',
|
||||
4100000001, '王宿管',
|
||||
300.00, 80.00, 150.00, 530.00, '1',
|
||||
'示例数据 - 已安排的暑假留宿申请'
|
||||
);
|
||||
|
||||
-- =============示例数据3:已取消的国庆留宿申请=============
|
||||
INSERT INTO `xg_holiday_stay` (
|
||||
`id`, `tenant_id`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `deleted`,
|
||||
`student_id`, `student_name`, `student_no`, `class_id`, `class_name`, `major_id`, `major_name`, `college_id`, `college_name`,
|
||||
`holiday_type`, `apply_start_date`, `apply_end_date`, `stay_duration`, `stay_reason`, `stay_reason_type`,
|
||||
`student_phone`, `emergency_contact`, `emergency_phone`, `emergency_relation`, `parent_consent`,
|
||||
`status`, `handle_by`, `handle_name`, `handle_time`, `handle_remark`,
|
||||
`safety_commitment`, `rule_commitment`,
|
||||
`remark`
|
||||
) VALUES (
|
||||
1800000003, '000000', 103, 2001, now(), 2001, now(), 0,
|
||||
2100000003, '王五', '2021001003', 2200000003, '电子信息工程2021级1班', 2300000003, '电子信息工程', 2400000001, '信息工程学院',
|
||||
'national_day', '2024-10-01', '2024-10-07', 7, '想在国庆假期打游戏和追剧,不想回家', 'other',
|
||||
'13812345005', '王父', '13812345006', 'father', '1',
|
||||
'2', 4001, '王宿管', '2024-09-28 16:45:00', '申请理由不充分,国庆假期建议回家与家人团聚',
|
||||
'1', '1',
|
||||
'示例数据 - 已取消的国庆留宿申请'
|
||||
);
|
||||
|
||||
-- =============示例数据4:学生取消的春节留宿申请=============
|
||||
INSERT INTO `xg_holiday_stay` (
|
||||
`id`, `tenant_id`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `deleted`,
|
||||
`student_id`, `student_name`, `student_no`, `class_id`, `class_name`, `major_id`, `major_name`, `college_id`, `college_name`,
|
||||
`holiday_type`, `apply_start_date`, `apply_end_date`, `stay_duration`, `stay_reason`, `stay_reason_type`,
|
||||
`student_phone`, `emergency_contact`, `emergency_phone`, `emergency_relation`, `parent_consent`,
|
||||
`status`, `handle_by`, `handle_name`, `handle_time`, `handle_remark`,
|
||||
`safety_commitment`, `rule_commitment`,
|
||||
`remark`
|
||||
) VALUES (
|
||||
1800000004, '000000', 103, 2001, now(), 2001, now(), 0,
|
||||
2100000004, '赵六', '2021001004', 2200000004, '网络工程2021级1班', 2300000004, '网络工程', 2400000001, '信息工程学院',
|
||||
'spring_festival', '2025-01-28', '2025-02-15', 18, '家庭困难,路费较贵,春节期间计划留校', 'family_difficulty',
|
||||
'13812345007', '赵母', '13812345008', 'mother', '1',
|
||||
'2', 2001, '赵六', '2025-01-26 10:00:00', '学生主动取消,已联系到回家车票',
|
||||
'1', '1',
|
||||
'示例数据 - 学生主动取消的春节留宿申请'
|
||||
);
|
||||
|
||||
-- =============示例数据5:已入住的寒假留宿(当前进行中)=============
|
||||
INSERT INTO `xg_holiday_stay` (
|
||||
`id`, `tenant_id`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `deleted`,
|
||||
`student_id`, `student_name`, `student_no`, `class_id`, `class_name`, `major_id`, `major_name`, `college_id`, `college_name`,
|
||||
`campus_id`, `campus_name`, `area_id`, `area_name`, `building_id`, `building_name`, `room_id`, `room_name`, `bed_id`, `bed_name`,
|
||||
`holiday_type`, `apply_start_date`, `apply_end_date`, `stay_duration`, `stay_reason`, `stay_reason_type`,
|
||||
`student_phone`, `emergency_contact`, `emergency_phone`, `emergency_relation`, `parent_consent`,
|
||||
`status`, `handle_by`, `handle_name`, `handle_time`, `handle_remark`,
|
||||
`actual_checkin_date`, `checkin_by`, `checkin_by_name`,
|
||||
`safety_commitment`, `rule_commitment`,
|
||||
`manager_id`, `manager_name`,
|
||||
`accommodation_fee`, `water_fee`, `electricity_fee`, `total_fee`, `payment_status`, `payment_time`,
|
||||
`remark`
|
||||
) VALUES (
|
||||
1800000005, '000000', 103, 2001, now(), 2001, now(), 0,
|
||||
2100000005, '钱七', '2021001005', 2200000005, '信息安全2021级1班', 2300000005, '信息安全', 2400000001, '信息工程学院',
|
||||
3100000001, '主校区', 3200000001, '学生宿舍区A区', 3300000001, 'A1栋', 3400000003, 'A1-103', 3500000003, 'A1-103-1',
|
||||
'winter_vacation', '2025-01-20', '2025-02-25', 36, '参与学校实习项目,需要每天到实验室工作', 'internship',
|
||||
'13812345009', '钱父', '13812345010', 'father', '1',
|
||||
'3', 4001, '王宿管', '2025-01-15 10:20:00', '实习项目重要,已安排A1-103床位',
|
||||
'2025-01-20', 4002, '李宿管',
|
||||
'1', '1',
|
||||
4100000001, '王宿管',
|
||||
400.00, 100.00, 200.00, 700.00, '1', '2025-01-18 15:30:00',
|
||||
'示例数据 - 已入住的寒假留宿(当前进行中)'
|
||||
);
|
||||
|
||||
-- =============示例数据6:已完成的暑假留宿(已退宿)=============
|
||||
INSERT INTO `xg_holiday_stay` (
|
||||
`id`, `tenant_id`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `deleted`,
|
||||
`student_id`, `student_name`, `student_no`, `class_id`, `class_name`, `major_id`, `major_name`, `college_id`, `college_name`,
|
||||
`campus_id`, `campus_name`, `area_id`, `area_name`, `building_id`, `building_name`, `room_id`, `room_name`, `bed_id`, `bed_name`,
|
||||
`holiday_type`, `apply_start_date`, `apply_end_date`, `stay_duration`, `stay_reason`, `stay_reason_type`,
|
||||
`student_phone`, `emergency_contact`, `emergency_phone`, `emergency_relation`, `parent_consent`,
|
||||
`status`, `handle_by`, `handle_name`, `handle_time`, `handle_remark`,
|
||||
`actual_checkin_date`, `actual_checkout_date`, `actual_stay_duration`,
|
||||
`checkin_by`, `checkin_by_name`, `checkout_by`, `checkout_by_name`,
|
||||
`safety_commitment`, `rule_commitment`,
|
||||
`manager_id`, `manager_name`,
|
||||
`accommodation_fee`, `water_fee`, `electricity_fee`, `total_fee`, `payment_status`, `payment_time`,
|
||||
`special_requirements`,
|
||||
`remark`
|
||||
) VALUES (
|
||||
1800000006, '000000', 103, 2001, now(), 2001, now(), 0,
|
||||
2100000006, '孙八', '2021001006', 2200000006, '物联网工程2021级1班', 2300000006, '物联网工程', 2400000001, '信息工程学院',
|
||||
3100000001, '主校区', 3200000001, '学生宿舍区A区', 3300000001, 'A1栋', 3400000004, 'A1-104', 3500000004, 'A1-104-1',
|
||||
'summer_vacation', '2024-07-10', '2024-08-20', 41, '准备各类证书考试,暑假需要集中学习', 'exam_preparation',
|
||||
'13812345011', '孙母', '13812345012', 'mother', '1',
|
||||
'4', 4001, '王宿管', '2024-07-05 09:15:00', '学习计划详细,安排到安静房间',
|
||||
'2024-07-10', '2024-08-20', 41,
|
||||
4002, '李宿管', 4002, '李宿管',
|
||||
'1', '1',
|
||||
4100000001, '王宿管',
|
||||
350.00, 90.00, 160.00, 600.00, '1', '2024-07-08 14:20:00',
|
||||
'学生要求安静的学习环境,已安排到相对安静的房间',
|
||||
'示例数据 - 已完成的暑假留宿(已退宿)'
|
||||
);
|
||||
|
||||
-- =============示例数据7:家庭困难的五一留宿申请(已安排)=============
|
||||
INSERT INTO `xg_holiday_stay` (
|
||||
`id`, `tenant_id`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `deleted`,
|
||||
`student_id`, `student_name`, `student_no`, `class_id`, `class_name`, `major_id`, `major_name`, `college_id`, `college_name`,
|
||||
`campus_id`, `campus_name`, `area_id`, `area_name`, `building_id`, `building_name`, `room_id`, `room_name`, `bed_id`, `bed_name`,
|
||||
`holiday_type`, `apply_start_date`, `apply_end_date`, `stay_duration`, `stay_reason`, `stay_reason_type`,
|
||||
`student_phone`, `emergency_contact`, `emergency_phone`, `emergency_relation`, `parent_consent`,
|
||||
`status`, `handle_by`, `handle_name`, `handle_time`, `handle_remark`,
|
||||
`safety_commitment`, `rule_commitment`,
|
||||
`manager_id`, `manager_name`,
|
||||
`accommodation_fee`, `water_fee`, `electricity_fee`, `total_fee`, `payment_status`,
|
||||
`attachment_oss_ids`,
|
||||
`remark`
|
||||
) VALUES (
|
||||
1800000007, '000000', 103, 2001, now(), 2001, now(), 0,
|
||||
2100000007, '周九', '2021001007', 2200000007, '数据科学与大数据技术2021级1班', 2300000007, '数据科学与大数据技术', 2400000002, '数学与统计学院',
|
||||
3100000001, '主校区', 3200000002, '学生宿舍区B区', 3300000002, 'B1栋', 3400000005, 'B1-101', 3500000005, 'B1-101-1',
|
||||
'labor_day', '2024-05-01', '2024-05-05', 5, '家庭经济困难,路费负担较重,五一假期申请留校', 'family_difficulty',
|
||||
'13812345013', '周父', '13812345014', 'father', '1',
|
||||
'1', 4003, '张宿管', '2024-04-28 11:40:00', '家庭情况属实,给予照顾,已安排B1-101床位',
|
||||
'1', '1',
|
||||
4100000002, '张宿管',
|
||||
50.00, 20.00, 30.00, 100.00, '0',
|
||||
'oss_id_001,oss_id_002',
|
||||
'示例数据 - 家庭困难的五一留宿申请,已上传贫困证明材料'
|
||||
);
|
||||
|
||||
-- =============示例数据8:路程遥远的端午留宿申请=============
|
||||
INSERT INTO `xg_holiday_stay` (
|
||||
`id`, `tenant_id`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `deleted`,
|
||||
`student_id`, `student_name`, `student_no`, `class_id`, `class_name`, `major_id`, `major_name`, `college_id`, `college_name`,
|
||||
`holiday_type`, `apply_start_date`, `apply_end_date`, `stay_duration`, `stay_reason`, `stay_reason_type`,
|
||||
`student_phone`, `emergency_contact`, `emergency_phone`, `emergency_relation`, `parent_consent`,
|
||||
`status`, `safety_commitment`, `rule_commitment`,
|
||||
`accommodation_fee`, `water_fee`, `electricity_fee`, `total_fee`, `payment_status`,
|
||||
`ext_field1`, `ext_field2`,
|
||||
`remark`
|
||||
) VALUES (
|
||||
1800000008, '000000', 103, 2001, now(), 2001, now(), 0,
|
||||
2100000008, '吴十', '2021001008', 2200000008, '应用数学2021级1班', 2300000008, '应用数学', 2400000002, '数学与统计学院',
|
||||
'dragon_boat_festival', '2024-06-08', '2024-06-10', 3, '家在新疆,路程遥远,端午假期只有3天时间,来回路程就需要2天,申请留校', 'long_distance',
|
||||
'13812345015', '吴母', '13812345016', 'mother', '1',
|
||||
'0', '1', '1',
|
||||
30.00, 10.00, 20.00, 60.00, '0',
|
||||
'学生家庭地址:新疆乌鲁木齐市', '单程需要1天时间',
|
||||
'示例数据 - 路程遥远的端午留宿申请'
|
||||
);
|
||||
|
||||
-- =============统计信息查询=============
|
||||
/*
|
||||
-- 查看示例数据统计
|
||||
SELECT
|
||||
holiday_type AS '假期类型',
|
||||
status AS '申请状态',
|
||||
COUNT(*) AS '数量'
|
||||
FROM xg_holiday_stay
|
||||
WHERE remark LIKE '%示例数据%'
|
||||
GROUP BY holiday_type, status
|
||||
ORDER BY holiday_type, status;
|
||||
|
||||
-- 查看不同留宿原因统计
|
||||
SELECT
|
||||
stay_reason_type AS '留宿原因类型',
|
||||
COUNT(*) AS '数量'
|
||||
FROM xg_holiday_stay
|
||||
WHERE remark LIKE '%示例数据%'
|
||||
GROUP BY stay_reason_type
|
||||
ORDER BY COUNT(*) DESC;
|
||||
|
||||
-- 查看费用统计
|
||||
SELECT
|
||||
AVG(total_fee) AS '平均费用',
|
||||
MAX(total_fee) AS '最高费用',
|
||||
MIN(total_fee) AS '最低费用',
|
||||
SUM(CASE WHEN payment_status = '1' THEN total_fee ELSE 0 END) AS '已收费用'
|
||||
FROM xg_holiday_stay
|
||||
WHERE remark LIKE '%示例数据%';
|
||||
|
||||
-- 查看简化流程状态分布
|
||||
SELECT
|
||||
CASE status
|
||||
WHEN '0' THEN '申请中'
|
||||
WHEN '1' THEN '已安排'
|
||||
WHEN '2' THEN '已取消'
|
||||
WHEN '3' THEN '已入住'
|
||||
WHEN '4' THEN '已退宿'
|
||||
ELSE '未知状态'
|
||||
END AS '状态',
|
||||
COUNT(*) AS '数量'
|
||||
FROM xg_holiday_stay
|
||||
WHERE remark LIKE '%示例数据%'
|
||||
GROUP BY status
|
||||
ORDER BY status;
|
||||
*/
|
||||
Reference in new issue
Block a user