GO
/****** Object:  Table [dbo].[T_Sys_Code_Province]    Script Date: 02/09/2014 22:42:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_Sys_Code_Province](
	[ProvinceID] [varchar](40) NOT NULL,
	[ParentProvinceID] [varchar](40) NULL,
	[ProvinceName] [varchar](20) NOT NULL,
	[remark] [varchar](200) NULL,
 CONSTRAINT [XPKCode_Province] PRIMARY KEY NONCLUSTERED 
(
	[ProvinceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'地区ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Code_Province', @level2type=N'COLUMN',@level2name=N'ProvinceID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'父地区ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Code_Province', @level2type=N'COLUMN',@level2name=N'ParentProvinceID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'地区名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Code_Province', @level2type=N'COLUMN',@level2name=N'ProvinceName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Code_Province', @level2type=N'COLUMN',@level2name=N'remark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'行政区划省份代码表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Code_Province'
GO
/****** Object:  Table [dbo].[T_Certificate_Template_Info]    Script Date: 02/09/2014 22:42:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_Certificate_Template_Info](
	[TempID] [varchar](40) NOT NULL,
	[TempName] [varchar](100) NOT NULL,
	[TempBgUrl] [varchar](300) NOT NULL,
	[TempWidth] [varchar](10) NULL,
	[TempHeight] [varchar](10) NULL,
	[TempNoBgPicUrl] [varchar](300) NULL,
	[TempBgPicUrl] [varchar](300) NULL,
	[TempDateXls] [varchar](300) NULL,
	[CertificateData] [varchar](20) NULL,
	[Status] [char](1) NULL,
	[Creater] [varchar](40) NULL,
	[CreateTime] [varchar](20) NULL,
	[Remark] [ntext] NULL,
	[iscreatefile] [tinyint] NULL,
 CONSTRAINT [PK34] PRIMARY KEY NONCLUSTERED 
(
	[TempID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  StoredProcedure [dbo].[Pro_Certificates_Data_Page]    Script Date: 02/09/2014 22:42:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE procedure [dbo].[Pro_Certificates_Data_Page] @PageIndex int,@TempID varchar(500),@PageSize int
as
declare @sql varchar(max)
declare @where1 varchar(200)
declare @where varchar(max)
declare @order varchar(max)
declare @pageFrist int
declare @pageLast int

set @pageFrist=cast(@PageSize*(@PageIndex-1) as int)
set @pageLast=cast(@PageSize*@PageIndex as int)

if(@TempID is not null)
  set @where1=' where TempID ='''+@TempID+''''
else
 set @where1=''
set @sql = 'select * from (select ROW_Number() Over(order by certificateid desc) as RowID,* from V_Certificates_Data '+@where1+') cvd
where 1=1 '
set @where=' and RowID between '+cast(@pageFrist as varchar)+' and '+cast(@pageLast as varchar)+''
set @order= ' order by Status,certificateid desc'
exec(@sql + @where + @order)
GO
/****** Object:  Table [dbo].[T_Certificate_Template_Seal]    Script Date: 02/09/2014 22:42:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_Certificate_Template_Seal](
	[SealID] [varchar](40) NOT NULL,
	[SealName] [varchar](100) NULL,
	[SealPicUrl] [varchar](300) NULL,
	[Creater] [varchar](40) NULL,
	[CreateTime] [varchar](20) NULL,
	[Remark] [varchar](200) NULL,
 CONSTRAINT [PK34_1_1] PRIMARY KEY NONCLUSTERED 
(
	[SealID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[T_Sys_Person_info]    Script Date: 02/09/2014 22:42:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_Sys_Person_info](
	[PersonID] [varchar](40) NOT NULL,
	[Logging_State] [char](1) NULL,
	[PersonName] [varchar](30) NOT NULL,
	[sex] [char](1) NULL,
	[MobilePhone] [varchar](20) NULL,
	[City] [varchar](10) NULL,
	[Email] [varchar](50) NULL,
	[MSN] [varchar](50) NULL,
	[QQ] [varchar](12) NULL,
	[Address] [varchar](50) NULL,
	[IDNumber] [varchar](20) NULL,
	[photo] [varchar](100) NULL,
	[UserPass] [varchar](100) NOT NULL,
	[UserName] [varchar](80) NOT NULL,
	[UserRemark] [varchar](200) NULL,
	[UsedFlag] [char](1) NOT NULL,
	[CreateTime] [varchar](20) NULL,
	[Creater] [varchar](40) NULL,
	[SessionID] [varchar](40) NULL,
 CONSTRAINT [PK3] PRIMARY KEY NONCLUSTERED 
(
	[PersonID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'人员ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_info', @level2type=N'COLUMN',@level2name=N'PersonID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户登录状态 0:在线 1:忙 2:离开 3:离线' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_info', @level2type=N'COLUMN',@level2name=N'Logging_State'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'名字' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_info', @level2type=N'COLUMN',@level2name=N'PersonName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'性别 男：1 ，女：0' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_info', @level2type=N'COLUMN',@level2name=N'sex'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'手机' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_info', @level2type=N'COLUMN',@level2name=N'MobilePhone'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'住址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_info', @level2type=N'COLUMN',@level2name=N'Address'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'相片' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_info', @level2type=N'COLUMN',@level2name=N'photo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户密码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_info', @level2type=N'COLUMN',@level2name=N'UserPass'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户帐号(邮件)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_info', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_info', @level2type=N'COLUMN',@level2name=N'UserRemark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'启用标识 1:启用 0:禁用' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_info', @level2type=N'COLUMN',@level2name=N'UsedFlag'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_info', @level2type=N'COLUMN',@level2name=N'CreateTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_info', @level2type=N'COLUMN',@level2name=N'Creater'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'SessionID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_info', @level2type=N'COLUMN',@level2name=N'SessionID'
GO
/****** Object:  StoredProcedure [dbo].[UP_GetRecordByPage]    Script Date: 02/09/2014 22:42:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
Create PROCEDURE [dbo].[UP_GetRecordByPage]
 @TableName nvarchar(100),        --表名
 @Fields nvarchar(4000) = '*',    --字段名(全部字段为*)
 @OrderField nvarchar(4000),        --排序字段(必须!支持多字段)
 @SqlWhere nvarchar(4000) = Null,--条件语句(不用加where)
 @PageSize int,                    --每页多少条记录
 @PageIndex int = 1 ,            --指定当前为第几页
 @TotalRecord int output            --返回总记录数 
AS
BEGIN
	Begin Tran --开始事务

    Declare @Sql nvarchar(4000);
    Declare @TotalPage int;    

    --计算总记录数
         
    if (@SqlWhere='' or @SqlWhere=NULL)
        set @Sql = 'select @totalRecord = count(*) from ' + @TableName
    else
        set @Sql = 'select @totalRecord = count(*) from ' + @TableName + ' where ' + @sqlWhere

    EXEC sp_executesql @Sql,N'@totalRecord int OUTPUT',@TotalRecord OUTPUT--计算总记录数        
    
	--计算总页数
    select @TotalPage=CEILING((@TotalRecord+0.0)/@PageSize)

	set @SqlWhere=isnull(@SqlWhere,'')

   if (@SqlWhere='' or @SqlWhere=NULL)
        set @Sql = 'Select * FROM (select ROW_NUMBER() Over(order by ' + @OrderField + ') as sql_rowId,' + @Fields + ' from ' + @TableName 
    else
        set @Sql = 'Select * FROM (select ROW_NUMBER() Over(order by ' + @OrderField + ') as sql_rowId,' + @Fields + ' from ' + @TableName + ' where ' + @SqlWhere    
        
    
    --处理页数超出范围情况
    if @PageIndex<=0 
        Set @PageIndex = 1
    
    if @PageIndex>@TotalPage
        Set @PageIndex = @TotalPage

     --处理开始点和结束点
    Declare @StartRecord int
    Declare @EndRecord int
    
    set @StartRecord = (@PageIndex-1)*@PageSize + 1
    set @EndRecord = @StartRecord + @PageSize - 1

    --继续合成sql语句
    set @Sql = @Sql + ') as ' + @TableName + ' where sql_rowId between ' + Convert(varchar(50),@StartRecord) + ' and ' +  Convert(varchar(50),@EndRecord)
    
    Exec(@Sql)
    ---------------------------------------------------
    If @@Error <> 0
      Begin
        RollBack Tran
        Return -1
      End
     Else
      Begin
        Commit Tran
        --Return @totalRecord ---返回记录总数
		select @TotalRecord
      End    
END
GO
/****** Object:  Table [dbo].[T_Sys_Msg_Type]    Script Date: 02/09/2014 22:42:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_Sys_Msg_Type](
	[MsgTypeID] [varchar](40) NOT NULL,
	[MsgTypeName] [varchar](40) NOT NULL,
 CONSTRAINT [PK40] PRIMARY KEY NONCLUSTERED 
(
	[MsgTypeID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'消息类型ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Msg_Type', @level2type=N'COLUMN',@level2name=N'MsgTypeID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'消息类型名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Msg_Type', @level2type=N'COLUMN',@level2name=N'MsgTypeName'
GO
/****** Object:  Table [dbo].[T_Sys_Role]    Script Date: 02/09/2014 22:42:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_Sys_Role](
	[RoleID] [varchar](40) NOT NULL,
	[RoleName] [varchar](20) NOT NULL,
	[RoleDesc] [varchar](50) NULL,
	[CreateTime] [varchar](20) NULL,
	[Creater] [varchar](40) NULL,
 CONSTRAINT [XPKt_com_role] PRIMARY KEY NONCLUSTERED 
(
	[RoleID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'角色序号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Role', @level2type=N'COLUMN',@level2name=N'RoleID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'角色名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Role', @level2type=N'COLUMN',@level2name=N'RoleName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'角色描述' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Role', @level2type=N'COLUMN',@level2name=N'RoleDesc'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Role', @level2type=N'COLUMN',@level2name=N'CreateTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Role', @level2type=N'COLUMN',@level2name=N'Creater'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'角色表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Role'
GO
/****** Object:  Table [dbo].[T_Sys_Function]    Script Date: 02/09/2014 22:42:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_Sys_Function](
	[FunctionID] [varchar](40) NOT NULL,
	[FunctionName] [varchar](50) NOT NULL,
	[CreateTime] [varchar](20) NULL,
	[Creater] [varchar](40) NULL,
 CONSTRAINT [XPKT_com_Function] PRIMARY KEY NONCLUSTERED 
(
	[FunctionID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'功能编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Function', @level2type=N'COLUMN',@level2name=N'FunctionID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'功能名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Function', @level2type=N'COLUMN',@level2name=N'FunctionName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Function', @level2type=N'COLUMN',@level2name=N'CreateTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Function', @level2type=N'COLUMN',@level2name=N'Creater'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'功能描述表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Function'
GO
/****** Object:  Table [dbo].[T_Sys_Config_Group]    Script Date: 02/09/2014 22:42:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_Sys_Config_Group](
	[groudid] [int] IDENTITY(1,1) NOT NULL,
	[groupname] [varchar](50) NOT NULL,
	[parentgroupid] [varchar](40) NULL,
	[createtime] [varchar](20) NULL,
	[updatetime] [varchar](20) NULL,
	[remark] [varchar](100) NULL,
 CONSTRAINT [PK2] PRIMARY KEY NONCLUSTERED 
(
	[groudid] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'配置分组ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Config_Group', @level2type=N'COLUMN',@level2name=N'groudid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分组名字' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Config_Group', @level2type=N'COLUMN',@level2name=N'groupname'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'父分组ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Config_Group', @level2type=N'COLUMN',@level2name=N'parentgroupid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Config_Group', @level2type=N'COLUMN',@level2name=N'createtime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Config_Group', @level2type=N'COLUMN',@level2name=N'updatetime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Config_Group', @level2type=N'COLUMN',@level2name=N'remark'
GO
/****** Object:  Table [dbo].[T_Sys_Config]    Script Date: 02/09/2014 22:42:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_Sys_Config](
	[cfgid] [int] IDENTITY(1,1) NOT NULL,
	[varName] [varchar](20) NULL,
	[cfgvalue] [varchar](800) NULL,
	[cfgtype] [varchar](20) NULL,
	[remark] [varchar](500) NULL,
	[createtime] [varchar](20) NULL,
	[updatetime] [varchar](20) NULL,
	[groudid] [int] NOT NULL,
 CONSTRAINT [PK1] PRIMARY KEY NONCLUSTERED 
(
	[cfgid] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'配置ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Config', @level2type=N'COLUMN',@level2name=N'cfgid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'变量名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Config', @level2type=N'COLUMN',@level2name=N'varName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'值' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Config', @level2type=N'COLUMN',@level2name=N'cfgvalue'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'string,bool,number,bstring' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Config', @level2type=N'COLUMN',@level2name=N'cfgtype'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注说明' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Config', @level2type=N'COLUMN',@level2name=N'remark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Config', @level2type=N'COLUMN',@level2name=N'createtime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Config', @level2type=N'COLUMN',@level2name=N'updatetime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'配置分组ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Config', @level2type=N'COLUMN',@level2name=N'groudid'
GO
/****** Object:  Table [dbo].[T_Sys_Msg_Info]    Script Date: 02/09/2014 22:42:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_Sys_Msg_Info](
	[MsgID] [varchar](40) NOT NULL,
	[MsgContent] [varchar](2000) NOT NULL,
	[SendTime] [varchar](20) NOT NULL,
	[linkurl] [varchar](100) NULL,
	[MsgTitle] [varchar](200) NULL,
	[parentMsgID] [varchar](40) NULL,
	[MsgTypeID] [varchar](40) NOT NULL,
	[PersonID] [varchar](40) NOT NULL,
 CONSTRAINT [PK39] PRIMARY KEY NONCLUSTERED 
(
	[MsgID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'发送消息编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Msg_Info', @level2type=N'COLUMN',@level2name=N'MsgID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'消息内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Msg_Info', @level2type=N'COLUMN',@level2name=N'MsgContent'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'发送时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Msg_Info', @level2type=N'COLUMN',@level2name=N'SendTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'消息标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Msg_Info', @level2type=N'COLUMN',@level2name=N'MsgTitle'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'父级消息编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Msg_Info', @level2type=N'COLUMN',@level2name=N'parentMsgID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'消息类型ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Msg_Info', @level2type=N'COLUMN',@level2name=N'MsgTypeID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'人员ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Msg_Info', @level2type=N'COLUMN',@level2name=N'PersonID'
GO
/****** Object:  Table [dbo].[T_Sys_Pwd_Log]    Script Date: 02/09/2014 22:42:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_Sys_Pwd_Log](
	[LogId] [varchar](40) NOT NULL,
	[UpdatedPwd] [varchar](100) NOT NULL,
	[UpdateTime] [varchar](20) NOT NULL,
	[PersonID] [varchar](40) NOT NULL,
 CONSTRAINT [PK370] PRIMARY KEY NONCLUSTERED 
(
	[LogId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'口令修改日志ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Pwd_Log', @level2type=N'COLUMN',@level2name=N'LogId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改后口令值' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Pwd_Log', @level2type=N'COLUMN',@level2name=N'UpdatedPwd'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Pwd_Log', @level2type=N'COLUMN',@level2name=N'UpdateTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'人员ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Pwd_Log', @level2type=N'COLUMN',@level2name=N'PersonID'
GO
/****** Object:  Table [dbo].[T_Sys_Person_Role]    Script Date: 02/09/2014 22:42:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_Sys_Person_Role](
	[RoleID] [varchar](40) NOT NULL,
	[PersonID] [varchar](40) NOT NULL,
 CONSTRAINT [PK9] PRIMARY KEY NONCLUSTERED 
(
	[RoleID] ASC,
	[PersonID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'角色序号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_Role', @level2type=N'COLUMN',@level2name=N'RoleID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'人员ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_Role', @level2type=N'COLUMN',@level2name=N'PersonID'
GO
/****** Object:  Table [dbo].[T_Sys_Module]    Script Date: 02/09/2014 22:42:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_Sys_Module](
	[ModuleID] [varchar](40) NOT NULL,
	[ModuleLink] [varchar](100) NULL,
	[ModuleName] [varchar](50) NOT NULL,
	[ParentModuleID] [varchar](40) NULL,
	[ModuleDesc] [varchar](200) NULL,
	[ModuleOrder] [varchar](5) NULL,
	[MenuPosition] [int] NULL,
	[CreateTime] [varchar](20) NULL,
	[UsedFlag] [char](1) NULL,
	[Moduleico] [varchar](50) NULL,
	[remark] [varchar](100) NULL,
	[PersonID] [varchar](40) NULL,
 CONSTRAINT [XPKT_com_Module] PRIMARY KEY NONCLUSTERED 
(
	[ModuleID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模块编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Module', @level2type=N'COLUMN',@level2name=N'ModuleID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模块链接' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Module', @level2type=N'COLUMN',@level2name=N'ModuleLink'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模块名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Module', @level2type=N'COLUMN',@level2name=N'ModuleName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'父模块序号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Module', @level2type=N'COLUMN',@level2name=N'ParentModuleID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模块描述' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Module', @level2type=N'COLUMN',@level2name=N'ModuleDesc'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模块顺序' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Module', @level2type=N'COLUMN',@level2name=N'ModuleOrder'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'菜单位置 1:left 2:top 3:right 4:foot' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Module', @level2type=N'COLUMN',@level2name=N'MenuPosition'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Module', @level2type=N'COLUMN',@level2name=N'CreateTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'启用标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Module', @level2type=N'COLUMN',@level2name=N'UsedFlag'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模块图标' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Module', @level2type=N'COLUMN',@level2name=N'Moduleico'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Module', @level2type=N'COLUMN',@level2name=N'remark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'人员ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Module', @level2type=N'COLUMN',@level2name=N'PersonID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模块表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Module'
GO
/****** Object:  Table [dbo].[T_Sys_Logging_Log]    Script Date: 02/09/2014 22:42:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_Sys_Logging_Log](
	[LogId] [varchar](40) NOT NULL,
	[LoggingInTime] [varchar](20) NULL,
	[LoggingOutTime] [varchar](20) NULL,
	[LoggingIP] [varchar](40) NULL,
	[LoginUseAgent] [varchar](300) NULL,
	[LoggingUserName] [varchar](40) NULL,
	[PersonID] [varchar](40) NOT NULL,
 CONSTRAINT [PK366] PRIMARY KEY NONCLUSTERED 
(
	[LogId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'登录日志ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Logging_Log', @level2type=N'COLUMN',@level2name=N'LogId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'登录时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Logging_Log', @level2type=N'COLUMN',@level2name=N'LoggingInTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'退出时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Logging_Log', @level2type=N'COLUMN',@level2name=N'LoggingOutTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'登录IP' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Logging_Log', @level2type=N'COLUMN',@level2name=N'LoggingIP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'登录UseAgent' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Logging_Log', @level2type=N'COLUMN',@level2name=N'LoginUseAgent'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户姓名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Logging_Log', @level2type=N'COLUMN',@level2name=N'LoggingUserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'人员ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Logging_Log', @level2type=N'COLUMN',@level2name=N'PersonID'
GO
/****** Object:  Table [dbo].[T_Sys_Person_Friend]    Script Date: 02/09/2014 22:42:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_Sys_Person_Friend](
	[PersonID] [varchar](40) NOT NULL,
	[Friend_Person_ID] [varchar](40) NOT NULL,
	[CreateTime] [varchar](20) NULL,
	[UpdateTime] [varchar](20) NULL,
	[remark] [varchar](300) NULL,
 CONSTRAINT [PK30] PRIMARY KEY NONCLUSTERED 
(
	[PersonID] ASC,
	[Friend_Person_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]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'人员ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_Friend', @level2type=N'COLUMN',@level2name=N'PersonID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'好友人员ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_Friend', @level2type=N'COLUMN',@level2name=N'Friend_Person_ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_Friend', @level2type=N'COLUMN',@level2name=N'CreateTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_Friend', @level2type=N'COLUMN',@level2name=N'UpdateTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_Friend', @level2type=N'COLUMN',@level2name=N'remark'
GO
/****** Object:  Table [dbo].[T_Sys_Person_Disable_Log]    Script Date: 02/09/2014 22:42:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_Sys_Person_Disable_Log](
	[LogID] [varchar](40) NOT NULL,
	[PersonID] [varchar](40) NOT NULL,
	[Remark] [varchar](1000) NULL,
	[CreateTime] [varchar](20) NULL,
 CONSTRAINT [PK36] PRIMARY KEY NONCLUSTERED 
(
	[LogID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'日志ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_Disable_Log', @level2type=N'COLUMN',@level2name=N'LogID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'人员ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_Disable_Log', @level2type=N'COLUMN',@level2name=N'PersonID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'禁用说明' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_Disable_Log', @level2type=N'COLUMN',@level2name=N'Remark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Person_Disable_Log', @level2type=N'COLUMN',@level2name=N'CreateTime'
GO
/****** Object:  Table [dbo].[T_Certificate_Template_Property]    Script Date: 02/09/2014 22:42:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_Certificate_Template_Property](
	[PropertyID] [int] IDENTITY(1,1) NOT NULL,
	[Font] [varchar](100) NULL,
	[TempContent] [varchar](300) NULL,
	[FontSize] [varchar](10) NULL,
	[FontColor] [varchar](10) NULL,
	[LocationX] [varchar](10) NULL,
	[LocationY] [varchar](10) NULL,
	[TextOrImage] [char](1) NULL,
	[Creater] [varchar](40) NULL,
	[CreateTime] [varchar](20) NULL,
	[Remark] [varchar](200) NULL,
	[PhotoUrl] [varchar](300) NULL,
	[TempID] [varchar](40) NOT NULL,
	[SealID] [varchar](40) NULL,
	[PropertyWidth] [varchar](10) NULL,
	[PropertyHeight] [varchar](10) NULL,
	[PropertyTitle] [varchar](50) NULL,
 CONSTRAINT [PK34_1] PRIMARY KEY NONCLUSTERED 
(
	[PropertyID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[T_Certificates_Data]    Script Date: 02/09/2014 22:42:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_Certificates_Data](
	[certificateid] [varchar](50) NOT NULL,
	[worksname] [varchar](300) NOT NULL,
	[writer] [varchar](20) NOT NULL,
	[unitname] [varchar](300) NULL,
	[awards] [varchar](20) NULL,
	[sparefield1] [varchar](50) NULL,
	[sparefield2] [varchar](50) NULL,
	[sparefield3] [varchar](50) NULL,
	[sparefield4] [varchar](50) NULL,
	[sparefield5] [varchar](50) NULL,
	[CreateTime] [varchar](20) NULL,
	[UpdateTime] [varchar](20) NULL,
	[PersonID] [varchar](40) NULL,
	[TempID] [varchar](40) NOT NULL,
	[Province] [varchar](20) NULL,
	[City] [varchar](20) NULL,
	[zone] [varchar](20) NULL,
	[zssubject] [varchar](200) NULL,
	[grade] [varchar](20) NULL,
	[Curriculum] [varchar](20) NULL,
 CONSTRAINT [PK38] PRIMARY KEY NONCLUSTERED 
(
	[certificateid] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[T_Certificates_Issue_Status_Log]    Script Date: 02/09/2014 22:42:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_Certificates_Issue_Status_Log](
	[StatusLogID] [varchar](40) NOT NULL,
	[SortNo] [decimal](10, 0) NULL,
	[CreateTime] [varchar](20) NULL,
	[UpdateTime] [varchar](20) NULL,
	[remark] [varchar](300) NULL,
	[Status] [char](2) NULL,
	[PersonID] [varchar](40) NULL,
	[certificateid] [varchar](50) NOT NULL,
 CONSTRAINT [PK21] PRIMARY KEY NONCLUSTERED 
(
	[StatusLogID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[T_Certificates_Issue]    Script Date: 02/09/2014 22:42:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_Certificates_Issue](
	[certificateid] [varchar](50) NOT NULL,
	[PicNoBgUrl] [varchar](200) NULL,
	[PicBgUrl] [varchar](200) NULL,
	[Status] [char](2) NULL,
	[issuetime] [varchar](20) NULL,
	[UpdateTime] [varchar](20) NULL,
	[remark] [varchar](300) NULL,
	[PersonID] [varchar](40) NULL,
 CONSTRAINT [PK_T_Certificates_Issue] PRIMARY KEY CLUSTERED 
(
	[certificateid] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[T_Sys_Msg_REV]    Script Date: 02/09/2014 22:42:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_Sys_Msg_REV](
	[MsgRevID] [varchar](40) NOT NULL,
	[MsgState] [char](1) NOT NULL,
	[ReceiveTime] [varchar](20) NULL,
	[linkurl] [varchar](100) NULL,
	[UpdateTime] [varchar](20) NULL,
	[MsgContent] [varchar](2000) NOT NULL,
	[MsgTitle] [varchar](200) NULL,
	[MsgID] [varchar](40) NOT NULL,
	[PersonID] [varchar](40) NOT NULL,
 CONSTRAINT [PK37] PRIMARY KEY NONCLUSTERED 
(
	[MsgRevID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'接收信息ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Msg_REV', @level2type=N'COLUMN',@level2name=N'MsgRevID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'消息状态，1已读  0新信息 2 已经回复' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Msg_REV', @level2type=N'COLUMN',@level2name=N'MsgState'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'接收时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Msg_REV', @level2type=N'COLUMN',@level2name=N'ReceiveTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'链接' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Msg_REV', @level2type=N'COLUMN',@level2name=N'linkurl'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'查看时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Msg_REV', @level2type=N'COLUMN',@level2name=N'UpdateTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'消息内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Msg_REV', @level2type=N'COLUMN',@level2name=N'MsgContent'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'消息标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Msg_REV', @level2type=N'COLUMN',@level2name=N'MsgTitle'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'发送消息编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Msg_REV', @level2type=N'COLUMN',@level2name=N'MsgID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'人员ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Msg_REV', @level2type=N'COLUMN',@level2name=N'PersonID'
GO
/****** Object:  Table [dbo].[T_Sys_Module_Function]    Script Date: 02/09/2014 22:42:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_Sys_Module_Function](
	[ModuleID] [varchar](40) NOT NULL,
	[FunctionID] [varchar](40) NOT NULL,
 CONSTRAINT [PK11] PRIMARY KEY NONCLUSTERED 
(
	[ModuleID] ASC,
	[FunctionID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模块编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Module_Function', @level2type=N'COLUMN',@level2name=N'ModuleID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'功能编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Module_Function', @level2type=N'COLUMN',@level2name=N'FunctionID'
GO
/****** Object:  View [dbo].[V_Certificate_Template_Property]    Script Date: 02/09/2014 22:42:20 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[V_Certificate_Template_Property]
AS
SELECT     dbo.T_Certificate_Template_Property.PropertyID, dbo.T_Certificate_Template_Property.Font, dbo.T_Certificate_Template_Property.TempContent, 
                      dbo.T_Certificate_Template_Property.FontSize, dbo.T_Certificate_Template_Property.FontColor, dbo.T_Certificate_Template_Property.LocationX, 
                      dbo.T_Certificate_Template_Property.LocationY, dbo.T_Certificate_Template_Property.TextOrImage, dbo.T_Certificate_Template_Property.Creater, 
                      dbo.T_Certificate_Template_Property.CreateTime, dbo.T_Certificate_Template_Property.Remark, dbo.T_Certificate_Template_Property.PhotoUrl, 
                      dbo.T_Certificate_Template_Property.TempID, dbo.T_Certificate_Template_Property.SealID, dbo.T_Certificate_Template_Property.PropertyWidth, 
                      dbo.T_Certificate_Template_Property.PropertyHeight, dbo.T_Certificate_Template_Property.PropertyTitle, dbo.T_Certificate_Template_Seal.SealName, 
                      dbo.T_Certificate_Template_Seal.SealPicUrl
FROM         dbo.T_Certificate_Template_Property LEFT OUTER JOIN
                      dbo.T_Certificate_Template_Seal ON dbo.T_Certificate_Template_Property.SealID = dbo.T_Certificate_Template_Seal.SealID
GO
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[41] 4[21] 2[11] 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 = "T_Certificate_Template_Property"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 125
               Right = 200
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "T_Certificate_Template_Seal"
            Begin Extent = 
               Top = 10
               Left = 363
               Bottom = 219
               Right = 507
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 20
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      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_Certificate_Template_Property'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'V_Certificate_Template_Property'
GO
/****** Object:  View [dbo].[V_Sys_Person_info]    Script Date: 02/09/2014 22:42:20 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[V_Sys_Person_info]
AS
SELECT     (SELECT     RoleID
                       FROM          dbo.T_Sys_Person_Role AS spr
                       WHERE      (PersonID = spi.PersonID) AND (RoleID = 'sysadmin')) AS RoleAdmin, PersonID, Logging_State, PersonName, sex, MobilePhone, City, Email, MSN, QQ, 
                      Address, IDNumber, photo, UserPass, UserName, UserRemark, UsedFlag, CreateTime, Creater, SessionID
FROM         dbo.T_Sys_Person_info AS spi
GO
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[41] 4[21] 2[15] 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 = "spi"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 125
               Right = 196
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      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_Sys_Person_info'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'V_Sys_Person_info'
GO
/****** Object:  View [dbo].[V_Certificates_Data]    Script Date: 02/09/2014 22:42:20 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[V_Certificates_Data]
AS
SELECT     (SELECT     PersonName
                       FROM          dbo.T_Sys_Person_info AS spi
                       WHERE      (PersonID = cd.PersonID)) AS PersonName, cti.TempName, cti.TempNoBgPicUrl, cti.TempBgUrl,
                          (SELECT     PicNoBgUrl
                            FROM          dbo.T_Certificates_Issue AS ci
                            WHERE      (certificateid = cd.certificateid)) AS PicNoBgUrl,
                          (SELECT     PicBgUrl
                            FROM          dbo.T_Certificates_Issue AS ci
                            WHERE      (certificateid = cd.certificateid)) AS PicBgUrl,
                          (SELECT     Status
                            FROM          dbo.T_Certificates_Issue AS ci
                            WHERE      (certificateid = cd.certificateid)) AS Status,
                          (SELECT     issuetime
                            FROM          dbo.T_Certificates_Issue AS ci
                            WHERE      (certificateid = cd.certificateid)) AS issuetime,
                          (SELECT     PersonName
                            FROM          dbo.T_Sys_Person_info AS spi
                            WHERE      (PersonID =
                                                       (SELECT     PersonID
                                                         FROM          dbo.T_Certificates_Issue AS ci
                                                         WHERE      (certificateid = cd.certificateid)))) AS issuePersonName, cd.certificateid, cd.worksname, cd.writer, cd.unitname, cd.awards, cd.sparefield1, 
                      cd.sparefield2, cd.sparefield3, cd.sparefield4, cd.sparefield5, cd.CreateTime, cd.UpdateTime, cd.PersonID, cd.TempID, cti.iscreatefile, cd.Province, cd.City, cd.zone, 
                      cd.grade, cd.zssubject, cd.Curriculum
FROM         dbo.T_Certificates_Data AS cd LEFT OUTER JOIN
                      dbo.T_Certificate_Template_Info AS cti ON cd.TempID = cti.TempID
GO
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[26] 4[4] 2[32] 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 = "cd"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 198
               Right = 184
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "cti"
            Begin Extent = 
               Top = 6
               Left = 222
               Bottom = 125
               Right = 388
            End
            DisplayFlags = 280
            TopColumn = 10
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 24
         Width = 284
         Width = 1500
         Width = 1710
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      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_Certificates_Data'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'V_Certificates_Data'
GO
/****** Object:  Table [dbo].[T_Sys_Role_Module_Function]    Script Date: 02/09/2014 22:42:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_Sys_Role_Module_Function](
	[RoleID] [varchar](40) NOT NULL,
	[ModuleID] [varchar](40) NOT NULL,
	[FunctionID] [varchar](40) NOT NULL,
 CONSTRAINT [PK12] PRIMARY KEY NONCLUSTERED 
(
	[RoleID] ASC,
	[ModuleID] ASC,
	[FunctionID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'角色序号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Role_Module_Function', @level2type=N'COLUMN',@level2name=N'RoleID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模块编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Role_Module_Function', @level2type=N'COLUMN',@level2name=N'ModuleID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'功能编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Sys_Role_Module_Function', @level2type=N'COLUMN',@level2name=N'FunctionID'
GO
/****** Object:  View [dbo].[V_Certificates_Statistics]    Script Date: 02/09/2014 22:42:20 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[V_Certificates_Statistics]
AS
SELECT     ISNULL(Province, '未设置省') AS Province, ISNULL(City, '未设置市') AS City, ISNULL(zone, '未设置区县') AS zone, COUNT(1) AS allcount,
                          (SELECT     COUNT(1) AS Expr1
                            FROM          dbo.V_Certificates_Data AS ci
                            WHERE      (Province = cd.Province) AND (City = cd.City) AND (zone = cd.zone) AND (Status = 1)) AS banfacount, COUNT(1) -
                          (SELECT     COUNT(1) AS Expr1
                            FROM          dbo.V_Certificates_Data AS ci
                            WHERE      (Province = cd.Province) AND (City = cd.City) AND (zone = cd.zone) AND (Status = 1)) AS nobanfacount
FROM         dbo.T_Certificates_Data AS cd
GROUP BY Province, City, zone
GO
/****** Object:  Default [DF__T_Sys_Msg__MsgSt__0CBAE877]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Sys_Msg_REV] ADD  DEFAULT ('0') FOR [MsgState]
GO
/****** Object:  ForeignKey [RefT_Certificate_Template_Info41]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Certificate_Template_Property]  WITH CHECK ADD  CONSTRAINT [RefT_Certificate_Template_Info41] FOREIGN KEY([TempID])
REFERENCES [dbo].[T_Certificate_Template_Info] ([TempID])
GO
ALTER TABLE [dbo].[T_Certificate_Template_Property] CHECK CONSTRAINT [RefT_Certificate_Template_Info41]
GO
/****** Object:  ForeignKey [RefT_Certificate_Template_Seal52]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Certificate_Template_Property]  WITH CHECK ADD  CONSTRAINT [RefT_Certificate_Template_Seal52] FOREIGN KEY([SealID])
REFERENCES [dbo].[T_Certificate_Template_Seal] ([SealID])
GO
ALTER TABLE [dbo].[T_Certificate_Template_Property] CHECK CONSTRAINT [RefT_Certificate_Template_Seal52]
GO
/****** Object:  ForeignKey [RefT_Certificate_Template_Info59]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Certificates_Data]  WITH CHECK ADD  CONSTRAINT [RefT_Certificate_Template_Info59] FOREIGN KEY([TempID])
REFERENCES [dbo].[T_Certificate_Template_Info] ([TempID])
GO
ALTER TABLE [dbo].[T_Certificates_Data] CHECK CONSTRAINT [RefT_Certificate_Template_Info59]
GO
/****** Object:  ForeignKey [RefT_Sys_Person_info45]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Certificates_Data]  WITH CHECK ADD  CONSTRAINT [RefT_Sys_Person_info45] FOREIGN KEY([PersonID])
REFERENCES [dbo].[T_Sys_Person_info] ([PersonID])
GO
ALTER TABLE [dbo].[T_Certificates_Data] CHECK CONSTRAINT [RefT_Sys_Person_info45]
GO
/****** Object:  ForeignKey [RefT_Certificates_Data58]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Certificates_Issue]  WITH CHECK ADD  CONSTRAINT [RefT_Certificates_Data58] FOREIGN KEY([certificateid])
REFERENCES [dbo].[T_Certificates_Data] ([certificateid])
GO
ALTER TABLE [dbo].[T_Certificates_Issue] CHECK CONSTRAINT [RefT_Certificates_Data58]
GO
/****** Object:  ForeignKey [RefT_Sys_Person_info43]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Certificates_Issue]  WITH CHECK ADD  CONSTRAINT [RefT_Sys_Person_info43] FOREIGN KEY([PersonID])
REFERENCES [dbo].[T_Sys_Person_info] ([PersonID])
GO
ALTER TABLE [dbo].[T_Certificates_Issue] CHECK CONSTRAINT [RefT_Sys_Person_info43]
GO
/****** Object:  ForeignKey [RefT_Sys_Person_info44]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Certificates_Issue_Status_Log]  WITH CHECK ADD  CONSTRAINT [RefT_Sys_Person_info44] FOREIGN KEY([PersonID])
REFERENCES [dbo].[T_Sys_Person_info] ([PersonID])
GO
ALTER TABLE [dbo].[T_Certificates_Issue_Status_Log] CHECK CONSTRAINT [RefT_Sys_Person_info44]
GO
/****** Object:  ForeignKey [RefT_Sys_Config_Group53]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Sys_Config]  WITH CHECK ADD  CONSTRAINT [RefT_Sys_Config_Group53] FOREIGN KEY([groudid])
REFERENCES [dbo].[T_Sys_Config_Group] ([groudid])
GO
ALTER TABLE [dbo].[T_Sys_Config] CHECK CONSTRAINT [RefT_Sys_Config_Group53]
GO
/****** Object:  ForeignKey [RefT_Sys_Person_info10]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Sys_Logging_Log]  WITH CHECK ADD  CONSTRAINT [RefT_Sys_Person_info10] FOREIGN KEY([PersonID])
REFERENCES [dbo].[T_Sys_Person_info] ([PersonID])
GO
ALTER TABLE [dbo].[T_Sys_Logging_Log] CHECK CONSTRAINT [RefT_Sys_Person_info10]
GO
/****** Object:  ForeignKey [RefT_Sys_Person_info3]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Sys_Module]  WITH CHECK ADD  CONSTRAINT [RefT_Sys_Person_info3] FOREIGN KEY([PersonID])
REFERENCES [dbo].[T_Sys_Person_info] ([PersonID])
GO
ALTER TABLE [dbo].[T_Sys_Module] CHECK CONSTRAINT [RefT_Sys_Person_info3]
GO
/****** Object:  ForeignKey [RefT_Sys_Function16]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Sys_Module_Function]  WITH CHECK ADD  CONSTRAINT [RefT_Sys_Function16] FOREIGN KEY([FunctionID])
REFERENCES [dbo].[T_Sys_Function] ([FunctionID])
GO
ALTER TABLE [dbo].[T_Sys_Module_Function] CHECK CONSTRAINT [RefT_Sys_Function16]
GO
/****** Object:  ForeignKey [RefT_Sys_Module15]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Sys_Module_Function]  WITH CHECK ADD  CONSTRAINT [RefT_Sys_Module15] FOREIGN KEY([ModuleID])
REFERENCES [dbo].[T_Sys_Module] ([ModuleID])
GO
ALTER TABLE [dbo].[T_Sys_Module_Function] CHECK CONSTRAINT [RefT_Sys_Module15]
GO
/****** Object:  ForeignKey [RefT_Sys_Msg_Type8]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Sys_Msg_Info]  WITH CHECK ADD  CONSTRAINT [RefT_Sys_Msg_Type8] FOREIGN KEY([MsgTypeID])
REFERENCES [dbo].[T_Sys_Msg_Type] ([MsgTypeID])
GO
ALTER TABLE [dbo].[T_Sys_Msg_Info] CHECK CONSTRAINT [RefT_Sys_Msg_Type8]
GO
/****** Object:  ForeignKey [RefT_Sys_Person_info11]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Sys_Msg_Info]  WITH CHECK ADD  CONSTRAINT [RefT_Sys_Person_info11] FOREIGN KEY([PersonID])
REFERENCES [dbo].[T_Sys_Person_info] ([PersonID])
GO
ALTER TABLE [dbo].[T_Sys_Msg_Info] CHECK CONSTRAINT [RefT_Sys_Person_info11]
GO
/****** Object:  ForeignKey [RefT_Sys_Msg_Info6]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Sys_Msg_REV]  WITH CHECK ADD  CONSTRAINT [RefT_Sys_Msg_Info6] FOREIGN KEY([MsgID])
REFERENCES [dbo].[T_Sys_Msg_Info] ([MsgID])
GO
ALTER TABLE [dbo].[T_Sys_Msg_REV] CHECK CONSTRAINT [RefT_Sys_Msg_Info6]
GO
/****** Object:  ForeignKey [RefT_Sys_Person_info12]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Sys_Msg_REV]  WITH CHECK ADD  CONSTRAINT [RefT_Sys_Person_info12] FOREIGN KEY([PersonID])
REFERENCES [dbo].[T_Sys_Person_info] ([PersonID])
GO
ALTER TABLE [dbo].[T_Sys_Msg_REV] CHECK CONSTRAINT [RefT_Sys_Person_info12]
GO
/****** Object:  ForeignKey [RefT_Sys_Person_info5]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Sys_Person_Disable_Log]  WITH CHECK ADD  CONSTRAINT [RefT_Sys_Person_info5] FOREIGN KEY([PersonID])
REFERENCES [dbo].[T_Sys_Person_info] ([PersonID])
GO
ALTER TABLE [dbo].[T_Sys_Person_Disable_Log] CHECK CONSTRAINT [RefT_Sys_Person_info5]
GO
/****** Object:  ForeignKey [RefT_Sys_Person_info38]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Sys_Person_Friend]  WITH CHECK ADD  CONSTRAINT [RefT_Sys_Person_info38] FOREIGN KEY([PersonID])
REFERENCES [dbo].[T_Sys_Person_info] ([PersonID])
GO
ALTER TABLE [dbo].[T_Sys_Person_Friend] CHECK CONSTRAINT [RefT_Sys_Person_info38]
GO
/****** Object:  ForeignKey [RefT_Sys_Person_info14]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Sys_Person_Role]  WITH CHECK ADD  CONSTRAINT [RefT_Sys_Person_info14] FOREIGN KEY([PersonID])
REFERENCES [dbo].[T_Sys_Person_info] ([PersonID])
GO
ALTER TABLE [dbo].[T_Sys_Person_Role] CHECK CONSTRAINT [RefT_Sys_Person_info14]
GO
/****** Object:  ForeignKey [RefT_Sys_Role13]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Sys_Person_Role]  WITH CHECK ADD  CONSTRAINT [RefT_Sys_Role13] FOREIGN KEY([RoleID])
REFERENCES [dbo].[T_Sys_Role] ([RoleID])
GO
ALTER TABLE [dbo].[T_Sys_Person_Role] CHECK CONSTRAINT [RefT_Sys_Role13]
GO
/****** Object:  ForeignKey [RefT_Sys_Person_info9]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Sys_Pwd_Log]  WITH CHECK ADD  CONSTRAINT [RefT_Sys_Person_info9] FOREIGN KEY([PersonID])
REFERENCES [dbo].[T_Sys_Person_info] ([PersonID])
GO
ALTER TABLE [dbo].[T_Sys_Pwd_Log] CHECK CONSTRAINT [RefT_Sys_Person_info9]
GO
/****** Object:  ForeignKey [RefT_Sys_Module_Function2]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Sys_Role_Module_Function]  WITH CHECK ADD  CONSTRAINT [RefT_Sys_Module_Function2] FOREIGN KEY([ModuleID], [FunctionID])
REFERENCES [dbo].[T_Sys_Module_Function] ([ModuleID], [FunctionID])
GO
ALTER TABLE [dbo].[T_Sys_Role_Module_Function] CHECK CONSTRAINT [RefT_Sys_Module_Function2]
GO
/****** Object:  ForeignKey [RefT_Sys_Role1]    Script Date: 02/09/2014 22:42:19 ******/
ALTER TABLE [dbo].[T_Sys_Role_Module_Function]  WITH CHECK ADD  CONSTRAINT [RefT_Sys_Role1] FOREIGN KEY([RoleID])
REFERENCES [dbo].[T_Sys_Role] ([RoleID])
GO
ALTER TABLE [dbo].[T_Sys_Role_Module_Function] CHECK CONSTRAINT [RefT_Sys_Role1]
GO
