USE [book]
GO
/****** Object:  View [dbo].[v_booklist]    Script Date: 08/04/2022 09:03:16 ******/
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: 08/04/2022 09:03:16 ******/
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: 08/04/2022 09:03:16 ******/
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].[ad_ou]    Script Date: 08/04/2022 09:03:16 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ad_ou]') AND type in (N'U'))
DROP TABLE [dbo].[ad_ou]
GO
/****** Object:  Table [dbo].[book_booklist]    Script Date: 08/04/2022 09:03:16 ******/
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: 08/04/2022 09:03:16 ******/
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: 08/04/2022 09:03:16 ******/
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: 08/04/2022 09:03:16 ******/
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: 08/04/2022 09:03:16 ******/
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].[dd_dept]    Script Date: 08/04/2022 09:03:16 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[dd_dept]') AND type in (N'U'))
DROP TABLE [dbo].[dd_dept]
GO
/****** Object:  Table [dbo].[dd_users]    Script Date: 08/04/2022 09:03:16 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[dd_users]') AND type in (N'U'))
DROP TABLE [dbo].[dd_users]
GO
/****** Object:  Table [dbo].[qywx_dept]    Script Date: 08/04/2022 09:03:16 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[qywx_dept]') AND type in (N'U'))
DROP TABLE [dbo].[qywx_dept]
GO
/****** Object:  Table [dbo].[qywx_users]    Script Date: 08/04/2022 09:03:15 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[qywx_users]') AND type in (N'U'))
DROP TABLE [dbo].[qywx_users]
GO
/****** Object:  Table [dbo].[users_dept]    Script Date: 08/04/2022 09:03:15 ******/
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: 08/04/2022 09:03:15 ******/
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: 08/04/2022 09:03:15 ******/
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: 08/04/2022 09:03:15 ******/
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: 08/04/2022 09:03:15 ******/
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: 08/04/2022 09:03:15 ******/
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: 08/04/2022 09:03:14 ******/
IF  EXISTS (SELECT * FROM sys.database_principals WHERE name = N'book')
DROP USER [book]
GO
/****** Object:  User [book]    Script Date: 08/04/2022 09:03:14 ******/
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: 08/04/2022 09:03:15 ******/
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 (1, 1, N'Administrators')
SET IDENTITY_INSERT [dbo].[users_usersinroles] OFF
/****** Object:  Table [dbo].[users_users]    Script Date: 08/04/2022 09:03:15 ******/
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,
	[oudept] [nvarchar](1000) 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], [oudept]) 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', NULL, NULL, NULL, NULL, NULL, NULL, NULL, N'images/avtor.jpg', NULL, 1, N'', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, CAST(0x0000AE1300AD9328 AS DateTime), CAST(0x0000AE1300AD9328 AS DateTime), 0, NULL, 0, NULL, 0, 0, 1, NULL, N'1', NULL, NULL)
