test

Posted songstar

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了test相关的知识,希望对你有一定的参考价值。

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的主要内容,如果未能解决你的问题,请参考以下文章

webstorm代码片段的创建

json [test snippet]这是一个测试片段#test

java代码在片段活动中不起作用

csharp c#test片段

这两个代码片段之间有区别吗?如果有,那又如何? [复制]

片段中ListView的setOnItemClickListener