/*
     * 注意:ver必须是全个List的唯一,使用最后一项加1来放到新项
     * 更新版本号只需留最后一个版本号即可
    */
    public static List<SqlUpdateModel> GetUpdateList()
    {
        List<SqlUpdateModel> list = new List<SqlUpdateModel>();

        string sql;
        SqlUpdateModel sqlModel;

        sql = "select 1";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetSQL(2, sql);
        list.Add(sqlModel);
        return list;
    }
    /*
     * 注意:ver必须是全个List的唯一,使用最后一项加1来放到新项
     * 更新版本号只需留最后一个版本号即可
    */
    public static List<SqlUpdateModel> GetUpdateList()
    {
        List<SqlUpdateModel> list = new List<SqlUpdateModel>();

        string sql;
        SqlUpdateModel sqlModel;

        sql = "select 1";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetSQL(2, sql);
        list.Add(sqlModel);

        sql = "CREATE TABLE TeacherToClass([SchoolNo] [nvarchar](30) NOT NULL,[Guid] [nvarchar](100) NOT NULL,[Class] [nvarchar](max) NOT NULL) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(3, "TeacherToClass", sql);
        list.Add(sqlModel);

        sql = @"CREATE VIEW WXTemplateSettingV AS SELECT   dbo.WXTemplateSetting.TemplateType, dbo.WXTemplateSetting.WxOriginalID, dbo.WXTemplateSetting.TemplateId,
                dbo.WXTemplateSetting.Url, dbo.WXTemplateSetting.TopColor, dbo.WXTemplateSetting.TemplateObj,
                dbo.WxPublicPlatform.UrlString, dbo.WxPublicPlatform.Token, dbo.WxPublicPlatform.AppId,
                dbo.WxPublicPlatform.AppSecret, dbo.WXTemplateSetting.Evenid
        FROM      dbo.WXTemplateSetting INNER JOIN
                dbo.WxPublicPlatform ON dbo.WXTemplateSetting.WxOriginalID = dbo.WxPublicPlatform.OriginalID";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAddView(4, "WXTemplateSettingV", sql);
        list.Add(sqlModel);

        sql = "CREATE TABLE SendTemplateMessage([PaperNo] [nvarchar](50) NOT NULL,AppId nvarchar(50) NOT NULL,AppSecret nvarchar(100) NOT NULL,OpenId nvarchar(70) NOT NULL,TemplateId nvarchar(70) NOT NULL,TopColor nvarchar(30) NOT NULL,Url nvarchar(50) NOT NULL,Data nvarchar(MAX) NOT NULL,HappendDate datetime NOT NULL,IsSend bit NOT NULL,SendDate datetime NOT NULL)  ON [PRIMARY]TEXTIMAGE_ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(5, "SendTemplateMessage", sql);
        list.Add(sqlModel);

        sql = "ALTER TABLE SchoolData ADD SendTimeUp nvarchar(30) NOT NULL DEFAULT ('0:00:00'), SendTimeDown nvarchar(30) NOT NULL DEFAULT ('23:59:00')";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterTableAddColumn(6, "SchoolData", "SendTimeUp", sql);
        list.Add(sqlModel);

        sql = "CREATE TABLE DbUpdate ( TableName nvarchar(50) NOT NULL, IsUpdate bit NOT NULL )  ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(7, "DbUpdate", sql);
        list.Add(sqlModel);

        sql = "ALTER TABLE DbUpdate ADD CONSTRAINT PK_DbUpdate PRIMARY KEY CLUSTERED (TableName) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetSQL(8,  sql);
        list.Add(sqlModel);

        sql = "ALTER TABLE SendTemplateMessage ADD SchoolNo nvarchar(50) NOT NULL";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterTableAddColumn(9, "SendTemplateMessage", "SchoolNo", sql);
        list.Add(sqlModel);

        sql = @"CREATE VIEW StudentParentV AS
                SELECT   dbo.SJ_DepartStaff.DS_JID, dbo.SJ_DepartStaff.D_Name, dbo.SJ_DepartStaff.DS_Name, dbo.SJ_DepartStaff.DS_Sex,
                dbo.SJ_DepartStaff.DS_DocumentNo, dbo.SJ_DepartStaff.DS_Tele, dbo.SJ_DepartStaff.DS_Post,
                dbo.SJ_DepartStaff.DS_UID, dbo.SJ_DepartStaff.SchoolNo, dbo.ParentBindInfo.OpenId
                FROM      dbo.SJ_DepartStaff INNER JOIN
                dbo.ParentBindInfo ON dbo.SJ_DepartStaff.DS_Tele = dbo.ParentBindInfo.Phone";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAddView(10, "StudentParentV", sql);
        list.Add(sqlModel);

        sql = @"CREATE VIEW TeacherToClassV
                AS
                SELECT   ISNULL(dbo.TeacherToClass.Class, N'') AS Class, dbo.SJ_DepartStaff.D_Name, dbo.SJ_DepartStaff.DS_Name,
                                dbo.SJ_DepartStaff.DS_Sex, dbo.SJ_DepartStaff.DS_DocumentNo, dbo.SJ_DepartStaff.DS_Tele,
                                dbo.SJ_DepartStaff.DS_Post, dbo.SJ_DepartStaff.DS_JID, dbo.SJ_DepartStaff.DS_UID,
                                dbo.SJ_DepartStaff.SchoolNo
                FROM      dbo.TeacherToClass RIGHT OUTER JOIN
                                dbo.SJ_DepartStaff ON dbo.TeacherToClass.Guid = dbo.SJ_DepartStaff.DS_UID AND
                                dbo.TeacherToClass.SchoolNo = dbo.SJ_DepartStaff.SchoolNo
                WHERE   (dbo.SJ_DepartStaff.DS_Post <> '学生')";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAddView(11, "TeacherToClassV", sql);
        list.Add(sqlModel);

        sql = "ALTER TABLE SendTemplateMessage ADD DeadTime datetime NOT NULL DEFAULT getdate()";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterTableAddColumn(12, "SendTemplateMessage", "DeadTime", sql);
        list.Add(sqlModel);

        sql = "ALTER TABLE TeacherBindInfo ADD [SchoolNo] [nvarchar](50) NOT NULL";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterTableAddColumn(13, "TeacherBindInfo", "SchoolNo", sql);
        list.Add(sqlModel);

        sql = "ALTER TABLE TeacherToClass ADD IdentityName nvarchar(100) NOT NULL DEFAULT ('')";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterTableAddColumn(14, "TeacherToClass", "IdentityName", sql);
        list.Add(sqlModel);

        sql = @"ALTER VIEW TeacherToClassV
                AS
                SELECT   ISNULL(dbo.TeacherToClass.Class, N'') AS Class, dbo.SJ_DepartStaff.D_Name, dbo.SJ_DepartStaff.DS_Name,
                                dbo.SJ_DepartStaff.DS_Sex, dbo.SJ_DepartStaff.DS_DocumentNo, dbo.SJ_DepartStaff.DS_Tele,
                                dbo.SJ_DepartStaff.DS_Post, dbo.SJ_DepartStaff.DS_JID, dbo.SJ_DepartStaff.DS_UID, dbo.SJ_DepartStaff.SchoolNo,
                                dbo.TeacherToClass.IdentityName
                FROM      dbo.TeacherToClass RIGHT OUTER JOIN
                                dbo.SJ_DepartStaff ON dbo.TeacherToClass.Guid = dbo.SJ_DepartStaff.DS_UID AND
                                dbo.TeacherToClass.SchoolNo = dbo.SJ_DepartStaff.SchoolNo
                WHERE   (dbo.SJ_DepartStaff.DS_Post <> '学生')";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterView(15, "TeacherToClassV", sql);
        list.Add(sqlModel);

        sql = "ALTER TABLE ParentBindInfo ADD StuentUId nvarchar(100) NOT NULL DEFAULT ('')";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterTableAddColumn(16, "ParentBindInfo", "StuentUId", sql);
        list.Add(sqlModel);

        sql = @"ALTER VIEW StudentParentV
                AS
                SELECT   dbo.SJ_DepartStaff.DS_JID, dbo.SJ_DepartStaff.D_Name, dbo.SJ_DepartStaff.DS_Name, dbo.SJ_DepartStaff.DS_Sex,
                                dbo.SJ_DepartStaff.DS_DocumentNo, dbo.SJ_DepartStaff.DS_Tele, dbo.SJ_DepartStaff.DS_Post,
                                dbo.SJ_DepartStaff.DS_UID, dbo.SJ_DepartStaff.SchoolNo, dbo.ParentBindInfo.OpenId
                FROM      dbo.SJ_DepartStaff INNER JOIN
                                dbo.ParentBindInfo ON dbo.SJ_DepartStaff.DS_UID = dbo.ParentBindInfo.StuentUId";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterView(17, "StudentParentV", sql);
        list.Add(sqlModel);

        sql = "ALTER TABLE ParentBindInfo DROP CONSTRAINT PK_ParentBindInfo";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetSQL(18, sql);
        list.Add(sqlModel);

        sql = @"CREATE VIEW TeacherBindInfoV
                AS
                SELECT   dbo.TeacherBindInfo.OpenId, dbo.SJ_DepartStaff.DS_JID, dbo.SJ_DepartStaff.D_Name, dbo.SJ_DepartStaff.DS_Name,
                                dbo.SJ_DepartStaff.DS_Sex, dbo.SJ_DepartStaff.DS_DocumentNo, dbo.SJ_DepartStaff.DS_Tele,
                                dbo.SJ_DepartStaff.DS_Post, dbo.SJ_DepartStaff.DS_UID, dbo.SJ_DepartStaff.SchoolNo
                FROM      dbo.TeacherBindInfo INNER JOIN
                                dbo.SJ_DepartStaff ON dbo.TeacherBindInfo.TeacherId = dbo.SJ_DepartStaff.DS_JID AND
                                dbo.TeacherBindInfo.SchoolNo = dbo.SJ_DepartStaff.SchoolNo";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAddView(19, "TeacherBindInfoV", sql);
        list.Add(sqlModel);

        sql = "ALTER TABLE SchoolData ADD City nvarchar(50) NOT NULL DEFAULT (''), District nvarchar(50) NOT NULL DEFAULT (''), Town nvarchar(50) NOT NULL DEFAULT ('')";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterTableAddColumn(20, "SchoolData", "City", sql);
        list.Add(sqlModel);

        sql = @"CREATE VIEW SJ_DepartStaffV
                AS
                SELECT   dbo.SJ_DepartStaff.DS_JID, dbo.SJ_DepartStaff.D_Name, dbo.SJ_DepartStaff.DS_Name, dbo.SJ_DepartStaff.DS_Sex,
                                dbo.SJ_DepartStaff.DS_DocumentNo, dbo.SJ_DepartStaff.DS_Tele, dbo.SJ_DepartStaff.DS_Post,
                                dbo.SJ_DepartStaff.DS_UID, dbo.SJ_DepartStaff.SchoolNo, dbo.SchoolData.SchoolPwd, dbo.SchoolData.SchoolName,
                                dbo.SchoolData.CanUse, dbo.SchoolData.SendTimeUp, dbo.SchoolData.SendTimeDown, dbo.SchoolData.City,
                                dbo.SchoolData.District, dbo.SchoolData.Town
                FROM      dbo.SJ_DepartStaff LEFT OUTER JOIN
                                dbo.SchoolData ON dbo.SJ_DepartStaff.SchoolNo = dbo.SchoolData.SchoolNo";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAddView(21, "SJ_DepartStaffV", sql);
        list.Add(sqlModel);

        sql = @"CREATE TABLE MainPagePic(
                [Evenid] [bigint] IDENTITY(1,1) NOT NULL,
                [SchoolNo] [nvarchar](100) NOT NULL,
                [ImgPath] [nvarchar](100) NOT NULL,
                [SortNo] [bigint] NOT NULL,
             CONSTRAINT [PK_MainPagePic] PRIMARY KEY CLUSTERED
            (
                [Evenid] ASC
            )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
            ) ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(22, "MainPagePic", sql);
        list.Add(sqlModel);

        sql = @"CREATE TABLE Advs(
                [Evenid] [bigint] IDENTITY(1,1) NOT NULL,
                [PaperNo] [nvarchar](100) NOT NULL,
                [SchoolNos] [nvarchar](Max) NOT NULL,
                [SchoolNames] [nvarchar](Max) NOT NULL,
                [ImgPath] [nvarchar](100) NOT NULL
             CONSTRAINT [PK_Advs] PRIMARY KEY CLUSTERED
            (
                [Evenid] ASC
            )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
            ) ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(23, "Advs", sql);
        list.Add(sqlModel);

        sql = @"CREATE TABLE BackgroundImage(
                [Evenid] [bigint] IDENTITY(1,1) NOT NULL,
                [SchoolNo] [nvarchar](100) NOT NULL,
                [ImgPath] [nvarchar](100) NOT NULL,
                [SortNo] [bigint] NOT NULL,
             CONSTRAINT [PK_BackgroundImage] PRIMARY KEY CLUSTERED
            (
                [Evenid] ASC
            )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
            ) ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(24, "BackgroundImage", sql);
        list.Add(sqlModel);

        sql = @"CREATE TABLE SchoolNews(
                [Evenid] [bigint] IDENTITY(1,1) NOT NULL,
                [SchoolNo] [nvarchar](100) NOT NULL,
                [NewsType] [int] NOT NULL,
                [Headlines] [nvarchar](100) NOT NULL,
                [HappenDate] [datetime] NOT NULL,
                [Photo] [nvarchar](300) NOT NULL,
                [Music] [nvarchar](100) NOT NULL,
                [Remarks] [ntext] NOT NULL,
             CONSTRAINT [PK_SchoolNews] PRIMARY KEY CLUSTERED
            (
                [Evenid] ASC
            )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
            ) ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(25, "SchoolNews", sql);
        list.Add(sqlModel);

        sql = @"CREATE TABLE Notice(
                [Evenid] [bigint] IDENTITY(1,1) NOT NULL,
                [SchoolNo] [nvarchar](100) NOT NULL,
                [Headlines] [nvarchar](100) NOT NULL,
                [HappenDate] [datetime] NOT NULL,
                [Photo] [nvarchar](300) NOT NULL,
                [Music] [nvarchar](100) NOT NULL,
                [Remarks] [ntext] NOT NULL,
             CONSTRAINT [PK_Notice] PRIMARY KEY CLUSTERED
            (
                [Evenid] ASC
            )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
            ) ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(26, "Notice", sql);
        list.Add(sqlModel);

        sql = @"CREATE TABLE SchoolActive(
                [Evenid] [bigint] IDENTITY(1,1) NOT NULL,
                [SchoolNo] [nvarchar](100) NOT NULL,
                [Headlines] [nvarchar](100) NOT NULL,
                [HappenDate] [datetime] NOT NULL,
                [Photo] [nvarchar](300) NOT NULL,
                [Music] [nvarchar](100) NOT NULL,
                [Remarks] [ntext] NOT NULL,
                [See] [bigint] NOT NULL DEFAULT 0,
                [IsLookShow] [bit] NOT NULL,
             CONSTRAINT [PK_SchoolActive] PRIMARY KEY CLUSTERED
            (
                [Evenid] ASC
            )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
            ) ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(27, "SchoolActive", sql);
        list.Add(sqlModel);

        sql = @"CREATE TABLE MailBox(
                [Evenid] [bigint] IDENTITY(1,1) NOT NULL,
                [SchoolNo] [nvarchar](100) NOT NULL,
                [Name] [nvarchar](50) NOT NULL DEFAULT (''),
                [Phone] [nvarchar](50) NOT NULL DEFAULT (''),
                [Head] [nvarchar](100) NOT NULL DEFAULT (''),
                [MailContent] [nvarchar](MAX) NOT NULL DEFAULT (''),
                [OpenId] [nvarchar](100) NOT NULL,
                [HappenDate] [datetime] NOT NULL
             CONSTRAINT [PK_MailBox] PRIMARY KEY CLUSTERED
            (
                [Evenid] ASC
            )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
            ) ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(28, "MailBox", sql);
        list.Add(sqlModel);

        sql = @"CREATE VIEW MailBoxV
                AS
                SELECT   dbo.MailBox.SchoolNo, dbo.MailBox.Name, dbo.MailBox.Phone, dbo.MailBox.Head, dbo.MailBox.MailContent,
                                dbo.MailBox.OpenId, dbo.MailBox.HappenDate, dbo.SchoolData.SchoolName, dbo.SchoolData.City,
                                dbo.SchoolData.District, dbo.SchoolData.Town
                FROM      dbo.MailBox LEFT OUTER JOIN
                dbo.SchoolData ON dbo.MailBox.SchoolNo = dbo.SchoolData.SchoolNo";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAddView(29, "MailBoxV", sql);
        list.Add(sqlModel);

        sql = "ALTER TABLE SchoolData ADD UseSchoolAbout bit NOT NULL DEFAULT 0, UseSchoolNotice bit NOT NULL DEFAULT 0, UseSchoolActice bit NOT NULL DEFAULT 0, UseSchoolMainBox bit NOT NULL DEFAULT 0";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterTableAddColumn(30, "SchoolData", "UseSchoolAbout", sql);
        list.Add(sqlModel);

        sql = "ALTER TABLE Advs ADD Link [nvarchar](200) NOT NULL DEFAULT ('')";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterTableAddColumn(31, "Advs", "Link", sql);
        list.Add(sqlModel);

        sql = @"INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Base','DepartStaffNewPower')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Base','DepartStaffModifyPower')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','AdvsNewPower')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','AdvsModifyPower')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','SchoolNews0NewPower')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','SchoolNews0MofifyPower')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','SchoolNews1NewPower')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','SchoolNews1MofifyPower')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','SchoolNews2NewPower')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','SchoolNews2MofifyPower')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','SchoolNews3NewPower')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','SchoolNews3MofifyPower')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','NoticeNewPower')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','NoticeModifyPower')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','SchoolActiveNewPower')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','SchoolActiveModifyPower')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','MainPagePicSetPower')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','BackgroundImageSetPower')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','MailBoxSearch1Power')";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetInsertTable(32, "PowerName", "PowerName", "DepartStaffNewPower", sql);
        list.Add(sqlModel);

        sql = "ALTER TABLE Users ADD BindSchoolNo [nvarchar](200) NOT NULL DEFAULT ('')";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterTableAddColumn(33, "Users", "BindSchoolNo", sql);
        list.Add(sqlModel);

        sql = @"ALTER VIEW UserV
                AS
                SELECT   TOP (100) PERCENT Users.Evenid, Users.UserID, Users.UserName, Users.UserPassword,
                                Users.DepartmentNo, Users.Duty, Users.MovePhone, Users.MsgBalance, Users.MACRestrict,
                                Users.MAC1, Users.MAC2, Users.MAC3, Users.MAC4, Users.MAC5, Users.Email,
                                Users.SMTPServer, Users.EmailID, Users.EmailPassword, Users.CompanyPwd,
                                Users.ClientCheck, Users.Login, Users.RoleId, Users.Deputy, Users.Planner, Users.Buyer,
                                Users.SalesMan, Users.WarehouseMan, ISNULL(Department.DepartmentName, N'') AS DepartmentName,
                                Users.Photo, Users.DisclaimerCustomerNo, Users.DisclaimerCustomerSort,
                                Users.DisclaimerProviderNo, Users.DisclaimerProviderSort, Users.DisclaimerWarehouseNo,
                                Users.Pickinger, Users.LoginICCard, Users.DisclaimerProductNo, Users.DisclaimerProductSort,
                                Users.TurnRoom, Users.BindSchoolNo
                FROM      Users LEFT OUTER JOIN
                                Department ON Users.DepartmentNo = Department.DepartmentNo
                ORDER BY Users.UserID";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterView(34, "UserV", sql);
        list.Add(sqlModel);

        sql = @"CREATE TABLE OneCardApplication(
                [Evenid] [bigint] IDENTITY(1,1) NOT NULL,
                [School] [nvarchar](100) NOT NULL,
                [Name] [nvarchar](50) NOT NULL DEFAULT (''),
                [Banji] [nvarchar](50) NOT NULL DEFAULT (''),
                [Phone] [nvarchar](50) NOT NULL DEFAULT (''),
                [StudentImg] [nvarchar](100) NOT NULL DEFAULT (''),
                [Remark] [nvarchar](200) NOT NULL DEFAULT (''),
                [OpenId] [nvarchar](100) NOT NULL,
                [HappenDate] [datetime] NOT NULL
             CONSTRAINT [PK_OneCardApplication] PRIMARY KEY CLUSTERED
            (
                [Evenid] ASC
            )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
            ) ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(35, "OneCardApplication", sql);
        list.Add(sqlModel);

        sql = @"CREATE TABLE ClassActice(
                [Evenid] [bigint] IDENTITY(1,1) NOT NULL,
                [SchoolNo] [nvarchar](100) NOT NULL,
                [Banji] [nvarchar](100) NOT NULL,
                [MakeMan] [nvarchar](100) NOT NULL,
                [Headlines] [nvarchar](MAX) NOT NULL,
                [HappenDate] [datetime] NOT NULL,
                [Photos] [nvarchar](MAX) NOT NULL,
             CONSTRAINT [PK_ClassActice] PRIMARY KEY CLUSTERED
            (
                [Evenid] ASC
            )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
            ) ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(36, "ClassActice", sql);
        list.Add(sqlModel);

        sql = @"CREATE TABLE Music(
                [Evenid] [bigint] IDENTITY(1,1) NOT NULL,
                [MusicName] [nvarchar](100) NOT NULL,
                [Path] [nvarchar](100) NOT NULL
             CONSTRAINT [PK_Music] PRIMARY KEY CLUSTERED
            (
                [Evenid] ASC
            )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
            ) ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(37, "Music", sql);
        list.Add(sqlModel);

        sql = @"CREATE TABLE MainPageBackgroundPic(
                [Evenid] [bigint] IDENTITY(1,1) NOT NULL,
                [SchoolNo] [nvarchar](100) NOT NULL,
                [ImgPath] [nvarchar](100) NOT NULL,
             CONSTRAINT [PK_MainPageBackgroundPic] PRIMARY KEY CLUSTERED
            (
                [Evenid] ASC
            )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
            ) ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(38, "MainPageBackgroundPic", sql);
        list.Add(sqlModel);

        sql = @"INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Base','BackGroupMusicManagerPower')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Base','OneCardApplicationSearch1Power')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','MainPageBackgroundPicSetPower')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','ClassActiceModifyPower')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','ClassActiceNewPower')";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetInsertTable(39, "PowerName", "PowerName", "BackGroupMusicManagerPower", sql);
        list.Add(sqlModel);

        sql = @"CREATE TABLE MainPageFeatures(
                [Evenid] [bigint] IDENTITY(1,1) NOT NULL,
                [SchoolNo] [nvarchar](100) NOT NULL,
                [FeaturesNum] [int] NOT NULL,
                [Features] [nvarchar](1000) NOT NULL,
             CONSTRAINT [PK_MainPageFeatures] PRIMARY KEY CLUSTERED
            (
                [Evenid] ASC
            )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
            ) ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(40, "MainPageFeatures", sql);
        list.Add(sqlModel);

        sql = "INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','MainPageFeaturesSetPower')";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetInsertTable(41, "PowerName", "PowerName", "MainPageFeaturesSetPower", sql);
        list.Add(sqlModel);

        sql = "ALTER TABLE OneCardApplication ADD StudentNo [nvarchar](100) NOT NULL DEFAULT (''),DeliveryAddress [nvarchar](300) NOT NULL DEFAULT ('')";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterTableAddColumn(42, "OneCardApplication", "StudentNo", sql);
        list.Add(sqlModel);

        sql = "ALTER TABLE SendTemplateMessage ADD TemplateType [nvarchar](50) NOT NULL DEFAULT ('')";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterTableAddColumn(43, "SendTemplateMessage", "TemplateType", sql);
        list.Add(sqlModel);

        sql = "ALTER TABLE SendTemplateMessage ADD DS_JID [nvarchar](50) NOT NULL DEFAULT ('')";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterTableAddColumn(44, "SendTemplateMessage", "DS_JID", sql);
        list.Add(sqlModel);

        sql = @"CREATE TABLE StudentStar(
                [Evenid] [bigint] IDENTITY(1,1) NOT NULL,
                [SchoolNo] [nvarchar](100) NOT NULL,
                [Headlines] [nvarchar](100) NOT NULL,
                [HappenDate] [datetime] NOT NULL,
                [Photo] [nvarchar](300) NOT NULL,
                [Music] [nvarchar](100) NOT NULL,
                [Remarks] [ntext] NOT NULL,
                [See] [bigint] NOT NULL DEFAULT 0,
                [IsLookShow] [bit] NOT NULL,
             CONSTRAINT [PK_StudentStar] PRIMARY KEY CLUSTERED
            (
                [Evenid] ASC
            )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
            ) ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(45, "StudentStar", sql);
        list.Add(sqlModel);

        sql = @"INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','StudentStarNewPower')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','StudentStarModifyPower')";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetInsertTable(46, "PowerName", "PowerName", "StudentStarNewPower", sql);
        list.Add(sqlModel);

        sql = @"CREATE TABLE TeacherStudentMessage(
                [Evenid] [bigint] IDENTITY(1,1) NOT NULL,
                SchoolNo nvarchar(100) NOT NULL,
                FromOpenId nvarchar(50) NOT NULL,
                ToOpenId nvarchar(50) NOT NULL,
                FromName nvarchar(200) NOT NULL,
                ToName nvarchar(200) NOT NULL,
                Message nvarchar(500) NOT NULL,
                HappenDate datetime NOT NULL,
                MessageType int NOT NULL,
                IsRead bit NOT NULL,
             CONSTRAINT [PK_TeacherStudentMessage] PRIMARY KEY CLUSTERED
            (
                [Evenid] ASC
            )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
            ) ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(47, "TeacherStudentMessage", sql);
        list.Add(sqlModel);

        sql = @"CREATE VIEW TeacherToClassBindV
                AS
                SELECT     ISNULL(dbo.TeacherToClass.Class, N'') AS Class, dbo.SJ_DepartStaff.D_Name, dbo.SJ_DepartStaff.DS_Name, dbo.SJ_DepartStaff.DS_Sex,
                                      dbo.SJ_DepartStaff.DS_DocumentNo, dbo.SJ_DepartStaff.DS_Tele, dbo.SJ_DepartStaff.DS_Post, dbo.SJ_DepartStaff.DS_JID, dbo.SJ_DepartStaff.DS_UID,
                                      dbo.SJ_DepartStaff.SchoolNo, dbo.TeacherToClass.IdentityName, dbo.TeacherBindInfo.OpenId
                FROM         dbo.TeacherBindInfo INNER JOIN
                                      dbo.SJ_DepartStaff ON dbo.TeacherBindInfo.TeacherId = dbo.SJ_DepartStaff.DS_JID AND
                                      dbo.TeacherBindInfo.SchoolNo = dbo.SJ_DepartStaff.SchoolNo LEFT OUTER JOIN
                                      dbo.TeacherToClass ON dbo.SJ_DepartStaff.DS_UID = dbo.TeacherToClass.Guid AND dbo.SJ_DepartStaff.SchoolNo = dbo.TeacherToClass.SchoolNo
                WHERE     (dbo.SJ_DepartStaff.DS_Post <> '学生')";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAddView(48, "TeacherToClassBindV", sql);
        list.Add(sqlModel);

        sql = "ALTER TABLE ParentBindInfo ADD IdentityName [nvarchar](100) NOT NULL DEFAULT ('爸爸')";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterTableAddColumn(49, "ParentBindInfo", "IdentityName", sql);
        list.Add(sqlModel);

        sql = @"ALTER VIEW StudentParentV
                AS
                SELECT     dbo.SJ_DepartStaff.DS_JID, dbo.SJ_DepartStaff.D_Name, dbo.SJ_DepartStaff.DS_Name, dbo.SJ_DepartStaff.DS_Sex, dbo.SJ_DepartStaff.DS_DocumentNo,
                                      dbo.SJ_DepartStaff.DS_Tele, dbo.SJ_DepartStaff.DS_Post, dbo.SJ_DepartStaff.DS_UID, dbo.SJ_DepartStaff.SchoolNo, dbo.ParentBindInfo.OpenId,
                                      dbo.ParentBindInfo.IdentityName
                FROM         dbo.SJ_DepartStaff INNER JOIN
                                      dbo.ParentBindInfo ON dbo.SJ_DepartStaff.DS_UID = dbo.ParentBindInfo.StuentUId";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterView(50, "StudentParentV", sql);
        list.Add(sqlModel);

        sql = @"CREATE TABLE StudentPoint(
                [Evenid] [bigint] IDENTITY(1,1) NOT NULL,
                [SchoolNo] [nvarchar](100) NOT NULL,
                [BanjiName] [nvarchar](100) NOT NULL,
                [XinMing] [nvarchar](100) NOT NULL,
                [BianHao] [nvarchar](100) NOT NULL,
                [ExamType] [nvarchar](100) NOT NULL,
                [ExamName] [nvarchar](100) NOT NULL,
                [ExamTime] [datetime] NOT NULL,
                [HappenDate] [datetime] NOT NULL,
                [YuWen] [float] NOT NULL default -1,
                [ShuXue] [float] NOT NULL default -1,
                [YingYu] [float] NOT NULL default -1,
                [ZhengZhi] [float] NOT NULL default -1,
                [WuLi] [float] NOT NULL default -1,
                [HuaXue] [float] NOT NULL default -1,
                [DiLi] [float] NOT NULL default -1,
                [LiShi] [float] NOT NULL default -1,
                [ShengWu] [float] NOT NULL default -1,
                [MeiShu] [float] NOT NULL default -1,
                [YinYue] [float] NOT NULL default -1,
                [TiYu] [float] NOT NULL default -1,
                [DeYuKaoKe] [float] NOT NULL default -1,
                [NaoDongJiShu] [float] NOT NULL default -1,
                [JiSuanJi] [float] NOT NULL default -1,
                [WuLiShiYan] [float] NOT NULL default -1,
                [HuaXueShiYan] [float] NOT NULL default -1,
                [ShengWuShiYan] [float] NOT NULL default -1,
                [TongYongJiShu] [float] NOT NULL default -1,
                [ZhongHeShiJian] [float] NOT NULL default -1,
                [XinXiJiShu] [float] NOT NULL default -1,
                [DiErWaiYu] [float] NOT NULL default -1,
                [BanJiPaiMing] [float] NOT NULL default -1,
                [NianJiPaiMing] [float] NOT NULL default -1,
             CONSTRAINT [PK_StudentPoint] PRIMARY KEY CLUSTERED
            (
                [Evenid] ASC
            )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
            ) ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(51, "StudentPoint", sql);
        list.Add(sqlModel);

        sql = @"INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','StudentPointNewPower')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','StudentPointSearch1Power')";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetInsertTable(52, "PowerName", "PowerName", "StudentPointNewPower", sql);
        list.Add(sqlModel);

        sql = "ALTER TABLE ClassActice ADD MakeManNo [nvarchar](100) NOT NULL DEFAULT ('')";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterTableAddColumn(53, "ClassActice", "MakeManNo", sql);
        list.Add(sqlModel);

        sql = "ALTER TABLE ClassActice ADD MakeManType int NOT NULL DEFAULT 0";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterTableAddColumn(54, "ClassActice", "MakeManType", sql);
        list.Add(sqlModel);

        sql = @"ALTER VIEW UserV
                AS
                SELECT     TOP (100) PERCENT dbo.Users.Evenid, dbo.Users.UserID, dbo.Users.UserName, dbo.Users.UserPassword, dbo.Users.DepartmentNo, dbo.Users.Duty,
                                      dbo.Users.MovePhone, dbo.Users.MsgBalance, dbo.Users.MACRestrict, dbo.Users.MAC1, dbo.Users.MAC2, dbo.Users.MAC3, dbo.Users.MAC4, dbo.Users.MAC5,
                                      dbo.Users.Email, dbo.Users.SMTPServer, dbo.Users.EmailID, dbo.Users.EmailPassword, dbo.Users.CompanyPwd, dbo.Users.ClientCheck, dbo.Users.Login,
                                      dbo.Users.RoleId, dbo.Users.Deputy, dbo.Users.Planner, dbo.Users.Buyer, dbo.Users.SalesMan, dbo.Users.WarehouseMan,
                                      ISNULL(dbo.Department.DepartmentName, N'') AS DepartmentName, dbo.Users.Photo, dbo.Users.DisclaimerCustomerNo, dbo.Users.DisclaimerCustomerSort,
                                      dbo.Users.DisclaimerProviderNo, dbo.Users.DisclaimerProviderSort, dbo.Users.DisclaimerWarehouseNo, dbo.Users.Pickinger, dbo.Users.LoginICCard,
                                      dbo.Users.DisclaimerProductNo, dbo.Users.DisclaimerProductSort, dbo.Users.TurnRoom, dbo.Users.BindSchoolNo, dbo.SchoolData.SchoolName
                FROM         dbo.Users LEFT OUTER JOIN
                                      dbo.SchoolData ON dbo.Users.BindSchoolNo = dbo.SchoolData.SchoolNo LEFT OUTER JOIN
                                      dbo.Department ON dbo.Users.DepartmentNo = dbo.Department.DepartmentNo
                ORDER BY dbo.Users.UserID";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterView(55, "UserV", sql);
        list.Add(sqlModel);

        sql = @"CREATE TABLE TeacherSendMessage(
                [Evenid] [bigint] IDENTITY(1,1) NOT NULL,
                SchoolNo nvarchar(100) NOT NULL,
                SchoolName nvarchar(100) NOT NULL,
                Message nvarchar(MAX) NOT NULL,
                MessageHead nvarchar(500) NOT NULL,
                MessageFoot nvarchar(500) NOT NULL,
                FromMan nvarchar(100) NOT NULL,
                FromName nvarchar(100) NOT NULL,
                FromIdentityName nvarchar(100) NOT NULL,
                ToUid nvarchar(200) NOT NULL,
                ToOpenid nvarchar(100) NOT NULL,
                Url nvarchar(500) NOT NULL,
                MessageType int NOT NULL,
                HappenDate datetime NOT NULL,
                ErrMessage nvarchar(1000) NOT NULL,
                IsSend bit NOT NULL,
                IsErr bit NOT NULL,
             CONSTRAINT [PK_TeacherSendMessage] PRIMARY KEY CLUSTERED
            (
                [Evenid] ASC
            )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
            ) ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(56, "TeacherSendMessage", sql);
        list.Add(sqlModel);

        sql = @"CREATE VIEW TeacherSendMessageV
                AS
                SELECT     dbo.TeacherSendMessage.SchoolNo, dbo.TeacherSendMessage.SchoolName, dbo.TeacherSendMessage.Message, dbo.TeacherSendMessage.MessageHead,
                                      dbo.TeacherSendMessage.MessageFoot, dbo.TeacherSendMessage.FromMan, dbo.TeacherSendMessage.FromName, dbo.TeacherSendMessage.FromIdentityName,
                                      dbo.TeacherSendMessage.ToUid, dbo.TeacherSendMessage.ToOpenid, dbo.TeacherSendMessage.Url, dbo.TeacherSendMessage.MessageType,
                                      dbo.TeacherSendMessage.HappenDate, dbo.TeacherSendMessage.ErrMessage, dbo.TeacherSendMessage.IsSend, dbo.TeacherSendMessage.IsErr,
                                      dbo.SJ_DepartStaff.DS_Name
                FROM         dbo.TeacherSendMessage LEFT OUTER JOIN
                                      dbo.SJ_DepartStaff ON dbo.TeacherSendMessage.ToUid = dbo.SJ_DepartStaff.DS_UID";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAddView(57, "TeacherSendMessageV", sql);
        list.Add(sqlModel);

        sql = @"INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Sale','TeacherSendMessageSearch1Power')";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetInsertTable(58, "PowerName", "PowerName", "TeacherSendMessageSearch1Power", sql);
        list.Add(sqlModel);

        sql = @"CREATE TABLE AttendanceRecord(
                [f_RecID] [bigint] NOT NULL,
                f_ReadDate datetime NOT NULL,
                f_ControllerSN nvarchar(100),
                f_DoorNames nvarchar(100),
                f_ReaderName nvarchar(100),
                DS_JID nvarchar(100),
                DS_Name nvarchar(100),
                DS_Sex nvarchar(30),
                DS_DocumentNo nvarchar(200),
                DS_Tele nvarchar(100),
                DS_Post nvarchar(100),
                D_Name nvarchar(100),
                ECI_CardID nvarchar(100),
                ECI_CardfaceID nvarchar(100),
                SchoolNo nvarchar(100) NOT NULL,
                ) ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(59, "AttendanceRecord", sql);
        list.Add(sqlModel);

        sql = @"CREATE TABLE PayRecord(
                [CA_ND] [bigint] NOT NULL,
                ECI_CardID nvarchar(100),
                ECI_CardfaceID nvarchar(100),
                Oper_Login nvarchar(100),
                DS_Name nvarchar(100),
                D_Name nvarchar(100),
                CA_OperateType nvarchar(100),
                CA_OccDate datetime NOT NULL,
                CA_Amount float,
                CA_AccountType nvarchar(100),
                CA_AddType nvarchar(100),
                CA_Balance float,
                SchoolNo nvarchar(100) NOT NULL,
                ) ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(60, "PayRecord", sql);
        list.Add(sqlModel);

        sql = @"INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Base','AttendanceRecordSearch1Power')
                INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Base','PayRecordSearch1Power')";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetInsertTable(61, "PowerName", "PowerName", "AttendanceRecordSearch1Power", sql);
        list.Add(sqlModel);

        sql = @"CREATE VIEW AttendanceRecordV
                AS
                SELECT     dbo.AttendanceRecord.f_RecID, dbo.AttendanceRecord.f_ReadDate, dbo.AttendanceRecord.f_ControllerSN, dbo.AttendanceRecord.f_DoorNames,
                                      dbo.AttendanceRecord.f_ReaderName, dbo.AttendanceRecord.DS_JID, dbo.AttendanceRecord.DS_Name, dbo.AttendanceRecord.DS_Sex,
                                      dbo.AttendanceRecord.DS_DocumentNo, dbo.AttendanceRecord.DS_Tele, dbo.AttendanceRecord.DS_Post, dbo.AttendanceRecord.D_Name,
                                      dbo.AttendanceRecord.ECI_CardID, dbo.AttendanceRecord.ECI_CardfaceID, dbo.AttendanceRecord.SchoolNo, dbo.SchoolData.SchoolName
                FROM         dbo.AttendanceRecord LEFT OUTER JOIN
                                      dbo.SchoolData ON dbo.AttendanceRecord.SchoolNo = dbo.SchoolData.SchoolNo";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAddView(62, "AttendanceRecordV", sql);
        list.Add(sqlModel);

        sql = @"CREATE VIEW PayRecordV
                AS
                SELECT     dbo.PayRecord.CA_ND, dbo.PayRecord.ECI_CardID, dbo.PayRecord.ECI_CardfaceID, dbo.PayRecord.Oper_Login, dbo.PayRecord.DS_Name, dbo.PayRecord.D_Name,
                                      dbo.PayRecord.CA_OperateType, dbo.PayRecord.CA_OccDate, dbo.PayRecord.CA_Amount, dbo.PayRecord.CA_AccountType, dbo.PayRecord.CA_AddType,
                                      dbo.PayRecord.CA_Balance, dbo.PayRecord.SchoolNo, dbo.SchoolData.SchoolName
                FROM         dbo.PayRecord LEFT OUTER JOIN
                                      dbo.SchoolData ON dbo.PayRecord.SchoolNo = dbo.SchoolData.SchoolNo";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAddView(63, "PayRecordV", sql);
        list.Add(sqlModel);

        sql = "ALTER TABLE SJ_DepartStaff ADD IsManager bit NOT NULL DEFAULT 0";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterTableAddColumn(64, "SJ_DepartStaff", "IsManager", sql);
        list.Add(sqlModel);

        sql = @"ALTER VIEW SJ_DepartStaffV
                AS
                SELECT     dbo.SJ_DepartStaff.DS_JID, dbo.SJ_DepartStaff.D_Name, dbo.SJ_DepartStaff.DS_Name, dbo.SJ_DepartStaff.DS_Sex, dbo.SJ_DepartStaff.DS_DocumentNo,
                                      dbo.SJ_DepartStaff.DS_Tele, dbo.SJ_DepartStaff.DS_Post, dbo.SJ_DepartStaff.DS_UID, dbo.SJ_DepartStaff.SchoolNo, dbo.SchoolData.SchoolPwd,
                                      dbo.SchoolData.SchoolName, dbo.SchoolData.CanUse, dbo.SchoolData.SendTimeUp, dbo.SchoolData.SendTimeDown, dbo.SchoolData.City, dbo.SchoolData.District,
                                      dbo.SchoolData.Town, dbo.SJ_DepartStaff.IsManager
                FROM         dbo.SJ_DepartStaff LEFT OUTER JOIN
                                      dbo.SchoolData ON dbo.SJ_DepartStaff.SchoolNo = dbo.SchoolData.SchoolNo";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterView(65, "SJ_DepartStaffV", sql);
        list.Add(sqlModel);

        sql = @"ALTER VIEW TeacherBindInfoV
                AS
                SELECT     dbo.TeacherBindInfo.OpenId, dbo.SJ_DepartStaff.DS_JID, dbo.SJ_DepartStaff.D_Name, dbo.SJ_DepartStaff.DS_Name, dbo.SJ_DepartStaff.DS_Sex,
                                      dbo.SJ_DepartStaff.DS_DocumentNo, dbo.SJ_DepartStaff.DS_Tele, dbo.SJ_DepartStaff.DS_Post, dbo.SJ_DepartStaff.DS_UID, dbo.SJ_DepartStaff.SchoolNo,
                                      dbo.SJ_DepartStaff.IsManager
                FROM         dbo.TeacherBindInfo INNER JOIN
                                      dbo.SJ_DepartStaff ON dbo.TeacherBindInfo.TeacherId = dbo.SJ_DepartStaff.DS_JID AND dbo.TeacherBindInfo.SchoolNo = dbo.SJ_DepartStaff.SchoolNo";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAlterView(66, "TeacherBindInfoV", sql);
        list.Add(sqlModel);

        sql = @"CREATE TABLE TeacherDayCheckRecord(
                [Evenid] [bigint] IDENTITY(1,1) NOT NULL,
                SchoolNo nvarchar(100) NOT NULL,
                DS_Name nvarchar(100) NOT NULL,
                DS_JID nvarchar(100) NOT NULL,
                D_Name nvarchar(100) NOT NULL,
                LeaveType int NOT NULL,
                Memos nvarchar(200) NOT NULL,
                HappenDate datetime NOT NULL,
             CONSTRAINT [PK_TeacherDayCheckRecord] PRIMARY KEY CLUSTERED
            (
                [Evenid] ASC
            )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
            ) ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(67, "TeacherDayCheckRecord", sql);
        list.Add(sqlModel);

        sql = @"CREATE TABLE TeacherDayCheckSubmitRecord(
                [Evenid] [bigint] IDENTITY(1,1) NOT NULL,
                SchoolNo nvarchar(100) NOT NULL,
                D_Name nvarchar(100) NOT NULL,
                IsSubmit bit NOT NULL,
                HappenDate datetime NOT NULL,
             CONSTRAINT [PK_TeacherDayCheckSubmitRecord] PRIMARY KEY CLUSTERED
            (
                [Evenid] ASC
            )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
            ) ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(68, "TeacherDayCheckSubmitRecord", sql);
        list.Add(sqlModel);

        sql = @"CREATE TABLE StudentLeaveRecord(
                [Evenid] [bigint] IDENTITY(1,1) NOT NULL,
                SchoolNo nvarchar(100) NOT NULL,
                Student_Name nvarchar(100) NOT NULL,
                Student_JID nvarchar(100) NOT NULL,
                Student_DName nvarchar(100) NOT NULL,
                Student_Openid nvarchar(100) NOT NULL,
                Teacher_Name nvarchar(100) NOT NULL,
                Teacher_JID nvarchar(100) NOT NULL,
                Teacher_Openid nvarchar(100) NOT NULL,
                TimeSelect datetime NOT NULL,
                LeaveType int NOT NULL,
                TimeChose int NOT NULL,
                Memos nvarchar(200) NOT NULL,
                RecordState int NOT NULL,
                HappenDate datetime NOT NULL,
             CONSTRAINT [PK_StudentLeaveRecord] PRIMARY KEY CLUSTERED
            (
                [Evenid] ASC
            )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
            ) ON [PRIMARY]";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetCreateTableSql(69, "StudentLeaveRecord", sql);
        list.Add(sqlModel);

        sql = @"CREATE VIEW StudentLeaveRecordV
                AS
                SELECT     dbo.StudentLeaveRecord.Evenid, dbo.StudentLeaveRecord.SchoolNo, dbo.StudentLeaveRecord.Student_Name, dbo.StudentLeaveRecord.Student_JID,
                                      dbo.StudentLeaveRecord.Student_DName, dbo.StudentLeaveRecord.Student_Openid, dbo.StudentLeaveRecord.Teacher_Name,
                                      dbo.StudentLeaveRecord.Teacher_JID, dbo.StudentLeaveRecord.Teacher_Openid, dbo.StudentLeaveRecord.TimeSelect, dbo.StudentLeaveRecord.LeaveType,
                                      dbo.StudentLeaveRecord.TimeChose, dbo.StudentLeaveRecord.Memos, dbo.StudentLeaveRecord.RecordState, dbo.StudentLeaveRecord.HappenDate,
                                      dbo.SchoolData.SchoolName
                FROM         dbo.StudentLeaveRecord LEFT OUTER JOIN
                                      dbo.SchoolData ON dbo.StudentLeaveRecord.SchoolNo = dbo.SchoolData.SchoolNo";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetAddView(70, "StudentLeaveRecordV", sql);
        list.Add(sqlModel);

        sql = @"INSERT INTO PowerName([Modules] ,[PowerName]) VALUES ('Base','StudentLeaveRecordSearch1Power')";
        sqlModel = new SqlUpdateModel();
        sqlModel.SetInsertTable(71, "PowerName", "PowerName", "StudentLeaveRecordSearch1Power", sql);
        list.Add(sqlModel);

        return list;
    }