SET IDENTITY_INSERT [dbo].[users_users] OFF
/****** Object:  Table [dbo].[users_roles]    Script Date: 08/04/2022 09:03:15 ******/
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'系统管理员')
SET IDENTITY_INSERT [dbo].[users_roles] OFF
/****** Object:  Table [dbo].[users_releation]    Script Date: 08/04/2022 09:03:15 ******/
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: 08/04/2022 09:03:15 ******/
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: 08/04/2022 09:03:15 ******/
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](50) 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].[qywx_users]    Script Date: 08/04/2022 09:03:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[qywx_users]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[qywx_users](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[username] [nvarchar](200) NULL,
	[displayname] [nvarchar](300) NULL,
	[title] [nvarchar](500) NULL,
	[deptid] [int] NULL,
	[mobile] [nvarchar](500) NULL,
	[email] [nvarchar](500) NULL,
	[pinyin] [nvarchar](500) NULL,
	[tel] [nvarchar](100) NULL,
 CONSTRAINT [PK_wx_users] 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].[qywx_dept]    Script Date: 08/04/2022 09:03:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[qywx_dept]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[qywx_dept](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[deptid] [int] NULL,
	[deptname] [nvarchar](200) NULL,
	[parentid] [int] NULL,
	[orderid] [int] NULL,
	[fullpath] [nvarchar](500) NULL,
 CONSTRAINT [PK_wx_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
/****** Object:  Table [dbo].[dd_users]    Script Date: 08/04/2022 09:03:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[dd_users]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[dd_users](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[username] [nvarchar](200) NULL,
	[displayname] [nvarchar](300) NULL,
	[department] [nvarchar](500) NULL,
	[deptid] [int] NULL,
	[mobile] [nvarchar](500) NULL,
	[email] [nvarchar](500) NULL,
	[pinyin] [nvarchar](500) NULL,
	[unionid] [nvarchar](500) NULL,
	[tel] [nvarchar](100) NULL,
	[title] [nvarchar](300) NULL,
 CONSTRAINT [PK_wx_usersdd] 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].[dd_dept]    Script Date: 08/04/2022 09:03:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[dd_dept]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[dd_dept](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[deptid] [int] NULL,
	[deptname] [nvarchar](200) NULL,
	[parentid] [int] NULL,
	[orderid] [int] NULL,
	[fullpath] [nvarchar](500) NULL,
 CONSTRAINT [PK_wx_deptdd] 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_schedular]    Script Date: 08/04/2022 09:03:16 ******/
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: 08/04/2022 09:03:16 ******/
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
/****** Object:  Table [dbo].[book_category_area]    Script Date: 08/04/2022 09:03:16 ******/
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'上海分公司')
SET IDENTITY_INSERT [dbo].[book_category_area] OFF
/****** Object:  Table [dbo].[book_categories]    Script Date: 08/04/2022 09:03:16 ******/
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'1', N'1', N'1', N'1', 20, 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'1', 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 (3, N'BJ Room3', 0, N'room', N'All Roles;', 0, NULL, NULL, NULL, NULL, N'0', N'0', N'1', N'1', 50, 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'SH Room1', 0, N'room', N'All Roles;', 0, NULL, NULL, NULL, NULL, N'1', N'0', N'0', 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 (5, N'SH Room2', 0, N'room', N'All Roles;', 0, NULL, NULL, NULL, NULL, N'1', N'0', N'0', N'1', 20, 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'DELL', 0, N'pc', N'All Roles;', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 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 (7, N'HP Projector', 0, N'projector', N'All Roles;', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1)
SET IDENTITY_INSERT [dbo].[book_categories] OFF
/****** Object:  Table [dbo].[book_booklist]    Script Date: 08/04/2022 09:03:16 ******/
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] [nvarchar](1000) NULL,
	[rec] [nvarchar](1000) 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,
	[seq] [int] NULL CONSTRAINT [DF_book_booklist_seq]  DEFAULT ((0)),
 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], [seq]) VALUES (1, N'管理员', CAST(0x0000A9B0017DBB04 AS DateTime), CAST(0x0000A9B000000000 AS DateTime), CAST(0x0000A9B0011826C0 AS DateTime), CAST(0x0000A9B00130DEE0 AS DateTime), N'管理员', N'IT部门', N'18155261033', N'admin@120.24.86.232', N'1', N'人事培训', N'BJ Room1', N'1', N'', N'', N'', N'', N'白板;', N'内部会议;', N'admin@120.24.86.232', N'', N'1', N'1', N'c2e386ba-aa73-42c4-b6d8-8de3f4a85e7f', NULL, NULL, NULL, NULL, N'1', NULL, NULL, N'', N'', N'', 0)
SET IDENTITY_INSERT [dbo].[book_booklist] OFF
/****** Object:  Table [dbo].[ad_ou]    Script Date: 08/04/2022 09:03:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ad_ou]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[ad_ou](
	[deptname] [nvarchar](200) NULL,
	[catcode] [nvarchar](50) NULL,
	[pcatcode] [nvarchar](50) NULL,
	[path] [nvarchar](1000) NULL,
	[fullpath] [nvarchar](1000) NULL
) ON [PRIMARY]
END
GO
/****** Object:  Table [dbo].[wx_id]    Script Date: 08/04/2022 09:03:16 ******/
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: 08/04/2022 09:03:16 ******/
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: 08/04/2022 09:03:16 ******/
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
