码迷,mamicode.com
首页 > 其他好文 > 详细

test

时间:2018-08-22 14:06:31      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:新闻   思想   首页   mep   delete   友情   机构   活动   detail   

USE [AYZY]
GO

/****** Object:  StoredProcedure [dbo].[SP_InitWebSite]    Script Date: 08/22/2018 13:07:39 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[SP_InitWebSite] 
    @SiteId INT  --站点ID
AS
BEGIN
    DECLARE @SiteType INT;
    DECLARE @NewColumnId INT;
    DECLARE @NewModelId INT;
    
    --获取站点类型
    SELECT @SiteType=[SiteType] FROM [WebSites] WHERE [Id]=@SiteId; 
    
    IF(@SiteType=1)
        -- 初始化院系类网站栏目及首页模块
        BEGIN
            INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N学院首页, NULL, 10, 1, @SiteId, -1, -1, 0, GETDATE());
                SET @NewColumnId = @@IDENTITY;
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N首页Banner轮播图, @NewColumnId, 11, 0, @SiteId, 0, 5, 0, GETDATE());
                    SET @NewModelId = @@IDENTITY;
                    INSERT [HomePageModules] ([ModuleName], [OrderIndex], [DetailType], [ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N首页Banner轮播图, 1, 5, @NewModelId, @SiteId, 0, GETDATE());
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N横幅宣传图片, @NewColumnId, 12, 0, @SiteId, 0, 5, 0, GETDATE());
                    SET @NewModelId = @@IDENTITY;
                    INSERT [HomePageModules] ([ModuleName], [OrderIndex], [DetailType], [ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N横幅宣传图片, 12, 5, @NewModelId, @SiteId, 0, GETDATE());
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N友情链接, @NewColumnId, 13, 0, @SiteId, 0, 5, 0, GETDATE());
                    SET @NewModelId = @@IDENTITY;
                    INSERT [HomePageModules] ([ModuleName], [OrderIndex], [DetailType], [ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N友情链接, 3, 5, @NewModelId, @SiteId, 0, GETDATE());

            INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N学院概况, NULL, 20, 0, @SiteId, -1, -1, 0, GETDATE());
                SET @NewColumnId = @@IDENTITY;
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N学院简介, @NewColumnId, 21, 0, @SiteId, 0, 1, 0, GETDATE());
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N学院管理, @NewColumnId, 22, 0, @SiteId, 1, 1, 0, GETDATE());
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N学院风采, @NewColumnId, 23, 0, @SiteId, 2, 2, 0, GETDATE());
                    SET @NewModelId = @@IDENTITY;
                    INSERT [HomePageModules] ([ModuleName], [OrderIndex], [DetailType], [ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N学院风采, 11, 2, @NewModelId, @SiteId, 0, GETDATE());

            INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N新闻中心, NULL, 30, 0, @SiteId, -1, -1, 0, GETDATE());
                SET @NewColumnId = @@IDENTITY;
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N新闻资讯, @NewColumnId, 31, 0, @SiteId, 1, 1, 0, GETDATE());
                    SET @NewModelId = @@IDENTITY;
                    INSERT [HomePageModules] ([ModuleName], [OrderIndex], [DetailType], [ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N新闻资讯, 5, 1, @NewModelId, @SiteId, 0, GETDATE());
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N最新公告, @NewColumnId, 32, 0, @SiteId, 1, 1, 0, GETDATE());
                    SET @NewModelId = @@IDENTITY;
                    INSERT [HomePageModules] ([ModuleName], [OrderIndex], [DetailType], [ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N最新公告, 2, 1, @NewModelId, @SiteId, 0, GETDATE());
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N校务公开, @NewColumnId, 33, 0, @SiteId, 1, 1, 0, GETDATE());
                    SET @NewModelId = @@IDENTITY;
                    INSERT [HomePageModules] ([ModuleName], [OrderIndex], [DetailType], [ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N校务公开, 6, 1, @NewModelId, @SiteId, 0, GETDATE());

            INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N教学管理, NULL, 40, 0, @SiteId, -1, -1, 0, GETDATE());
                SET @NewColumnId = @@IDENTITY;
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N教师团队, @NewColumnId, 41, 0, @SiteId, 5, 4, 0, GETDATE());
                    SET @NewModelId = @@IDENTITY;
                    INSERT [HomePageModules] ([ModuleName], [OrderIndex], [DetailType], [ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N教师团队, 10, 4, @NewModelId, @SiteId, 0, GETDATE());
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N教学科研, @NewColumnId, 42, 0, @SiteId, 1, 1, 0, GETDATE());
                    SET @NewModelId = @@IDENTITY;
                    INSERT [HomePageModules] ([ModuleName], [OrderIndex], [DetailType], [ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N教学科研, 7, 1, @NewModelId, @SiteId, 0, GETDATE());
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N实验实训, @NewColumnId, 43, 0, @SiteId, 2, 2, 0, GETDATE());

            INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N专业介绍, NULL, 50, 0, @SiteId, 1, 1, 0, GETDATE());

            INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N学生工作, NULL, 60, 0, @SiteId, -1, -1, 0, GETDATE());
                SET @NewColumnId = @@IDENTITY;
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N学生会, @NewColumnId, 61, 0, @SiteId, 5, 4, 0, GETDATE());
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N团委, @NewColumnId, 62, 0, @SiteId, 1, 1, 0, GETDATE());
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N校园活动, @NewColumnId, 63, 0, @SiteId, 2, 1, 0, GETDATE());
                    SET @NewModelId = @@IDENTITY;
                    INSERT [HomePageModules] ([ModuleName], [OrderIndex], [DetailType], [ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N图片新闻, 4, 1, @NewModelId, @SiteId, 0, GETDATE());

            INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N招生就业, NULL, 70, 0, @SiteId, -1, -1, 0, GETDATE());
                SET @NewColumnId = @@IDENTITY;
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N招生资讯, @NewColumnId, 71, 0, @SiteId, 1, 1, 0, GETDATE());
                    SET @NewModelId = @@IDENTITY;
                    INSERT [HomePageModules] ([ModuleName], [OrderIndex], [DetailType], [ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N招生资讯, 8, 1, @NewModelId, @SiteId, 0, GETDATE());
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N就业指导, @NewColumnId, 72, 0, @SiteId, 1, 1, 0, GETDATE());
                    SET @NewModelId = @@IDENTITY;
                    INSERT [HomePageModules] ([ModuleName], [OrderIndex], [DetailType], [ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N就业指导, 9, 1, @NewModelId, @SiteId, 0, GETDATE());

            INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N电子资源, NULL, 80, 0, @SiteId, -1, -1, 0, GETDATE());
                SET @NewColumnId = @@IDENTITY;
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N精品课程, @NewColumnId, 81, 0, @SiteId, 1, 1, 0, GETDATE());
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N视频中心, @NewColumnId, 82, 0, @SiteId, 4, 3, 0, GETDATE());
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N资源下载, @NewColumnId, 83, 0, @SiteId, 1, 1, 0, GETDATE());

            INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N学术交流, NULL, 90, 0, @SiteId, 2, 2, 0, GETDATE());

            INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N联系我们, NULL, 100, 0, @SiteId, 0, 1, 0, GETDATE());
        END
    ELSE IF(@SiteType=2)
        -- 初始化部门类网站栏目及首页模块
        BEGIN
            INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N首页, NULL, 10, 1, @SiteId, -1, -1, 0, GETDATE());
                SET @NewColumnId = @@IDENTITY;
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N首页Banner轮播图, @NewColumnId, 11, 0, @SiteId, 0, 5, 0, GETDATE());
                    SET @NewModelId = @@IDENTITY;
                    INSERT [HomePageModules] ([ModuleName], [OrderIndex], [DetailType], [ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N首页Banner轮播图, 1, 5, @NewModelId, @SiteId, 0, GETDATE());
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N横幅宣传图片    , @NewColumnId, 12, 0, @SiteId, 0, 5, 0, GETDATE());
                    SET @NewModelId = @@IDENTITY;
                    INSERT [HomePageModules] ([ModuleName], [OrderIndex], [DetailType], [ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N横幅宣传图片, 10, 5, @NewModelId, @SiteId, 0, GETDATE());
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N友情链接, @NewColumnId, 13, 0, @SiteId, 0, 5, 0, GETDATE());
                    SET @NewModelId = @@IDENTITY;
                    INSERT [HomePageModules] ([ModuleName], [OrderIndex], [DetailType], [ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N友情链接, 3, 5, @NewModelId, @SiteId, 0, GETDATE());

            INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N部门概况, NULL, 20, 0, @SiteId, 0, 1, 0, GETDATE());
            INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N机构设置, NULL, 30, 0, @SiteId, 1, 1, 0, GETDATE());

            INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N新闻动态, NULL, 40, 0, @SiteId, -1, -1, 0, GETDATE());
                SET @NewColumnId = @@IDENTITY;
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N部门新闻, @NewColumnId, 41, 0, @SiteId, 1, 1, 0, GETDATE());
                    SET @NewModelId = @@IDENTITY;
                    INSERT [HomePageModules] ([ModuleName], [OrderIndex], [DetailType], [ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N新闻动态, 5, 1, @NewModelId, @SiteId, 0, GETDATE());
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N最新资讯, @NewColumnId, 42, 0, @SiteId, 1, 1, 0, GETDATE());
                    SET @NewModelId = @@IDENTITY;
                    INSERT [HomePageModules] ([ModuleName], [OrderIndex], [DetailType], [ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N部门公告, 2, 1, @NewModelId, @SiteId, 0, GETDATE());
                    INSERT [HomePageModules] ([ModuleName], [OrderIndex], [DetailType], [ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N通知公告, 8, 1, @NewModelId, @SiteId, 0, GETDATE());

            INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N通知公告, NULL, 50, 0, @SiteId, 1, 1, 0, GETDATE());

            INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N日常管理, NULL, 60, 0, @SiteId, -1, -1, 0, GETDATE());
                SET @NewColumnId = @@IDENTITY;
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N管理制度, @NewColumnId, 61, 0, @SiteId, 1, 1, 0, GETDATE());
                    SET @NewModelId = @@IDENTITY;
                    INSERT [HomePageModules] ([ModuleName], [OrderIndex], [DetailType], [ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N管理制度, 6, 1, @NewModelId, @SiteId, 0, GETDATE());
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N上级文件, @NewColumnId, 62, 0, @SiteId, -1, -1, 0, GETDATE());
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N工作流程, @NewColumnId, 63, 0, @SiteId, 1, 1, 0, GETDATE());
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N评优评先, @NewColumnId, 64, 0, @SiteId, 1, 1, 0, GETDATE());

            INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N思想教育, NULL, 70, 0, @SiteId, 1, 1, 0, GETDATE());
                    SET @NewModelId = @@IDENTITY;
                    INSERT [HomePageModules] ([ModuleName], [OrderIndex], [DetailType], [ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N思想教育, 7, 1, @NewModelId, @SiteId, 0, GETDATE());

            INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N队伍建设, NULL, 80, 0, @SiteId, -1, -1, 0, GETDATE());
                SET @NewColumnId = @@IDENTITY;
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N教师风采, @NewColumnId, 81, 0, @SiteId, 5, 4, 0, GETDATE());
                    SET @NewModelId = @@IDENTITY;
                    INSERT [HomePageModules] ([ModuleName], [OrderIndex], [DetailType], [ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N教师风采, 9, 4, @NewModelId, @SiteId, 0, GETDATE());
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N培训培养, @NewColumnId, 82, 0, @SiteId, 2, 1, 0, GETDATE());
                    SET @NewModelId = @@IDENTITY;
                    INSERT [HomePageModules] ([ModuleName], [OrderIndex], [DetailType], [ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N图片新闻, 4, 1, @NewModelId, @SiteId, 0, GETDATE());
                INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N管理考核, @NewColumnId, 83, 0, @SiteId, 1, 1, 0, GETDATE());

            INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N下载中心, NULL, 90, 0, @SiteId, 1, 1, 0, GETDATE());
            INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N联系我们, NULL, 100, 0, @SiteId, 0, 1, 0, GETDATE());
        END
END

GO

 

test

标签:新闻   思想   首页   mep   delete   友情   机构   活动   detail   

原文地址:https://www.cnblogs.com/songStar/p/9516987.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!