更新密码找回uniapp
This commit is contained in:
1 parent
7f9a66da0f
commit
3fdda89833
1304 files changed
+3503
-26132
No files matched your search
@@ -1,23 +1,3 @@
|
||||
-- ============================================================
|
||||
-- 平台端排班模板(全局预制模板 + 自定义模板)
|
||||
--
|
||||
-- 执行顺序:
|
||||
-- 1) 本脚本:创建 2 张模板表并写入 6 个系统预置模板
|
||||
-- 2) alter_oa_schedule_plan_template.sql:租户排班方案增加模板/周期字段
|
||||
-- 3) platform_sched_template_menu.sql:注册平台端「排班模板」菜单
|
||||
-- 4) create_oa_scheduling.sql / oa_scheduling_menus.sql(若尚未执行)
|
||||
--
|
||||
-- 说明:
|
||||
-- 1. 模板是全局数据(不按租户隔离),只有平台端可维护;
|
||||
-- 系统预置模板(is_system=1)由平台锁定:不可编辑、不可删除、不可停用。
|
||||
-- 2. 租户端只能「调用」模板:调用时把模板规则快照到自己的排班方案
|
||||
-- (yz_backend_oa_schedule_plan.pattern),之后在租户端随意修改,
|
||||
-- 模板本身的后续调整不会再影响已保存的方案。
|
||||
-- 3. align_mode:1=按自然周(双休/单休/大小周) 2=从开始日滚动(三班倒/做一休一)
|
||||
-- 3=按自然月(月休,按月计算休息日)
|
||||
-- 4. day_index 表示周期内第几天,从 0 开始;按自然周时 0=周一、6=周日。
|
||||
-- 5. 本脚本不使用会话变量 / PREPARE,可整段执行也可逐条执行,重复执行安全。
|
||||
-- ============================================================
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `yz_platform_sched_tpl` (
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
@@ -60,11 +40,6 @@ CREATE TABLE IF NOT EXISTS `yz_platform_sched_tpl_day` (
|
||||
UNIQUE KEY `uk_tpl_day` (`template_id`,`day_index`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='平台端排班模板-周期每日规则';
|
||||
|
||||
-- ============================================================
|
||||
-- 系统预置模板(6 个)
|
||||
-- ============================================================
|
||||
|
||||
-- 1. 双休:周一至周五上班,周六日休息
|
||||
INSERT INTO yz_platform_sched_tpl
|
||||
(code, name, template_type, align_mode, cycle_days, week_offset, month_rest_days, month_rest_weekday, summary, is_system, status, sort, creater)
|
||||
SELECT 'double_weekend', '双休', 1, 1, 7, 0, 0, 0, '周一至周五上班 09:00-18:00,周六日休息', 1, 1, 10, 'system'
|
||||
@@ -89,7 +64,6 @@ WHERE NOT EXISTS (
|
||||
WHERE x.template_id = tpl.id AND x.day_index = d.idx
|
||||
);
|
||||
|
||||
-- 2. 单休:周一至周六上班,周日休息
|
||||
INSERT INTO yz_platform_sched_tpl
|
||||
(code, name, template_type, align_mode, cycle_days, week_offset, month_rest_days, month_rest_weekday, summary, is_system, status, sort, creater)
|
||||
SELECT 'single_weekend', '单休', 2, 1, 7, 0, 0, 0, '周一至周六上班 09:00-18:00,周日休息', 1, 1, 20, 'system'
|
||||
@@ -114,7 +88,6 @@ WHERE NOT EXISTS (
|
||||
WHERE x.template_id = tpl.id AND x.day_index = d.idx
|
||||
);
|
||||
|
||||
-- 3. 大小周:第 1 周双休,第 2 周单休(周六上班),14 天一个周期
|
||||
INSERT INTO yz_platform_sched_tpl
|
||||
(code, name, template_type, align_mode, cycle_days, week_offset, month_rest_days, month_rest_weekday, summary, is_system, status, sort, creater)
|
||||
SELECT 'big_small_week', '大小周', 3, 1, 14, 0, 0, 0, '第 1 周双休、第 2 周单休(周六上班),14 天循环', 1, 1, 30, 'system'
|
||||
@@ -146,7 +119,6 @@ WHERE NOT EXISTS (
|
||||
WHERE x.template_id = tpl.id AND x.day_index = d.idx
|
||||
);
|
||||
|
||||
-- 4. 月休 4 天:每月固定休 4 天,优先安排在周日(周末不足时从月末补齐)
|
||||
INSERT INTO yz_platform_sched_tpl
|
||||
(code, name, template_type, align_mode, cycle_days, week_offset, month_rest_days, month_rest_weekday, summary, is_system, status, sort, creater)
|
||||
SELECT 'month_4_rest', '月休 4 天', 4, 3, 0, 0, 4, 7, '每月固定休 4 天,优先安排周日,遇 5 个周日只休前 4 个', 1, 1, 40, 'system'
|
||||
@@ -165,7 +137,6 @@ WHERE NOT EXISTS (
|
||||
WHERE x.template_id = tpl.id AND x.day_index = d.idx
|
||||
);
|
||||
|
||||
-- 5. 三班倒:早班 -> 中班 -> 夜班,各 1 天循环
|
||||
INSERT INTO yz_platform_sched_tpl
|
||||
(code, name, template_type, align_mode, cycle_days, week_offset, month_rest_days, month_rest_weekday, summary, is_system, status, sort, creater)
|
||||
SELECT 'three_shift', '三班倒', 5, 2, 3, 0, 0, 0, '早班 08:00-16:00 → 中班 16:00-24:00 → 夜班 00:00-08:00,3 天循环', 1, 1, 50, 'system'
|
||||
@@ -186,7 +157,6 @@ WHERE NOT EXISTS (
|
||||
WHERE x.template_id = tpl.id AND x.day_index = d.idx
|
||||
);
|
||||
|
||||
-- 6. 做一休一:上 1 天休 1 天
|
||||
INSERT INTO yz_platform_sched_tpl
|
||||
(code, name, template_type, align_mode, cycle_days, week_offset, month_rest_days, month_rest_weekday, summary, is_system, status, sort, creater)
|
||||
SELECT 'work_one_rest_one', '做一休一', 6, 2, 2, 0, 0, 0, '上 1 天休 1 天循环(09:00-18:00)', 1, 1, 60, 'system'
|
||||
@@ -206,9 +176,6 @@ WHERE NOT EXISTS (
|
||||
WHERE x.template_id = tpl.id AND x.day_index = d.idx
|
||||
);
|
||||
|
||||
-- ============================================================
|
||||
-- 结果校验:6 行,day_count 分别为 7 / 7 / 14 / 1 / 3 / 2
|
||||
-- ============================================================
|
||||
SELECT t.id, t.code, t.name, t.template_type, t.align_mode, t.cycle_days,
|
||||
t.month_rest_days, t.month_rest_weekday, t.is_system, t.status, t.sort,
|
||||
COUNT(d.id) AS day_count
|
||||
|
||||
Reference in new issue
Block a user