show create procedure userMenuInit; --查詢是否存在函數(shù)
drop procedure userMenuInit; --刪除函數(shù)方法
create procedure userMenuInit(in oid int) --創(chuàng)建函數(shù)
begin
declare i int default 1;
while i <= oid do
INSERT INTO alliance
.alm_user_menu_organization
(organization_id
, menu_id
, mod_type
, mod_name
, name
, diy_name
, icon_url
,status
, is_sys
, is_deleted
)
VALUES
(i, 16, 1, '我的管理', '授權(quán)證書', '授權(quán)證書', '0d_appinit/menu_my/menu5.png', 2, 1, 1),
(i, 17, 1, '我的管理', '品牌管理', '品牌管理', '0d_appinit/menu_my/menu5.png', 2, 1, 1);
set i := i+1;
end while;
end;
set @max_organization_id=180;
call userMenuInit(@max_organization_id);