| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- USE spaceappsv1;
- SET @unit_id := 10000;
- SET @create_pid := 10000;
- SET @college_template_id := (
- SELECT wtid
- FROM website_template
- WHERE config = 'ffkjcollege1'
- LIMIT 1
- );
- SET @art_website_id := (
- SELECT websiteid
- FROM website
- WHERE name = '建筑与艺术传媒学院'
- OR domains LIKE '%ffkj-jzyyscmxy%'
- ORDER BY websiteid DESC
- LIMIT 1
- );
- DROP TEMPORARY TABLE IF EXISTS zq_recursive_nav_seed;
- CREATE TEMPORARY TABLE zq_recursive_nav_seed (
- idcard VARCHAR(128) NOT NULL,
- parent_idcard VARCHAR(128) NULL,
- name VARCHAR(256) NOT NULL,
- name_assistant VARCHAR(256) NULL,
- title VARCHAR(256) NOT NULL,
- description VARCHAR(2048) NOT NULL,
- wntcode INT NOT NULL,
- wnscode INT NOT NULL,
- wnjtcode INT NOT NULL,
- wnlscode INT NULL,
- uri VARCHAR(512) NULL,
- url VARCHAR(512) NULL,
- sort_number INT NOT NULL
- );
- INSERT INTO zq_recursive_nav_seed VALUES
- ('FFKJ_COLLEGE_NEWS_NAV', NULL, '新闻动态', 'News', '新闻动态', '学院新闻动态列表。', 10010, 10000, 10010, 10010, 'xueyuandongtai', '/xueyuandongtai/', 30),
- ('FFKJ_COLLEGE_NOTICE_NAV', NULL, '公告通知', 'Notice', '公告通知', '学院公告与通知列表。', 10010, 10000, 10010, 10010, 'tongzhigonggao', '/tongzhigonggao/', 40),
- ('FFKJ_COLLEGE_NOTICE_ANNOUNCE', 'FFKJ_COLLEGE_NOTICE_NAV', '公告', 'Notice', '公告', '学院公告列表。', 10010, 10000, 10010, 10010, 'gonggao', '/tongzhigonggao/gonggao/', 10),
- ('FFKJ_COLLEGE_NOTICE_NOTICE', 'FFKJ_COLLEGE_NOTICE_NAV', '通知', 'Notice', '通知', '学院通知列表。', 10010, 10000, 10010, 10010, 'tongzhi', '/tongzhigonggao/tongzhi/', 20),
- ('FFKJ_COLLEGE_NOTICE_ANNOUNCE_COLLEGE_INITIAL', 'FFKJ_COLLEGE_NOTICE_ANNOUNCE', '学院公告【初始】', 'Notice', '学院公告【初始】', '用于验证多层级导航的初始示例栏目。', 10010, 10000, 10010, 10010, 'xueyuangonggao', '/tongzhigonggao/gonggao/xueyuangonggao/', 10),
- ('FFKJ_COLLEGE_NOTICE_ANNOUNCE_IMPORTANT_INITIAL', 'FFKJ_COLLEGE_NOTICE_ANNOUNCE_COLLEGE_INITIAL', '重要公告【初始】', 'Notice', '重要公告【初始】', '用于验证四级导航的初始示例栏目。', 10010, 10000, 10010, 10010, 'zhongyaogonggao', '/tongzhigonggao/gonggao/xueyuangonggao/zhongyaogonggao/', 10);
- INSERT INTO website_navigation (
- dcode, unitid, wnccode, websiteid, wtid, idcard, name, name_assistant, title, `desc`,
- wntcode, wnscode, wnjtcode, wnlscode, uri, url, parent_nid,
- photo_size_width, photo_size_height, background_image, sort_number, create_time, create_pid
- )
- SELECT
- 61, @unit_id, 10010, NULL, @college_template_id, s.idcard, s.name, s.name_assistant, s.title, s.description,
- s.wntcode, s.wnscode, s.wnjtcode, s.wnlscode, s.uri, s.url, parent.navigationid,
- 380, 220, NULL, s.sort_number, NOW(), @create_pid
- FROM zq_recursive_nav_seed s
- LEFT JOIN website_navigation parent ON parent.wnccode = 10010
- AND parent.wtid = @college_template_id
- AND parent.idcard = s.parent_idcard
- WHERE @college_template_id IS NOT NULL
- AND NOT EXISTS (
- SELECT 1
- FROM website_navigation wn
- WHERE wn.wnccode = 10010
- AND wn.wtid = @college_template_id
- AND wn.idcard = s.idcard
- );
- UPDATE website_navigation wn
- JOIN zq_recursive_nav_seed s ON wn.wnccode = 10010
- AND wn.wtid = @college_template_id
- AND wn.idcard = s.idcard
- LEFT JOIN website_navigation parent ON parent.wnccode = 10010
- AND parent.wtid = @college_template_id
- AND parent.idcard = s.parent_idcard
- SET wn.dcode = 61,
- wn.unitid = @unit_id,
- wn.websiteid = NULL,
- wn.name = s.name,
- wn.name_assistant = s.name_assistant,
- wn.title = s.title,
- wn.`desc` = s.description,
- wn.wntcode = s.wntcode,
- wn.wnscode = s.wnscode,
- wn.wnjtcode = s.wnjtcode,
- wn.wnlscode = s.wnlscode,
- wn.uri = s.uri,
- wn.url = s.url,
- wn.jump_url = NULL,
- wn.jump_websiteid = NULL,
- wn.parent_nid = parent.navigationid,
- wn.sort_number = s.sort_number;
- SET @site_notice_nav_id := (
- SELECT navigationid
- FROM website_navigation
- WHERE websiteid = @art_website_id
- AND idcard = 'FFKJ_COLLEGE_NOTICE_NAV'
- LIMIT 1
- );
- UPDATE website_navigation
- SET idcard = 'FFKJ_COLLEGE_NOTICE_ANNOUNCE'
- WHERE websiteid = @art_website_id
- AND parent_nid = @site_notice_nav_id
- AND name = '公告';
- UPDATE website_navigation
- SET idcard = 'FFKJ_COLLEGE_NOTICE_NOTICE'
- WHERE websiteid = @art_website_id
- AND parent_nid = @site_notice_nav_id
- AND name = '通知';
- INSERT INTO website_navigation (
- dcode, unitid, wnccode, websiteid, wtid, idcard, name, name_assistant, title, `desc`,
- wntcode, wnscode, wnjtcode, wnlscode, uri, url, parent_nid,
- photo_size_width, photo_size_height, background_image, sort_number, create_time, create_pid
- )
- SELECT
- 61, @unit_id, 10000, @art_website_id, NULL, s.idcard, s.name, s.name_assistant, s.title, s.description,
- s.wntcode, s.wnscode, s.wnjtcode, s.wnlscode, s.uri, s.url, parent.navigationid,
- 380, 220, NULL, s.sort_number, NOW(), @create_pid
- FROM zq_recursive_nav_seed s
- LEFT JOIN website_navigation parent ON parent.wnccode = 10000
- AND parent.websiteid = @art_website_id
- AND parent.idcard = s.parent_idcard
- WHERE @art_website_id IS NOT NULL
- AND s.idcard NOT IN ('FFKJ_COLLEGE_NEWS_NAV', 'FFKJ_COLLEGE_NOTICE_NAV')
- AND NOT EXISTS (
- SELECT 1
- FROM website_navigation wn
- WHERE wn.wnccode = 10000
- AND wn.websiteid = @art_website_id
- AND wn.idcard = s.idcard
- );
- UPDATE website_navigation wn
- JOIN zq_recursive_nav_seed s ON wn.wnccode = 10000
- AND wn.websiteid = @art_website_id
- AND wn.idcard = s.idcard
- LEFT JOIN website_navigation parent ON parent.wnccode = 10000
- AND parent.websiteid = @art_website_id
- AND parent.idcard = s.parent_idcard
- SET wn.dcode = 61,
- wn.unitid = @unit_id,
- wn.name = s.name,
- wn.name_assistant = s.name_assistant,
- wn.title = s.title,
- wn.`desc` = s.description,
- wn.wntcode = s.wntcode,
- wn.wnscode = s.wnscode,
- wn.wnjtcode = s.wnjtcode,
- wn.wnlscode = s.wnlscode,
- wn.uri = s.uri,
- wn.url = s.url,
- wn.jump_url = NULL,
- wn.jump_websiteid = NULL,
- wn.parent_nid = parent.navigationid,
- wn.sort_number = s.sort_number
- WHERE s.idcard NOT IN ('FFKJ_COLLEGE_NEWS_NAV', 'FFKJ_COLLEGE_NOTICE_NAV');
- DROP TEMPORARY TABLE IF EXISTS zq_recursive_nav_seed;
|