first commit
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
-- 一诊 / 挂号统计
|
||||
-- 页面:/first_visit/registration_stats
|
||||
-- 组件:first_visit/registration_stats/index
|
||||
-- 查询权限:firstvisit.registrationStats/overview
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
INSERT INTO `zyt_system_menu`
|
||||
(`pid`, `type`, `name`, `icon`, `sort`, `perms`, `paths`, `component`, `selected`, `params`, `is_cache`, `is_show`, `is_disable`, `create_time`, `update_time`)
|
||||
SELECT
|
||||
0, 'M', '一诊', 'el-icon-FirstAidKit', 802, '', 'first_visit', '', '', '', 0, 1, 0,
|
||||
UNIX_TIMESTAMP(), UNIX_TIMESTAMP()
|
||||
FROM DUAL
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM `zyt_system_menu`
|
||||
WHERE `pid` = 0 AND `type` = 'M'
|
||||
AND (TRIM(`name`) = '一诊' OR LOWER(TRIM(`paths`)) IN ('first_visit', 'firstvisit', 'first-visit'))
|
||||
);
|
||||
|
||||
SET @first_visit_menu_id = (
|
||||
SELECT `id` FROM `zyt_system_menu`
|
||||
WHERE `pid` = 0 AND `type` = 'M'
|
||||
AND (TRIM(`name`) = '一诊' OR LOWER(TRIM(`paths`)) IN ('first_visit', 'firstvisit', 'first-visit'))
|
||||
ORDER BY CASE WHEN TRIM(`name`) = '一诊' AND TRIM(`paths`) = 'first_visit' THEN 0 ELSE 1 END, `id`
|
||||
LIMIT 1
|
||||
);
|
||||
|
||||
INSERT INTO `zyt_system_menu`
|
||||
(`pid`, `type`, `name`, `icon`, `sort`, `perms`, `paths`, `component`, `selected`, `params`, `is_cache`, `is_show`, `is_disable`, `create_time`, `update_time`)
|
||||
SELECT
|
||||
@first_visit_menu_id, 'C', '挂号统计', 'el-icon-Histogram', 80,
|
||||
'firstvisit.registrationStats/overview', 'registration_stats', 'first_visit/registration_stats/index',
|
||||
'', '', 0, 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()
|
||||
FROM DUAL
|
||||
WHERE @first_visit_menu_id IS NOT NULL
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `zyt_system_menu`
|
||||
WHERE `perms` = 'firstvisit.registrationStats/overview'
|
||||
OR (`pid` = @first_visit_menu_id AND (
|
||||
TRIM(`name`) = '挂号统计'
|
||||
OR TRIM(`paths`) = 'registration_stats'
|
||||
OR TRIM(`component`) = 'first_visit/registration_stats/index'
|
||||
))
|
||||
);
|
||||
|
||||
SET @registration_stats_menu_id = (
|
||||
SELECT `id` FROM `zyt_system_menu`
|
||||
WHERE `pid` = @first_visit_menu_id
|
||||
AND (`perms` = 'firstvisit.registrationStats/overview'
|
||||
OR TRIM(`name`) = '挂号统计'
|
||||
OR TRIM(`component`) = 'first_visit/registration_stats/index')
|
||||
ORDER BY CASE WHEN `perms` = 'firstvisit.registrationStats/overview' THEN 0 ELSE 1 END, `id`
|
||||
LIMIT 1
|
||||
);
|
||||
|
||||
UPDATE `zyt_system_menu`
|
||||
SET `name` = '挂号统计',
|
||||
`icon` = 'el-icon-Histogram',
|
||||
`sort` = 80,
|
||||
`perms` = 'firstvisit.registrationStats/overview',
|
||||
`paths` = 'registration_stats',
|
||||
`component` = 'first_visit/registration_stats/index',
|
||||
`is_cache` = 0,
|
||||
`is_show` = 1,
|
||||
`is_disable` = 0,
|
||||
`update_time` = UNIX_TIMESTAMP()
|
||||
WHERE `id` = @registration_stats_menu_id;
|
||||
|
||||
-- 医助=本人、诊室组长=本部门、经理=本部门及下级、管理员=全部;root 自动拥有。
|
||||
INSERT IGNORE INTO `zyt_system_role_menu` (`role_id`, `menu_id`)
|
||||
SELECT `id`, @first_visit_menu_id
|
||||
FROM `zyt_system_role`
|
||||
WHERE @first_visit_menu_id IS NOT NULL
|
||||
AND `delete_time` IS NULL
|
||||
AND `name` IN ('医助', '经理', '诊室组长', '管理员');
|
||||
|
||||
INSERT IGNORE INTO `zyt_system_role_menu` (`role_id`, `menu_id`)
|
||||
SELECT `id`, @registration_stats_menu_id
|
||||
FROM `zyt_system_role`
|
||||
WHERE @registration_stats_menu_id IS NOT NULL
|
||||
AND `delete_time` IS NULL
|
||||
AND `name` IN ('医助', '经理', '诊室组长', '管理员');
|
||||
|
||||
COMMIT;
|
||||
Reference in New Issue
Block a user