| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- -- 修复文章录入栏目级联缺下级栏目的本地数据。
- -- 原因:部分新建子栏目没有继承父栏目的文章发布/抄送/负责对象授权。
- -- 这个脚本可重复执行,只会给启用网站内缺失授权的启用子栏目补齐父栏目已有授权。
- insert into spaceappsv1.website_navigation_manage (
- unitid,
- navigationid,
- wnmcode,
- mtcode,
- objectid,
- create_time,
- create_pid
- )
- select
- parent_manage.unitid,
- child_nav.navigationid,
- parent_manage.wnmcode,
- parent_manage.mtcode,
- parent_manage.objectid,
- now(),
- 10000
- from spaceappsv1.website_navigation child_nav
- join spaceappsv1.website child_website
- on child_website.websiteid = child_nav.websiteid
- join spaceappsv1.website_navigation_manage parent_manage
- on parent_manage.navigationid = child_nav.parent_nid
- left join spaceappsv1.website_navigation_manage existing_manage
- on existing_manage.navigationid = child_nav.navigationid
- and existing_manage.wnmcode = parent_manage.wnmcode
- and existing_manage.mtcode = parent_manage.mtcode
- and existing_manage.objectid = parent_manage.objectid
- where child_website.dcode = 61
- and child_nav.dcode = 61
- and child_nav.parent_nid is not null
- and existing_manage.wncmanageid is null;
- insert into spaceappsv1.website_navigation_manage (
- unitid,
- navigationid,
- wnmcode,
- mtcode,
- objectid,
- create_time,
- create_pid
- )
- select
- parent_manage.unitid,
- child_nav.navigationid,
- parent_manage.wnmcode,
- parent_manage.mtcode,
- parent_manage.objectid,
- now(),
- 10000
- from spaceappsv1.website_navigation child_nav
- join spaceappsv1.website child_website
- on child_website.websiteid = child_nav.websiteid
- join spaceappsv1.website_navigation_manage parent_manage
- on parent_manage.navigationid = child_nav.parent_nid
- left join spaceappsv1.website_navigation_manage existing_manage
- on existing_manage.navigationid = child_nav.navigationid
- and existing_manage.wnmcode = parent_manage.wnmcode
- and existing_manage.mtcode = parent_manage.mtcode
- and existing_manage.objectid = parent_manage.objectid
- where child_website.dcode = 61
- and child_nav.dcode = 61
- and child_nav.parent_nid is not null
- and existing_manage.wncmanageid is null;
- insert into spaceappsv1.website_navigation_manage (
- unitid,
- navigationid,
- wnmcode,
- mtcode,
- objectid,
- create_time,
- create_pid
- )
- select
- parent_manage.unitid,
- child_nav.navigationid,
- parent_manage.wnmcode,
- parent_manage.mtcode,
- parent_manage.objectid,
- now(),
- 10000
- from spaceappsv1.website_navigation child_nav
- join spaceappsv1.website child_website
- on child_website.websiteid = child_nav.websiteid
- join spaceappsv1.website_navigation_manage parent_manage
- on parent_manage.navigationid = child_nav.parent_nid
- left join spaceappsv1.website_navigation_manage existing_manage
- on existing_manage.navigationid = child_nav.navigationid
- and existing_manage.wnmcode = parent_manage.wnmcode
- and existing_manage.mtcode = parent_manage.mtcode
- and existing_manage.objectid = parent_manage.objectid
- where child_website.dcode = 61
- and child_nav.dcode = 61
- and child_nav.parent_nid is not null
- and existing_manage.wncmanageid is null;
|