
USE [mrbs]
GO
/****** Object:  View [dbo].[v_booklist]    Script Date: 04/02/2022 10:01:40 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[v_booklist]'))
DROP VIEW [dbo].[v_booklist]
GO
/****** Object:  View [dbo].[V_TodayBookList]    Script Date: 04/02/2022 10:01:40 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[V_TodayBookList]'))
DROP VIEW [dbo].[V_TodayBookList]
GO
/****** Object:  Table [dbo].[wx_id]    Script Date: 04/02/2022 10:01:40 ******/
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_wx_id_isdel]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[wx_id] DROP CONSTRAINT [DF_wx_id_isdel]
END
GO
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_wx_id_deletedate]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[wx_id] DROP CONSTRAINT [DF_wx_id_deletedate]
END
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[wx_id]') AND type in (N'U'))
DROP TABLE [dbo].[wx_id]
GO
/****** Object:  Table [dbo].[book_booklist]    Script Date: 04/02/2022 10:01:40 ******/
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_book_booklist_createdate]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[book_booklist] DROP CONSTRAINT [DF_book_booklist_createdate]
END
GO
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_book_booklist_seq]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[book_booklist] DROP CONSTRAINT [DF_book_booklist_seq]
END
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[book_booklist]') AND type in (N'U'))
DROP TABLE [dbo].[book_booklist]
GO
/****** Object:  Table [dbo].[book_categories]    Script Date: 04/02/2022 10:01:40 ******/
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF__book_cate__isdel__03317E3D]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[book_categories] DROP CONSTRAINT [DF__book_cate__isdel__03317E3D]
END
GO
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_book_categories_aid]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[book_categories] DROP CONSTRAINT [DF_book_categories_aid]
END
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[book_categories]') AND type in (N'U'))
DROP TABLE [dbo].[book_categories]
GO
/****** Object:  Table [dbo].[book_category_area]    Script Date: 04/02/2022 10:01:40 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[book_category_area]') AND type in (N'U'))
DROP TABLE [dbo].[book_category_area]
GO
/****** Object:  Table [dbo].[book_roomlayer]    Script Date: 04/02/2022 10:01:40 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[book_roomlayer]') AND type in (N'U'))
DROP TABLE [dbo].[book_roomlayer]
GO
/****** Object:  Table [dbo].[book_schedular]    Script Date: 04/02/2022 10:01:40 ******/
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_book_schedular_ispop]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[book_schedular] DROP CONSTRAINT [DF_book_schedular_ispop]
END
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[book_schedular]') AND type in (N'U'))
DROP TABLE [dbo].[book_schedular]
GO
/****** Object:  Table [dbo].[book_temp_xh]    Script Date: 04/02/2022 10:01:40 ******/
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_book_temp_xh_adddate]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[book_temp_xh] DROP CONSTRAINT [DF_book_temp_xh_adddate]
END
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[book_temp_xh]') AND type in (N'U'))
DROP TABLE [dbo].[book_temp_xh]
GO
/****** Object:  Table [dbo].[users_dept]    Script Date: 04/02/2022 10:01:39 ******/
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_portal_category_parentid]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[users_dept] DROP CONSTRAINT [DF_portal_category_parentid]
END
GO
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_portal_category_orderid]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[users_dept] DROP CONSTRAINT [DF_portal_category_orderid]
END
GO
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_portal_category_depth]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[users_dept] DROP CONSTRAINT [DF_portal_category_depth]
END
GO
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_hr_csscategory_path]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[users_dept] DROP CONSTRAINT [DF_hr_csscategory_path]
END
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[users_dept]') AND type in (N'U'))
DROP TABLE [dbo].[users_dept]
GO
/****** Object:  Table [dbo].[users_getpwd]    Script Date: 04/02/2022 10:01:39 ******/
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_users_getpwd_createdate]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[users_getpwd] DROP CONSTRAINT [DF_users_getpwd_createdate]
END
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[users_getpwd]') AND type in (N'U'))
DROP TABLE [dbo].[users_getpwd]
GO
/****** Object:  Table [dbo].[users_releation]    Script Date: 04/02/2022 10:01:39 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[users_releation]') AND type in (N'U'))
DROP TABLE [dbo].[users_releation]
GO
/****** Object:  Table [dbo].[users_roles]    Script Date: 04/02/2022 10:01:39 ******/
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_users_roles_issystem]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[users_roles] DROP CONSTRAINT [DF_users_roles_issystem]
END
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[users_roles]') AND type in (N'U'))
DROP TABLE [dbo].[users_roles]
GO
/****** Object:  Table [dbo].[users_users]    Script Date: 04/02/2022 10:01:39 ******/
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_users_users_avtor]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[users_users] DROP CONSTRAINT [DF_users_users_avtor]
END
GO
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_users_users_isenable]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[users_users] DROP CONSTRAINT [DF_users_users_isenable]
END
GO
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_users_users_openid]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[users_users] DROP CONSTRAINT [DF_users_users_openid]
END
GO
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_portal_users_createdate]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[users_users] DROP CONSTRAINT [DF_portal_users_createdate]
END
GO
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_portal_users_lastlogin]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[users_users] DROP CONSTRAINT [DF_portal_users_lastlogin]
END
GO
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_users_users_logintime]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[users_users] DROP CONSTRAINT [DF_users_users_logintime]
END
GO
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_users_users_logintime_1]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[users_users] DROP CONSTRAINT [DF_users_users_logintime_1]
END
GO
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_users_users_ismgr]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[users_users] DROP CONSTRAINT [DF_users_users_ismgr]
END
GO
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_users_users_issec]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[users_users] DROP CONSTRAINT [DF_users_users_issec]
END
GO
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_users_users_isstaff]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[users_users] DROP CONSTRAINT [DF_users_users_isstaff]
END
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[users_users]') AND type in (N'U'))
DROP TABLE [dbo].[users_users]
GO
/****** Object:  Table [dbo].[users_usersinroles]    Script Date: 04/02/2022 10:01:39 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[users_usersinroles]') AND type in (N'U'))
DROP TABLE [dbo].[users_usersinroles]
GO
/****** Object:  User [book]    Script Date: 04/02/2022 10:01:38 ******/
IF  EXISTS (SELECT * FROM sys.database_principals WHERE name = N'book')
DROP USER [book]
GO
/****** Object:  User [book]    Script Date: 04/02/2022 10:01:38 ******/
IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'book')
CREATE USER [book] WITHOUT LOGIN WITH DEFAULT_SCHEMA=[dbo]
GO
/****** Object:  Table [dbo].[users_usersinroles]    Script Date: 04/02/2022 10:01:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[users_usersinroles]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[users_usersinroles](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[uid] [int] NULL,
	[rolename] [nvarchar](50) NULL,
 CONSTRAINT [PK_portal_usersinroles] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET IDENTITY_INSERT [dbo].[users_usersinroles] ON
INSERT [dbo].[users_usersinroles] ([id], [uid], [rolename]) VALUES (7, 1, N'Administrators')
INSERT [dbo].[users_usersinroles] ([id], [uid], [rolename]) VALUES (8, 1, N'Repeat')
SET IDENTITY_INSERT [dbo].[users_usersinroles] OFF
/****** Object:  Table [dbo].[users_users]    Script Date: 04/02/2022 10:01:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[users_users]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[users_users](
	[uid] [int] IDENTITY(1,1) NOT NULL,
	[username] [nvarchar](256) NOT NULL,
	[password] [nvarchar](128) NULL,
	[displayname] [nvarchar](128) NULL,
	[department] [nvarchar](128) NULL,
	[email] [nvarchar](256) NULL,
	[tel] [nvarchar](128) NULL,
	[title] [nvarchar](128) NULL,
	[company] [nvarchar](128) NULL,
	[city] [nvarchar](256) NULL,
	[office] [nvarchar](256) NULL,
	[staffcode] [nvarchar](128) NULL,
	[sex] [nvarchar](50) NULL,
	[avtor] [nvarchar](300) NULL CONSTRAINT [DF_users_users_avtor]  DEFAULT ('images/avtor.jpg'),
	[mobile] [nvarchar](50) NULL,
	[isenable] [int] NULL CONSTRAINT [DF_users_users_isenable]  DEFAULT ((1)),
	[openid] [nvarchar](500) NULL CONSTRAINT [DF_users_users_openid]  DEFAULT (''),
	[wxname] [nvarchar](200) NULL,
	[wxsex] [nvarchar](50) NULL,
	[wxprovince] [nvarchar](100) NULL,
	[wxcity] [nvarchar](50) NULL,
	[wxavtor] [nvarchar](200) NULL,
	[unionid] [nvarchar](300) NULL,
	[idcode] [nvarchar](50) NULL,
	[idcodetime] [datetime] NULL,
	[address] [nvarchar](200) NULL,
	[description] [nvarchar](1024) NULL,
	[adpath] [nvarchar](1024) NULL,
	[firstname] [nvarchar](50) NULL,
	[lastname] [nvarchar](50) NULL,
	[fax] [nvarchar](128) NULL,
	[MailType] [nvarchar](128) NULL,
	[IsAccountActive] [int] NULL,
	[createdate] [datetime] NULL CONSTRAINT [DF_portal_users_createdate]  DEFAULT (getdate()),
	[lastlogin] [datetime] NULL CONSTRAINT [DF_portal_users_lastlogin]  DEFAULT (getdate()),
	[logintimes] [int] NULL CONSTRAINT [DF_users_users_logintime]  DEFAULT ((0)),
	[ip] [nvarchar](50) NULL,
	[logintime] [int] NULL CONSTRAINT [DF_users_users_logintime_1]  DEFAULT ((0)),
	[intro] [nvarchar](500) NULL,
	[ismgr] [int] NULL CONSTRAINT [DF_users_users_ismgr]  DEFAULT ((0)),
	[issec] [int] NULL CONSTRAINT [DF_users_users_issec]  DEFAULT ((0)),
	[isstaff] [int] NULL CONSTRAINT [DF_users_users_isstaff]  DEFAULT ((1)),
	[pinyin] [nvarchar](50) NULL,
	[status] [nvarchar](50) NULL,
	[aid] [int] NULL,
 CONSTRAINT [PK_portal_users_1] PRIMARY KEY CLUSTERED 
(
	[uid] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET IDENTITY_INSERT [dbo].[users_users] ON
INSERT [dbo].[users_users] ([uid], [username], [password], [displayname], [department], [email], [tel], [title], [company], [city], [office], [staffcode], [sex], [avtor], [mobile], [isenable], [openid], [wxname], [wxsex], [wxprovince], [wxcity], [wxavtor], [unionid], [idcode], [idcodetime], [address], [description], [adpath], [firstname], [lastname], [fax], [MailType], [IsAccountActive], [createdate], [lastlogin], [logintimes], [ip], [logintime], [intro], [ismgr], [issec], [isstaff], [pinyin], [status], [aid]) VALUES (1, N'admin', N'CE-0B-FD-15-05-9B-68-D6-76-88-88-4D-7A-3D-3E-8C', N'管理员', N'IT', N'983506039@qq.com', N'', N'', N'', NULL, N'', N'', N'男', N'images/avtor.jpg', N'', 1, N'', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, N'', NULL, NULL, CAST(0x0000AE6A0095FC43 AS DateTime), CAST(0x0000AE6A0095FC43 AS DateTime), 0, NULL, 0, N'', 0, 0, 1, N'GLY', NULL, NULL)
SET IDENTITY_INSERT [dbo].[users_users] OFF
/****** Object:  Table [dbo].[users_roles]    Script Date: 04/02/2022 10:01:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[users_roles]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[users_roles](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[rolename] [nvarchar](50) NULL,
	[issystem] [int] NULL CONSTRAINT [DF_users_roles_issystem]  DEFAULT ((0)),
	[roletype] [nvarchar](50) NULL,
 CONSTRAINT [PK_users_roles] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET IDENTITY_INSERT [dbo].[users_roles] ON
INSERT [dbo].[users_roles] ([id], [rolename], [issystem], [roletype]) VALUES (1, N'Administrators', 1, N'系统管理员')
INSERT [dbo].[users_roles] ([id], [rolename], [issystem], [roletype]) VALUES (2, N'Repeat', 1, N'具有此角色的员工可以预定循环会议室')
SET IDENTITY_INSERT [dbo].[users_roles] OFF
/****** Object:  Table [dbo].[users_releation]    Script Date: 04/02/2022 10:01:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[users_releation]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[users_releation](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[mgrid] [int] NULL,
	[secid] [int] NULL,
 CONSTRAINT [PK_users_releation] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[users_getpwd]    Script Date: 04/02/2022 10:01:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[users_getpwd]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[users_getpwd](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[uid] [int] NOT NULL,
	[display] [nvarchar](50) NULL,
	[createdate] [datetime] NULL CONSTRAINT [DF_users_getpwd_createdate]  DEFAULT (getdate()),
 CONSTRAINT [PK_users_getpwd] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[users_dept]    Script Date: 04/02/2022 10:01:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[users_dept]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[users_dept](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[catname] [nvarchar](250) NULL,
	[parentid] [int] NULL CONSTRAINT [DF_portal_category_parentid]  DEFAULT ((0)),
	[orderid] [int] NULL CONSTRAINT [DF_portal_category_orderid]  DEFAULT ((0)),
	[depth] [int] NULL CONSTRAINT [DF_portal_category_depth]  DEFAULT ((1)),
	[note] [nvarchar](200) NULL,
	[path] [nvarchar](1000) NULL CONSTRAINT [DF_hr_csscategory_path]  DEFAULT (''),
	[types] [nvarchar](50) NULL,
 CONSTRAINT [PK_users_dept] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET IDENTITY_INSERT [dbo].[users_dept] ON
INSERT [dbo].[users_dept] ([id], [catname], [parentid], [orderid], [depth], [note], [path], [types]) VALUES (1, N'人事部', 0, 1, 1, NULL, N'', NULL)
INSERT [dbo].[users_dept] ([id], [catname], [parentid], [orderid], [depth], [note], [path], [types]) VALUES (2, N'总经理', 0, 2, 1, NULL, N'', NULL)
INSERT [dbo].[users_dept] ([id], [catname], [parentid], [orderid], [depth], [note], [path], [types]) VALUES (3, N'IT部门', 0, 3, 1, NULL, N'', NULL)
INSERT [dbo].[users_dept] ([id], [catname], [parentid], [orderid], [depth], [note], [path], [types]) VALUES (4, N'财务部', 0, 4, 1, NULL, N'', NULL)
SET IDENTITY_INSERT [dbo].[users_dept] OFF
/****** Object:  Table [dbo].[book_temp_xh]    Script Date: 04/02/2022 10:01:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[book_temp_xh]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[book_temp_xh](
	[begintime] [datetime] NULL,
	[endtime] [datetime] NULL,
	[name] [nvarchar](500) NULL,
	[rules] [nvarchar](100) NULL,
	[guid] [nvarchar](200) NOT NULL,
	[text] [nvarchar](200) NULL,
	[adddate] [datetime] NULL CONSTRAINT [DF_book_temp_xh_adddate]  DEFAULT (getdate()),
 CONSTRAINT [PK_book_temp_xh_1] PRIMARY KEY CLUSTERED 
(
	[guid] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
INSERT [dbo].[book_temp_xh] ([begintime], [endtime], [name], [rules], [guid], [text], [adddate]) VALUES (NULL, NULL, NULL, N'MQ==#2#C#T#9#RCAqICo=', N'af016c34-01df-ccda-d343-84c1c570d325', N'重复每 1 天, 重复 10 次', CAST(0x0000A65F0068F22F AS DateTime))
INSERT [dbo].[book_temp_xh] ([begintime], [endtime], [name], [rules], [guid], [text], [adddate]) VALUES (NULL, NULL, NULL, N'MQ==#2#C#T#9#RCAqICo=', N'c87a4c37-935c-5f31-9c05-c3f55b537c4a', N'重复每 1 天, 重复 10 次', CAST(0x0000A65F0068D8E2 AS DateTime))
/****** Object:  Table [dbo].[book_schedular]    Script Date: 04/02/2022 10:01:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[book_schedular]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[book_schedular](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[begintime] [datetime] NULL,
	[endtime] [datetime] NULL,
	[uid] [int] NULL,
	[meetingid] [int] NULL,
	[title] [nvarchar](500) NULL,
	[ispop] [int] NULL CONSTRAINT [DF_book_schedular_ispop]  DEFAULT ((1)),
 CONSTRAINT [PK__book_schedular__07F6335A] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[book_roomlayer]    Script Date: 04/02/2022 10:01:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[book_roomlayer]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[book_roomlayer](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[aid] [int] NULL,
	[json] [nvarchar](3000) NULL,
 CONSTRAINT [PK_book_roomlayer] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET IDENTITY_INSERT [dbo].[book_roomlayer] ON
INSERT [dbo].[book_roomlayer] ([id], [aid], [json]) VALUES (1, 1, N'[{"cx":196,"cy":123,"fillColor":"238,44,44 ","text":"BJ ROOM1"},{"cx":302,"cy":125,"fillColor":"0,139,139","text":"BJ ROOM2"},{"cx":409,"cy":126,"fillColor":"1,1,1","text":"办公室Office"},{"cx":516,"cy":125,"fillColor":"1,1,1","text":"办公室Office"},{"cx":624,"cy":125,"fillColor":"100,138,100","text":"BJ ROOM3"},{"cx":193,"cy":247,"fillColor":"0,197,205","text":"BJ VIP ROOM"},{"cx":300,"cy":249,"fillColor":"255,0,255","text":"BJ BOARD ROOM"},{"cx":408,"cy":248,"fillColor":"238,44,44 ","text":"BJ LEARNING ROOM"},{"cx":521,"cy":248,"fillColor":"0,139,139","text":"BJ ROOM9"},{"cx":634,"cy":248,"fillColor":"1,1,1","text":"办公室Office"}]')
INSERT [dbo].[book_roomlayer] ([id], [aid], [json]) VALUES (2, 2, N'[{"cx":290,"cy":84,"fillColor":"255,0,255","text":"SH ROOM1"}]')
INSERT [dbo].[book_roomlayer] ([id], [aid], [json]) VALUES (3, 3, N'[{"cx":474,"cy":100,"fillColor":"0,139,139","text":"WH ROOM8"},{"cx":144,"cy":94,"fillColor":"1,1,1","text":"办公室Office"},{"cx":251,"cy":97,"fillColor":"1,1,1","text":"办公室Office"},{"cx":360,"cy":98,"fillColor":"1,1,1","text":"办公室Office"},{"cx":147,"cy":218,"fillColor":"100,138,100","text":"WH ROOM9"},{"cx":255,"cy":218,"fillColor":"1,1,1","text":"办公室Office"}]')
SET IDENTITY_INSERT [dbo].[book_roomlayer] OFF
/****** Object:  Table [dbo].[book_category_area]    Script Date: 04/02/2022 10:01:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[book_category_area]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[book_category_area](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[areaname] [nvarchar](200) NULL,
	[mapfield] [nvarchar](50) NULL,
	[orderid] [int] NULL,
	[isdefault] [int] NULL,
	[areavalue] [nvarchar](200) NULL,
 CONSTRAINT [PK_book_category_area] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET IDENTITY_INSERT [dbo].[book_category_area] ON
INSERT [dbo].[book_category_area] ([id], [areaname], [mapfield], [orderid], [isdefault], [areavalue]) VALUES (1, N'北京分公司', NULL, 0, 1, N'北京分公司')
INSERT [dbo].[book_category_area] ([id], [areaname], [mapfield], [orderid], [isdefault], [areavalue]) VALUES (2, N'上海分公司', NULL, 0, 0, N'上海分公司')
INSERT [dbo].[book_category_area] ([id], [areaname], [mapfield], [orderid], [isdefault], [areavalue]) VALUES (3, N'武汉分公司', NULL, 0, 0, N'武汉分公司')
SET IDENTITY_INSERT [dbo].[book_category_area] OFF
/****** Object:  Table [dbo].[book_categories]    Script Date: 04/02/2022 10:01:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[book_categories]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[book_categories](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[catname] [nvarchar](50) NULL,
	[orderid] [int] NULL,
	[cattype] [nvarchar](50) NULL,
	[allowroles] [nvarchar](500) NULL,
	[isdelete] [int] NULL CONSTRAINT [DF__book_cate__isdel__03317E3D]  DEFAULT ((0)),
	[url] [nvarchar](500) NULL,
	[username] [nvarchar](50) NULL,
	[password] [nvarchar](50) NULL,
	[domain] [nvarchar](50) NULL,
	[hasprojector] [nvarchar](50) NULL,
	[haspc] [nvarchar](50) NULL,
	[hastc] [nvarchar](50) NULL,
	[hasvtc] [nvarchar](50) NULL,
	[num] [int] NULL,
	[numtext] [nvarchar](50) NULL,
	[flash] [nvarchar](100) NULL,
	[prev1] [nvarchar](50) NULL,
	[prev2] [nvarchar](50) NULL,
	[ip] [nvarchar](50) NULL,
	[areaid] [int] NULL CONSTRAINT [DF_book_categories_aid]  DEFAULT ((0)),
 CONSTRAINT [PK__book_categories__023D5A04] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET IDENTITY_INSERT [dbo].[book_categories] ON
INSERT [dbo].[book_categories] ([id], [catname], [orderid], [cattype], [allowroles], [isdelete], [url], [username], [password], [domain], [hasprojector], [haspc], [hastc], [hasvtc], [num], [numtext], [flash], [prev1], [prev2], [ip], [areaid]) VALUES (1, N'BJ ROOM1', 0, N'room', N'All Roles;', 0, NULL, NULL, NULL, NULL, N'0', N'0', N'0', N'0', 10, NULL, NULL, N'0', N'0', NULL, 1)
INSERT [dbo].[book_categories] ([id], [catname], [orderid], [cattype], [allowroles], [isdelete], [url], [username], [password], [domain], [hasprojector], [haspc], [hastc], [hasvtc], [num], [numtext], [flash], [prev1], [prev2], [ip], [areaid]) VALUES (2, N'BJ ROOM2', 0, N'room', N'All Roles;', 0, NULL, NULL, NULL, NULL, N'0', N'0', N'0', N'0', 6, NULL, NULL, N'0', N'0', NULL, 1)
INSERT [dbo].[book_categories] ([id], [catname], [orderid], [cattype], [allowroles], [isdelete], [url], [username], [password], [domain], [hasprojector], [haspc], [hastc], [hasvtc], [num], [numtext], [flash], [prev1], [prev2], [ip], [areaid]) VALUES (3, N'BJ ROOM3', 0, N'room', N'All Roles;', 0, NULL, NULL, NULL, NULL, N'1', N'1', N'1', N'1', 15, NULL, NULL, N'0', N'0', NULL, 1)
INSERT [dbo].[book_categories] ([id], [catname], [orderid], [cattype], [allowroles], [isdelete], [url], [username], [password], [domain], [hasprojector], [haspc], [hastc], [hasvtc], [num], [numtext], [flash], [prev1], [prev2], [ip], [areaid]) VALUES (4, N'DELL', 0, N'pc', N'All Roles;', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 2)
INSERT [dbo].[book_categories] ([id], [catname], [orderid], [cattype], [allowroles], [isdelete], [url], [username], [password], [domain], [hasprojector], [haspc], [hastc], [hasvtc], [num], [numtext], [flash], [prev1], [prev2], [ip], [areaid]) VALUES (5, N'SH ROOM1', 0, N'room', N'All Roles;', 0, NULL, NULL, NULL, NULL, N'1', N'1', N'1', N'1', 10, NULL, NULL, N'0', N'0', NULL, 2)
INSERT [dbo].[book_categories] ([id], [catname], [orderid], [cattype], [allowroles], [isdelete], [url], [username], [password], [domain], [hasprojector], [haspc], [hastc], [hasvtc], [num], [numtext], [flash], [prev1], [prev2], [ip], [areaid]) VALUES (6, N'SH ROOM2', 0, N'room', N'All Roles;', 0, NULL, NULL, NULL, NULL, N'1', N'1', N'1', N'1', 10, NULL, NULL, N'0', N'0', NULL, 2)
INSERT [dbo].[book_categories] ([id], [catname], [orderid], [cattype], [allowroles], [isdelete], [url], [username], [password], [domain], [hasprojector], [haspc], [hastc], [hasvtc], [num], [numtext], [flash], [prev1], [prev2], [ip], [areaid]) VALUES (7, N'WH ROOM8', 0, N'room', N'All Roles;', 0, NULL, NULL, NULL, NULL, N'1', N'1', N'1', N'1', 10, NULL, NULL, N'0', N'0', NULL, 3)
INSERT [dbo].[book_categories] ([id], [catname], [orderid], [cattype], [allowroles], [isdelete], [url], [username], [password], [domain], [hasprojector], [haspc], [hastc], [hasvtc], [num], [numtext], [flash], [prev1], [prev2], [ip], [areaid]) VALUES (8, N'WH ROOM9', 0, N'room', N'All Roles;', 0, NULL, NULL, NULL, NULL, N'1', N'1', N'1', N'1', 10, NULL, NULL, N'0', N'0', NULL, 3)
INSERT [dbo].[book_categories] ([id], [catname], [orderid], [cattype], [allowroles], [isdelete], [url], [username], [password], [domain], [hasprojector], [haspc], [hastc], [hasvtc], [num], [numtext], [flash], [prev1], [prev2], [ip], [areaid]) VALUES (9, N'BJ VIP ROOM', 0, N'room', N'All Roles;', 0, NULL, NULL, NULL, NULL, N'0', N'0', N'0', N'0', 0, NULL, NULL, N'0', N'0', NULL, 1)
INSERT [dbo].[book_categories] ([id], [catname], [orderid], [cattype], [allowroles], [isdelete], [url], [username], [password], [domain], [hasprojector], [haspc], [hastc], [hasvtc], [num], [numtext], [flash], [prev1], [prev2], [ip], [areaid]) VALUES (10, N'BJ BOARD ROOM', 0, N'room', N'All Roles;', 0, NULL, NULL, NULL, NULL, N'0', N'0', N'0', N'0', 0, NULL, NULL, N'0', N'0', NULL, 1)
INSERT [dbo].[book_categories] ([id], [catname], [orderid], [cattype], [allowroles], [isdelete], [url], [username], [password], [domain], [hasprojector], [haspc], [hastc], [hasvtc], [num], [numtext], [flash], [prev1], [prev2], [ip], [areaid]) VALUES (11, N'BJ LEARNING ROOM', 0, N'room', N'All Roles;', 0, NULL, NULL, NULL, NULL, N'0', N'0', N'0', N'0', 0, NULL, NULL, N'0', N'0', NULL, 1)
INSERT [dbo].[book_categories] ([id], [catname], [orderid], [cattype], [allowroles], [isdelete], [url], [username], [password], [domain], [hasprojector], [haspc], [hastc], [hasvtc], [num], [numtext], [flash], [prev1], [prev2], [ip], [areaid]) VALUES (12, N'BJ ROOM9', 0, N'room', N'All Roles;', 0, NULL, NULL, NULL, NULL, N'0', N'0', N'0', N'0', 0, NULL, NULL, N'0', N'0', NULL, 1)
INSERT [dbo].[book_categories] ([id], [catname], [orderid], [cattype], [allowroles], [isdelete], [url], [username], [password], [domain], [hasprojector], [haspc], [hastc], [hasvtc], [num], [numtext], [flash], [prev1], [prev2], [ip], [areaid]) VALUES (13, N'PROJECTOR1', 0, N'projector', N'All Roles;', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 2)
INSERT [dbo].[book_categories] ([id], [catname], [orderid], [cattype], [allowroles], [isdelete], [url], [username], [password], [domain], [hasprojector], [haspc], [hastc], [hasvtc], [num], [numtext], [flash], [prev1], [prev2], [ip], [areaid]) VALUES (14, N'北京接待室', 0, N'room', N'', 0, NULL, NULL, NULL, NULL, N'0', N'0', N'0', N'0', 0, NULL, NULL, N'0', N'0', NULL, 1)
SET IDENTITY_INSERT [dbo].[book_categories] OFF
/****** Object:  Table [dbo].[book_booklist]    Script Date: 04/02/2022 10:01:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[book_booklist]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[book_booklist](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[username] [nvarchar](50) NULL,
	[createdate] [datetime] NULL CONSTRAINT [DF_book_booklist_createdate]  DEFAULT (getdate()),
	[bookdate] [datetime] NULL,
	[begintime] [datetime] NULL,
	[endtime] [datetime] NULL,
	[contactname] [nvarchar](50) NULL,
	[contactdept] [nvarchar](50) NULL,
	[contacttel] [nvarchar](50) NULL,
	[contactemail] [nvarchar](50) NULL,
	[numbers] [nvarchar](50) NULL,
	[intro] [nvarchar](500) NULL,
	[roomname] [nvarchar](500) NULL,
	[roomid] [nvarchar](50) NULL,
	[pcname] [nvarchar](50) NULL,
	[pcid] [nvarchar](50) NULL,
	[projectorname] [nvarchar](50) NULL,
	[projectorid] [nvarchar](50) NULL,
	[others1] [nvarchar](500) NULL,
	[others2] [nvarchar](500) NULL,
	[cc] [nvarchar](1000) NULL,
	[specialrequire] [nvarchar](500) NULL,
	[process] [nvarchar](50) NULL,
	[userid] [nvarchar](50) NULL,
	[guid] [uniqueidentifier] NULL,
	[rec] [nvarchar](500) NULL,
	[masterid] [int] NULL,
	[lastupdate] [datetime] NULL,
	[updateuser] [nvarchar](50) NULL,
	[aid] [nvarchar](10) NULL,
	[mgr] [nvarchar](200) NULL,
	[mgrtext] [nvarchar](1000) NULL,
	[attend] [nvarchar](200) NULL,
	[attendtext] [nvarchar](1000) NULL,
	[notice] [nvarchar](1000) NULL,
	[txt] [nvarchar](200) NULL,
	[seq] [int] NULL CONSTRAINT [DF_book_booklist_seq]  DEFAULT ((0)),
	[finishdate] [datetime] NULL,
 CONSTRAINT [PK__book_booklist__7C8480AE] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET IDENTITY_INSERT [dbo].[book_booklist] ON
INSERT [dbo].[book_booklist] ([id], [username], [createdate], [bookdate], [begintime], [endtime], [contactname], [contactdept], [contacttel], [contactemail], [numbers], [intro], [roomname], [roomid], [pcname], [pcid], [projectorname], [projectorid], [others1], [others2], [cc], [specialrequire], [process], [userid], [guid], [rec], [masterid], [lastupdate], [updateuser], [aid], [mgr], [mgrtext], [attend], [attendtext], [notice], [txt], [seq], [finishdate]) VALUES (1, N'管理员', CAST(0x0000AE6A00A2EA02 AS DateTime), CAST(0x0000AE6A00000000 AS DateTime), CAST(0x0000AE6A009450C0 AS DateTime), CAST(0x0000AE6A00A4CB80 AS DateTime), N'管理员', N'IT', N'', N'983506039@qq.com', N'2', N'cess', N'BJ LEARNING ROOM', N'11', N'', N'0', N'', N'0', N'', N'外部会议;', N'983506039@qq.com', N'', N'1', N'1', N'89bc8121-22a2-4c15-b681-bdf1fdfe0eda', N'', NULL, NULL, NULL, N'1', NULL, NULL, N'', N'', NULL, N'', 0, NULL)
SET IDENTITY_INSERT [dbo].[book_booklist] OFF
/****** Object:  Table [dbo].[wx_id]    Script Date: 04/02/2022 10:01:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[wx_id]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[wx_id](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[uid] [int] NULL,
	[wxid] [nvarchar](500) NULL,
	[isdel] [int] NULL CONSTRAINT [DF_wx_id_isdel]  DEFAULT ((0)),
	[deletedate] [datetime] NULL CONSTRAINT [DF_wx_id_deletedate]  DEFAULT (getdate()),
 CONSTRAINT [PK_wx_id] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
/****** Object:  View [dbo].[V_TodayBookList]    Script Date: 04/02/2022 10:01:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[V_TodayBookList]'))
EXEC dbo.sp_executesql @statement = N'

 create view [dbo].[V_TodayBookList]
 as
 
 select A.id as Id, 
        RoomId,
        catname as RoomName,
        begintime,
        Endtime,
        contactdept as Department,
        Intro As Title 
        from 
 (
  select id, begintime,endtime,contactdept,intro,roomid from book_booklist 
 where  datediff(day,endtime,getdate())=0  and process<2 and process<>4
 ) 
 A
 left join  book_categories on A.roomid=book_categories.id
'
GO
/****** Object:  View [dbo].[v_booklist]    Script Date: 04/02/2022 10:01:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[v_booklist]'))
EXEC dbo.sp_executesql @statement = N'CREATE VIEW [dbo].[v_booklist]
AS
SELECT     dbo.book_booklist.id, dbo.book_booklist.begintime, dbo.book_booklist.endtime, dbo.book_booklist.contactname, dbo.book_booklist.contactdept, 
                      dbo.book_booklist.contacttel, dbo.book_booklist.contactemail, dbo.book_booklist.numbers, dbo.book_booklist.intro, dbo.book_booklist.roomid, 
                      dbo.book_categories.catname AS roomname
FROM         dbo.book_booklist LEFT OUTER JOIN
                      dbo.book_categories ON dbo.book_booklist.roomid = dbo.book_categories.id
WHERE     (dbo.book_booklist.process <> 2) AND (dbo.book_booklist.process <> 4) AND (dbo.book_categories.cattype = ''room'')
'
GO
IF NOT EXISTS (SELECT * FROM ::fn_listextendedproperty(N'MS_DiagramPane1' , N'SCHEMA',N'dbo', N'VIEW',N'v_booklist', NULL,NULL))
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "book_booklist"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 125
               Right = 210
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "book_categories"
            Begin Extent = 
               Top = 6
               Left = 248
               Bottom = 125
               Right = 398
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'v_booklist'
GO
IF NOT EXISTS (SELECT * FROM ::fn_listextendedproperty(N'MS_DiagramPaneCount' , N'SCHEMA',N'dbo', N'VIEW',N'v_booklist', NULL,NULL))
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'v_booklist'
GO
