360 lines
24 KiB
SQL
360 lines
24 KiB
SQL
-- ==========================================
|
|
-- 学生信息管理系统 - 数据统计分析功能初始化脚本
|
|
-- 版本:V1.0.0
|
|
-- 创建时间:2025-01-17
|
|
-- 说明:初始化统计分析功能的配置数据和预设模板
|
|
-- ==========================================
|
|
|
|
USE hzdyjs_xg;
|
|
|
|
-- ==========================================
|
|
-- 1. 统计分析配置数据初始化
|
|
-- ==========================================
|
|
|
|
-- 清理现有配置(如果存在)
|
|
DELETE FROM xg_statistics_config WHERE config_type IN ('dimension', 'report', 'chart');
|
|
|
|
-- 1.1 统计维度配置
|
|
INSERT INTO xg_statistics_config (
|
|
id, tenant_id, config_name, config_code, config_type, config_content,
|
|
is_system, is_enabled, sort_order, view_permissions, edit_permissions,
|
|
create_by, create_time, update_by, update_time, deleted, remark
|
|
) VALUES
|
|
-- 二级学院统计
|
|
(1745400000000000001, '000000', '二级学院统计', 'COLLEGE_STATISTICS', 'dimension',
|
|
'{"field": "college_name", "title": "二级学院统计", "type": "bar", "groupBy": "college_name", "countField": "id", "description": "按二级学院维度统计学生数量分布"}',
|
|
1, 1, 1, '["student_affairs", "college_admin"]', '["student_affairs"]',
|
|
1, NOW(), 1, NOW(), 0, '按二级学院维度统计学生数量分布'),
|
|
|
|
-- 年龄统计
|
|
(1745400000000000002, '000000', '年龄统计', 'AGE_STATISTICS', 'dimension',
|
|
'{"field": "birth_date", "title": "年龄统计", "type": "pie", "groupBy": "age_group", "countField": "id", "ageGroups": ["18-20", "21-23", "24-26", "27+"], "description": "按年龄段统计学生数量分布"}',
|
|
1, 1, 2, '["student_affairs", "college_admin", "counselor"]', '["student_affairs"]',
|
|
1, NOW(), 1, NOW(), 0, '按年龄段统计学生数量分布'),
|
|
|
|
-- 专业统计
|
|
(1745400000000000003, '000000', '专业统计', 'MAJOR_STATISTICS', 'dimension',
|
|
'{"field": "major_name", "title": "专业统计", "type": "bar", "groupBy": "major_name", "countField": "id", "description": "按专业维度统计学生数量分布"}',
|
|
1, 1, 3, '["student_affairs", "college_admin"]', '["student_affairs", "college_admin"]',
|
|
1, NOW(), 1, NOW(), 0, '按专业维度统计学生数量分布'),
|
|
|
|
-- 政治面貌统计
|
|
(1745400000000000004, '000000', '政治面貌统计', 'POLITICAL_STATUS_STATISTICS', 'dimension',
|
|
'{"field": "political_status", "title": "政治面貌统计", "type": "pie", "groupBy": "political_status", "countField": "id", "description": "按政治面貌统计学生数量分布"}',
|
|
1, 1, 4, '["student_affairs", "college_admin"]', '["student_affairs"]',
|
|
1, NOW(), 1, NOW(), 0, '按政治面貌统计学生数量分布'),
|
|
|
|
-- 民族统计
|
|
(1745400000000000005, '000000', '民族统计', 'NATIONALITY_STATISTICS', 'dimension',
|
|
'{"field": "nationality", "title": "民族统计", "type": "bar", "groupBy": "nationality", "countField": "id", "description": "按民族统计学生数量分布"}',
|
|
1, 1, 5, '["student_affairs", "college_admin"]', '["student_affairs"]',
|
|
1, NOW(), 1, NOW(), 0, '按民族统计学生数量分布'),
|
|
|
|
-- 生源地统计
|
|
(1745400000000000006, '000000', '生源地统计', 'SOURCE_REGION_STATISTICS', 'dimension',
|
|
'{"field": "source_region", "title": "生源地统计", "type": "map", "groupBy": "source_region", "countField": "id", "description": "按生源地统计学生数量分布"}',
|
|
1, 1, 6, '["student_affairs", "college_admin"]', '["student_affairs"]',
|
|
1, NOW(), 1, NOW(), 0, '按生源地统计学生数量分布'),
|
|
|
|
-- 性别统计
|
|
(1745400000000000007, '000000', '性别统计', 'GENDER_STATISTICS', 'dimension',
|
|
'{"field": "gender", "title": "性别统计", "type": "pie", "groupBy": "gender", "countField": "id", "description": "按性别统计学生数量分布"}',
|
|
1, 1, 7, '["student_affairs", "college_admin", "counselor", "class_teacher"]', '["student_affairs"]',
|
|
1, NOW(), 1, NOW(), 0, '按性别统计学生数量分布'),
|
|
|
|
-- 血型统计
|
|
(1745400000000000008, '000000', '血型统计', 'BLOOD_TYPE_STATISTICS', 'dimension',
|
|
'{"field": "blood_type", "title": "血型统计", "type": "pie", "groupBy": "blood_type", "countField": "id", "description": "按血型统计学生数量分布"}',
|
|
1, 1, 8, '["student_affairs", "college_admin"]', '["student_affairs"]',
|
|
1, NOW(), 1, NOW(), 0, '按血型统计学生数量分布'),
|
|
|
|
-- 学籍状态统计
|
|
(1745400000000000009, '000000', '学籍状态统计', 'STUDENT_STATUS_STATISTICS', 'dimension',
|
|
'{"field": "student_status", "title": "学籍状态统计", "type": "bar", "groupBy": "student_status", "countField": "id", "description": "按学籍状态统计学生数量分布"}',
|
|
1, 1, 9, '["student_affairs", "college_admin", "counselor"]', '["student_affairs"]',
|
|
1, NOW(), 1, NOW(), 0, '按学籍状态统计学生数量分布'),
|
|
|
|
-- 培养方式统计
|
|
(1745400000000000010, '000000', '培养方式统计', 'TRAINING_TYPE_STATISTICS', 'dimension',
|
|
'{"field": "training_type", "title": "培养方式统计", "type": "pie", "groupBy": "training_type", "countField": "id", "description": "按培养方式统计学生数量分布"}',
|
|
1, 1, 10, '["student_affairs", "college_admin"]', '["student_affairs"]',
|
|
1, NOW(), 1, NOW(), 0, '按培养方式统计学生数量分布'),
|
|
|
|
-- 身高统计
|
|
(1745400000000000011, '000000', '身高统计', 'HEIGHT_STATISTICS', 'dimension',
|
|
'{"field": "height", "title": "身高统计", "type": "histogram", "groupBy": "height_range", "countField": "id", "heightRanges": ["<160", "160-170", "170-180", "180+"], "description": "按身高范围统计学生数量分布"}',
|
|
1, 1, 11, '["student_affairs", "college_admin"]', '["student_affairs"]',
|
|
1, NOW(), 1, NOW(), 0, '按身高范围统计学生数量分布'),
|
|
|
|
-- 体重统计
|
|
(1745400000000000012, '000000', '体重统计', 'WEIGHT_STATISTICS', 'dimension',
|
|
'{"field": "weight", "title": "体重统计", "type": "histogram", "groupBy": "weight_range", "countField": "id", "weightRanges": ["<50", "50-60", "60-70", "70-80", "80+"], "description": "按体重范围统计学生数量分布"}',
|
|
1, 1, 12, '["student_affairs", "college_admin"]', '["student_affairs"]',
|
|
1, NOW(), 1, NOW(), 0, '按体重范围统计学生数量分布'),
|
|
|
|
-- 宗教信仰统计
|
|
(1745400000000000013, '000000', '宗教信仰统计', 'RELIGION_STATISTICS', 'dimension',
|
|
'{"field": "religion", "title": "宗教信仰统计", "type": "pie", "groupBy": "religion", "countField": "id", "description": "按宗教信仰统计学生数量分布"}',
|
|
1, 1, 13, '["student_affairs", "college_admin"]', '["student_affairs"]',
|
|
1, NOW(), 1, NOW(), 0, '按宗教信仰统计学生数量分布');
|
|
|
|
-- 1.2 报表配置
|
|
INSERT INTO xg_statistics_config (
|
|
id, tenant_id, config_name, config_code, config_type, config_content,
|
|
is_system, is_enabled, sort_order, view_permissions, edit_permissions,
|
|
create_by, create_time, update_by, update_time, deleted, remark
|
|
) VALUES
|
|
-- 学生信息汇总报表
|
|
(1745400000000000101, '000000', '学生信息汇总报表', 'STUDENT_SUMMARY_REPORT', 'report',
|
|
'{"title": "学生信息汇总报表", "type": "table", "columns": ["student_no", "name", "gender", "college_name", "major_name", "class_name", "student_status"], "filters": ["college_name", "major_name", "student_status"], "export": true, "description": "学生基本信息汇总统计报表"}',
|
|
1, 1, 1, '["student_affairs", "college_admin", "counselor"]', '["student_affairs"]',
|
|
1, NOW(), 1, NOW(), 0, '学生基本信息汇总统计报表'),
|
|
|
|
-- 班级统计报表
|
|
(1745400000000000102, '000000', '班级统计报表', 'CLASS_STATISTICS_REPORT', 'report',
|
|
'{"title": "班级统计报表", "type": "table", "columns": ["class_name", "total_students", "male_count", "female_count", "counselor_name", "class_teacher_name"], "filters": ["college_name", "grade"], "export": true, "description": "班级学生统计报表"}',
|
|
1, 1, 2, '["student_affairs", "college_admin", "counselor", "class_teacher"]', '["student_affairs", "college_admin"]',
|
|
1, NOW(), 1, NOW(), 0, '班级学生统计报表'),
|
|
|
|
-- 学院统计报表
|
|
(1745400000000000103, '000000', '学院统计报表', 'COLLEGE_STATISTICS_REPORT', 'report',
|
|
'{"title": "学院统计报表", "type": "table", "columns": ["college_name", "total_students", "male_count", "female_count", "major_count", "class_count"], "filters": ["college_name"], "export": true, "description": "学院学生统计报表"}',
|
|
1, 1, 3, '["student_affairs", "college_admin"]', '["student_affairs"]',
|
|
1, NOW(), 1, NOW(), 0, '学院学生统计报表'),
|
|
|
|
-- 困难学生统计报表
|
|
(1745400000000000104, '000000', '困难学生统计报表', 'POOR_STUDENT_REPORT', 'report',
|
|
'{"title": "困难学生统计报表", "type": "table", "columns": ["student_no", "name", "gender", "college_name", "major_name", "class_name", "family_economic_status"], "filters": ["college_name", "major_name", "family_economic_status"], "export": true, "description": "困难学生统计报表"}',
|
|
1, 1, 4, '["student_affairs", "college_admin", "counselor"]', '["student_affairs"]',
|
|
1, NOW(), 1, NOW(), 0, '困难学生统计报表'),
|
|
|
|
-- 特殊群体统计报表
|
|
(1745400000000000105, '000000', '特殊群体统计报表', 'SPECIAL_GROUP_REPORT', 'report',
|
|
'{"title": "特殊群体统计报表", "type": "table", "columns": ["student_no", "name", "gender", "college_name", "is_minority", "is_disabled", "is_orphan", "is_left_behind_child"], "filters": ["college_name", "is_minority", "is_disabled"], "export": true, "description": "特殊群体学生统计报表"}',
|
|
1, 1, 5, '["student_affairs", "college_admin"]', '["student_affairs"]',
|
|
1, NOW(), 1, NOW(), 0, '特殊群体学生统计报表');
|
|
|
|
-- 1.3 图表配置
|
|
INSERT INTO xg_statistics_config (
|
|
id, tenant_id, config_name, config_code, config_type, config_content,
|
|
is_system, is_enabled, sort_order, view_permissions, edit_permissions,
|
|
create_by, create_time, update_by, update_time, deleted, remark
|
|
) VALUES
|
|
-- 学生数量趋势图
|
|
(1745400000000000201, '000000', '学生数量趋势图', 'STUDENT_TREND_CHART', 'chart',
|
|
'{"title": "学生数量趋势图", "type": "line", "xAxis": "enrollment_year", "yAxis": "student_count", "series": ["total", "male", "female"], "description": "学生数量按年度变化趋势图"}',
|
|
1, 1, 1, '["student_affairs", "college_admin"]', '["student_affairs"]',
|
|
1, NOW(), 1, NOW(), 0, '学生数量按年度变化趋势图'),
|
|
|
|
-- 学院分布饼图
|
|
(1745400000000000202, '000000', '学院分布饼图', 'COLLEGE_DISTRIBUTION_PIE', 'chart',
|
|
'{"title": "学院分布饼图", "type": "pie", "dimension": "college_name", "measure": "student_count", "description": "学生在各学院的分布情况饼图"}',
|
|
1, 1, 2, '["student_affairs", "college_admin"]', '["student_affairs"]',
|
|
1, NOW(), 1, NOW(), 0, '学生在各学院的分布情况饼图'),
|
|
|
|
-- 专业分布柱状图
|
|
(1745400000000000203, '000000', '专业分布柱状图', 'MAJOR_DISTRIBUTION_BAR', 'chart',
|
|
'{"title": "专业分布柱状图", "type": "bar", "xAxis": "major_name", "yAxis": "student_count", "description": "学生在各专业的分布情况柱状图"}',
|
|
1, 1, 3, '["student_affairs", "college_admin"]', '["student_affairs"]',
|
|
1, NOW(), 1, NOW(), 0, '学生在各专业的分布情况柱状图'),
|
|
|
|
-- 性别比例图
|
|
(1745400000000000204, '000000', '性别比例图', 'GENDER_RATIO_CHART', 'chart',
|
|
'{"title": "性别比例图", "type": "pie", "dimension": "gender", "measure": "student_count", "colors": ["#409EFF", "#E6A23C"], "description": "学生性别比例分布图"}',
|
|
1, 1, 4, '["student_affairs", "college_admin", "counselor", "class_teacher"]', '["student_affairs"]',
|
|
1, NOW(), 1, NOW(), 0, '学生性别比例分布图'),
|
|
|
|
-- 学籍状态分布图
|
|
(1745400000000000205, '000000', '学籍状态分布图', 'STATUS_DISTRIBUTION_CHART', 'chart',
|
|
'{"title": "学籍状态分布图", "type": "bar", "xAxis": "student_status", "yAxis": "student_count", "description": "学生学籍状态分布图"}',
|
|
1, 1, 5, '["student_affairs", "college_admin", "counselor"]', '["student_affairs"]',
|
|
1, NOW(), 1, NOW(), 0, '学生学籍状态分布图');
|
|
|
|
-- ==========================================
|
|
-- 2. 数据权限配置初始化
|
|
-- ==========================================
|
|
|
|
-- 清理现有权限配置
|
|
DELETE FROM xg_data_permission WHERE permission_type = 'statistics';
|
|
|
|
-- 2.1 统计分析数据权限配置
|
|
INSERT INTO xg_data_permission (
|
|
id, tenant_id, user_id, user_name, permission_type, permission_scope,
|
|
scope_values, permission_level, is_enabled, effective_time, expire_time,
|
|
create_by, create_time, update_by, update_time, deleted, remark
|
|
) VALUES
|
|
-- 学生处管理员 - 全部统计权限
|
|
(1745500000000000001, '000000', 1, 'admin', 'statistics', 'all',
|
|
'ALL', 4, 1, NOW(), DATE_ADD(NOW(), INTERVAL 1 YEAR),
|
|
1, NOW(), 1, NOW(), 0, '学生处管理员拥有全部统计分析权限'),
|
|
|
|
-- 学院管理员 - 学院范围统计权限
|
|
(1745500000000000002, '000000', 2, 'college_admin', 'statistics', 'college',
|
|
'COLLEGE_SCOPE', 3, 1, NOW(), DATE_ADD(NOW(), INTERVAL 1 YEAR),
|
|
1, NOW(), 1, NOW(), 0, '学院管理员拥有本学院统计分析权限'),
|
|
|
|
-- 辅导员 - 负责学生统计权限
|
|
(1745500000000000003, '000000', 3, 'counselor', 'statistics', 'responsible',
|
|
'RESPONSIBLE_STUDENTS', 2, 1, NOW(), DATE_ADD(NOW(), INTERVAL 1 YEAR),
|
|
1, NOW(), 1, NOW(), 0, '辅导员拥有负责学生的统计分析权限'),
|
|
|
|
-- 班主任 - 班级统计权限
|
|
(1745500000000000004, '000000', 4, 'class_teacher', 'statistics', 'class',
|
|
'CLASS_SCOPE', 2, 1, NOW(), DATE_ADD(NOW(), INTERVAL 1 YEAR),
|
|
1, NOW(), 1, NOW(), 0, '班主任拥有负责班级的统计分析权限');
|
|
|
|
-- ==========================================
|
|
-- 3. 统计分析菜单权限初始化
|
|
-- ==========================================
|
|
|
|
-- 插入统计分析主菜单
|
|
INSERT INTO sys_menu (
|
|
menu_id, menu_name, parent_id, order_num, path, component, query_param,
|
|
is_frame, is_cache, menu_type, visible, status, perms, icon,
|
|
create_by, create_time, update_by, update_time, remark
|
|
) VALUES
|
|
-- 数据统计分析主菜单
|
|
(1300, '数据统计分析', 1200, 5, 'statistics', NULL, '',
|
|
1, 0, 'M', '0', '0', '', 'chart',
|
|
1, NOW(), 1, NOW(), '数据统计分析菜单'),
|
|
|
|
-- 统计维度分析
|
|
(1301, '统计维度分析', 1300, 1, 'dimension', 'xg-xx/statistics/dimension/index', '',
|
|
1, 0, 'C', '0', '0', 'xg:statistics:dimension:list', 'pie-chart',
|
|
1, NOW(), 1, NOW(), '统计维度分析菜单'),
|
|
|
|
-- 统计报表管理
|
|
(1302, '统计报表管理', 1300, 2, 'report', 'xg-xx/statistics/report/index', '',
|
|
1, 0, 'C', '0', '0', 'xg:statistics:report:list', 'table',
|
|
1, NOW(), 1, NOW(), '统计报表管理菜单'),
|
|
|
|
-- 统计图表管理
|
|
(1303, '统计图表管理', 1300, 3, 'chart', 'xg-xx/statistics/chart/index', '',
|
|
1, 0, 'C', '0', '0', 'xg:statistics:chart:list', 'bar-chart',
|
|
1, NOW(), 1, NOW(), '统计图表管理菜单'),
|
|
|
|
-- 统计配置管理
|
|
(1304, '统计配置管理', 1300, 4, 'config', 'xg-xx/statistics/config/index', '',
|
|
1, 0, 'C', '0', '0', 'xg:statistics:config:list', 'setting',
|
|
1, NOW(), 1, NOW(), '统计配置管理菜单');
|
|
|
|
-- 插入统计分析功能按钮
|
|
INSERT INTO sys_menu (
|
|
menu_id, menu_name, parent_id, order_num, path, component, query_param,
|
|
is_frame, is_cache, menu_type, visible, status, perms, icon,
|
|
create_by, create_time, update_by, update_time, remark
|
|
) VALUES
|
|
-- 统计维度分析按钮
|
|
(1311, '统计维度查询', 1301, 1, '', '', '', 1, 0, 'F', '0', '0', 'xg:statistics:dimension:query', '#', 1, NOW(), 1, NOW(), ''),
|
|
(1312, '统计维度导出', 1301, 2, '', '', '', 1, 0, 'F', '0', '0', 'xg:statistics:dimension:export', '#', 1, NOW(), 1, NOW(), ''),
|
|
(1313, '统计维度配置', 1301, 3, '', '', '', 1, 0, 'F', '0', '0', 'xg:statistics:dimension:config', '#', 1, NOW(), 1, NOW(), ''),
|
|
|
|
-- 统计报表管理按钮
|
|
(1321, '统计报表查询', 1302, 1, '', '', '', 1, 0, 'F', '0', '0', 'xg:statistics:report:query', '#', 1, NOW(), 1, NOW(), ''),
|
|
(1322, '统计报表生成', 1302, 2, '', '', '', 1, 0, 'F', '0', '0', 'xg:statistics:report:generate', '#', 1, NOW(), 1, NOW(), ''),
|
|
(1323, '统计报表导出', 1302, 3, '', '', '', 1, 0, 'F', '0', '0', 'xg:statistics:report:export', '#', 1, NOW(), 1, NOW(), ''),
|
|
(1324, '统计报表配置', 1302, 4, '', '', '', 1, 0, 'F', '0', '0', 'xg:statistics:report:config', '#', 1, NOW(), 1, NOW(), ''),
|
|
|
|
-- 统计图表管理按钮
|
|
(1331, '统计图表查询', 1303, 1, '', '', '', 1, 0, 'F', '0', '0', 'xg:statistics:chart:query', '#', 1, NOW(), 1, NOW(), ''),
|
|
(1332, '统计图表生成', 1303, 2, '', '', '', 1, 0, 'F', '0', '0', 'xg:statistics:chart:generate', '#', 1, NOW(), 1, NOW(), ''),
|
|
(1333, '统计图表导出', 1303, 3, '', '', '', 1, 0, 'F', '0', '0', 'xg:statistics:chart:export', '#', 1, NOW(), 1, NOW(), ''),
|
|
(1334, '统计图表配置', 1303, 4, '', '', '', 1, 0, 'F', '0', '0', 'xg:statistics:chart:config', '#', 1, NOW(), 1, NOW(), ''),
|
|
|
|
-- 统计配置管理按钮
|
|
(1341, '统计配置查询', 1304, 1, '', '', '', 1, 0, 'F', '0', '0', 'xg:statistics:config:query', '#', 1, NOW(), 1, NOW(), ''),
|
|
(1342, '统计配置新增', 1304, 2, '', '', '', 1, 0, 'F', '0', '0', 'xg:statistics:config:add', '#', 1, NOW(), 1, NOW(), ''),
|
|
(1343, '统计配置修改', 1304, 3, '', '', '', 1, 0, 'F', '0', '0', 'xg:statistics:config:edit', '#', 1, NOW(), 1, NOW(), ''),
|
|
(1344, '统计配置删除', 1304, 4, '', '', '', 1, 0, 'F', '0', '0', 'xg:statistics:config:remove', '#', 1, NOW(), 1, NOW(), ''),
|
|
(1345, '统计配置导出', 1304, 5, '', '', '', 1, 0, 'F', '0', '0', 'xg:statistics:config:export', '#', 1, NOW(), 1, NOW(), '');
|
|
|
|
-- ==========================================
|
|
-- 4. 统计分析字典数据初始化
|
|
-- ==========================================
|
|
|
|
-- 插入统计分析相关字典类型
|
|
INSERT INTO sys_dict_type (
|
|
dict_id, tenant_id, dict_name, dict_type, create_by, create_time,
|
|
update_by, update_time, remark
|
|
) VALUES
|
|
(1020, '000000', '统计图表类型', 'xg_chart_type', 1, NOW(), 1, NOW(), '统计图表类型列表'),
|
|
(1021, '000000', '统计维度类型', 'xg_dimension_type', 1, NOW(), 1, NOW(), '统计维度类型列表'),
|
|
(1022, '000000', '统计报表类型', 'xg_report_type', 1, NOW(), 1, NOW(), '统计报表类型列表'),
|
|
(1023, '000000', '数据权限范围', 'xg_permission_scope', 1, NOW(), 1, NOW(), '数据权限范围列表'),
|
|
(1024, '000000', '统计配置类型', 'xg_statistics_config_type', 1, NOW(), 1, NOW(), '统计配置类型列表');
|
|
|
|
-- 插入统计图表类型字典数据
|
|
INSERT INTO sys_dict_data (
|
|
dict_code, tenant_id, dict_sort, dict_label, dict_value, dict_type,
|
|
css_class, list_class, is_default, create_by, create_time,
|
|
update_by, update_time, remark
|
|
) VALUES
|
|
(2020001, '000000', 1, '柱状图', 'bar', 'xg_chart_type', '', 'primary', 'N', 1, NOW(), 1, NOW(), '柱状图'),
|
|
(2020002, '000000', 2, '饼图', 'pie', 'xg_chart_type', '', 'success', 'N', 1, NOW(), 1, NOW(), '饼图'),
|
|
(2020003, '000000', 3, '折线图', 'line', 'xg_chart_type', '', 'info', 'N', 1, NOW(), 1, NOW(), '折线图'),
|
|
(2020004, '000000', 4, '散点图', 'scatter', 'xg_chart_type', '', 'warning', 'N', 1, NOW(), 1, NOW(), '散点图'),
|
|
(2020005, '000000', 5, '直方图', 'histogram', 'xg_chart_type', '', 'danger', 'N', 1, NOW(), 1, NOW(), '直方图'),
|
|
(2020006, '000000', 6, '地图', 'map', 'xg_chart_type', '', 'default', 'N', 1, NOW(), 1, NOW(), '地图'),
|
|
(2020007, '000000', 7, '雷达图', 'radar', 'xg_chart_type', '', 'primary', 'N', 1, NOW(), 1, NOW(), '雷达图');
|
|
|
|
-- 插入统计维度类型字典数据
|
|
INSERT INTO sys_dict_data (
|
|
dict_code, tenant_id, dict_sort, dict_label, dict_value, dict_type,
|
|
css_class, list_class, is_default, create_by, create_time,
|
|
update_by, update_time, remark
|
|
) VALUES
|
|
(2021001, '000000', 1, '学院维度', 'college', 'xg_dimension_type', '', 'primary', 'N', 1, NOW(), 1, NOW(), '按学院统计'),
|
|
(2021002, '000000', 2, '专业维度', 'major', 'xg_dimension_type', '', 'success', 'N', 1, NOW(), 1, NOW(), '按专业统计'),
|
|
(2021003, '000000', 3, '班级维度', 'class', 'xg_dimension_type', '', 'info', 'N', 1, NOW(), 1, NOW(), '按班级统计'),
|
|
(2021004, '000000', 4, '年级维度', 'grade', 'xg_dimension_type', '', 'warning', 'N', 1, NOW(), 1, NOW(), '按年级统计'),
|
|
(2021005, '000000', 5, '性别维度', 'gender', 'xg_dimension_type', '', 'danger', 'N', 1, NOW(), 1, NOW(), '按性别统计'),
|
|
(2021006, '000000', 6, '年龄维度', 'age', 'xg_dimension_type', '', 'default', 'N', 1, NOW(), 1, NOW(), '按年龄统计'),
|
|
(2021007, '000000', 7, '政治面貌维度', 'political', 'xg_dimension_type', '', 'primary', 'N', 1, NOW(), 1, NOW(), '按政治面貌统计'),
|
|
(2021008, '000000', 8, '民族维度', 'nationality', 'xg_dimension_type', '', 'success', 'N', 1, NOW(), 1, NOW(), '按民族统计'),
|
|
(2021009, '000000', 9, '生源地维度', 'source_region', 'xg_dimension_type', '', 'info', 'N', 1, NOW(), 1, NOW(), '按生源地统计');
|
|
|
|
-- 插入统计报表类型字典数据
|
|
INSERT INTO sys_dict_data (
|
|
dict_code, tenant_id, dict_sort, dict_label, dict_value, dict_type,
|
|
css_class, list_class, is_default, create_by, create_time,
|
|
update_by, update_time, remark
|
|
) VALUES
|
|
(2022001, '000000', 1, '汇总报表', 'summary', 'xg_report_type', '', 'primary', 'N', 1, NOW(), 1, NOW(), '汇总统计报表'),
|
|
(2022002, '000000', 2, '明细报表', 'detail', 'xg_report_type', '', 'success', 'N', 1, NOW(), 1, NOW(), '明细统计报表'),
|
|
(2022003, '000000', 3, '对比报表', 'compare', 'xg_report_type', '', 'info', 'N', 1, NOW(), 1, NOW(), '对比统计报表'),
|
|
(2022004, '000000', 4, '趋势报表', 'trend', 'xg_report_type', '', 'warning', 'N', 1, NOW(), 1, NOW(), '趋势统计报表'),
|
|
(2022005, '000000', 5, '分析报表', 'analysis', 'xg_report_type', '', 'danger', 'N', 1, NOW(), 1, NOW(), '分析统计报表');
|
|
|
|
-- 插入数据权限范围字典数据
|
|
INSERT INTO sys_dict_data (
|
|
dict_code, tenant_id, dict_sort, dict_label, dict_value, dict_type,
|
|
css_class, list_class, is_default, create_by, create_time,
|
|
update_by, update_time, remark
|
|
) VALUES
|
|
(2023001, '000000', 1, '全部数据', 'all', 'xg_permission_scope', '', 'primary', 'N', 1, NOW(), 1, NOW(), '全部数据权限'),
|
|
(2023002, '000000', 2, '学院数据', 'college', 'xg_permission_scope', '', 'success', 'N', 1, NOW(), 1, NOW(), '学院数据权限'),
|
|
(2023003, '000000', 3, '专业数据', 'major', 'xg_permission_scope', '', 'info', 'N', 1, NOW(), 1, NOW(), '专业数据权限'),
|
|
(2023004, '000000', 4, '班级数据', 'class', 'xg_permission_scope', '', 'warning', 'N', 1, NOW(), 1, NOW(), '班级数据权限'),
|
|
(2023005, '000000', 5, '负责学生', 'responsible', 'xg_permission_scope', '', 'danger', 'N', 1, NOW(), 1, NOW(), '负责学生权限'),
|
|
(2023006, '000000', 6, '个人数据', 'personal', 'xg_permission_scope', '', 'default', 'N', 1, NOW(), 1, NOW(), '个人数据权限');
|
|
|
|
-- 插入统计配置类型字典数据
|
|
INSERT INTO sys_dict_data (
|
|
dict_code, tenant_id, dict_sort, dict_label, dict_value, dict_type,
|
|
css_class, list_class, is_default, create_by, create_time,
|
|
update_by, update_time, remark
|
|
) VALUES
|
|
(2024001, '000000', 1, '维度配置', 'dimension', 'xg_statistics_config_type', '', 'primary', 'N', 1, NOW(), 1, NOW(), '统计维度配置'),
|
|
(2024002, '000000', 2, '报表配置', 'report', 'xg_statistics_config_type', '', 'success', 'N', 1, NOW(), 1, NOW(), '统计报表配置'),
|
|
(2024003, '000000', 3, '图表配置', 'chart', 'xg_statistics_config_type', '', 'info', 'N', 1, NOW(), 1, NOW(), '统计图表配置'),
|
|
(2024004, '000000', 4, '仪表盘配置', 'dashboard', 'xg_statistics_config_type', '', 'warning', 'N', 1, NOW(), 1, NOW(), '统计仪表盘配置');
|
|
|
|
-- ==========================================
|
|
-- 5. 初始化完成提示
|
|
-- ==========================================
|
|
SELECT
|
|
'数据统计分析功能初始化完成!' AS message,
|
|
'配置项:13个维度配置 + 5个报表配置 + 5个图表配置' AS configs,
|
|
'菜单项:4个主菜单 + 15个功能按钮' AS menus,
|
|
'字典项:5个字典类型 + 29个字典数据' AS dictionaries,
|
|
'权限项:4个数据权限配置' AS permissions; |