CREATE TABLE [CompanyDiary] (
[CD_CD] [int] IDENTITY (1, 1) Primary Key ,
[CD_Year] [smallint] NULL DEFAULT(datepart(year,getdate())),
[CD_Month] [tinyint] NULL DEFAULT(datepart(month,getdate())),
[CD_Day] [tinyint] NULL DEFAULT(datepart(day,getdate())),
[CD_Desc] [nvarchar] (30) NULL ,
[CD_IsActive] [tinyint] NULL DEFAULT (1),
[RegDate] [datetime] NULL DEFAULT (getdate())
)
GO
CREATE TABLE [CompanyTimer] (
[CT_CD] [int] Primary Key identity(1,1) ,
[CT_Desc] [nvarchar](100) NULL ,
[CT_ComeInTime] [tinyint] NULL DEFAULT (datepart(hour,getdate())),
[CT_ComeInMinute] [tinyint] NULL DEFAULT (datepart(minute,getdate())),
[CT_ComeOutTime] [tinyint] NULL DEFAULT (datepart(hour,getdate())),
[CT_ComeOutMinute] [tinyint] NULL DEFAULT (datepart(minute,getdate())),
[CT_ComeLateTime] [tinyint] NULL DEFAULT (datepart(hour,getdate())),
[CT_ComeLateMinute] [tinyint] NULL DEFAULT (datepart(minute,getdate())),
[CT_ComeAbsenceTime] [tinyint] NULL DEFAULT (datepart(hour,getdate())),
[CT_ComeAbsenceMinute] [tinyint] NULL DEFAULT (datepart(minute,getdate())),
[CT_ComeCheckOutTime] [tinyint] NULL DEFAULT (0),
[CT_ComeCheckOutMinute] [tinyint] NULL DEFAULT (0),
[CT_GroupCD] [int] NULL DEFAULT (0),
[CT_IsActive] [tinyint] NULL DEFAULT (1)
)
GO
CREATE TABLE [CompanyTimeState] (
[TS_CD] [int] IDENTITY(1, 1) Primary Key,
[TS_Name] [nvarchar] (10) NOT NULL ,
[TS_Desc] [nvarchar] (100) DEFAULT (''),
[TS_IsActive] [tinyint] NULL DEFAULT (1),
)
GO
CREATE TABLE [WH_Schedule_Log] (
[WSL_CD] [int] Primary Key IDENTITY (1, 1) NOT NULL ,
[WSL_ScheduleName] nvarchar(100) NOT NULL ,
[WSL_CT_CD] [int] NULL DEFAULT (0),
[WSL_RunTime] [int] NULL DEFAULT (0),
[WSL_RunMinite] [int] NULL DEFAULT (0),
[WSL_IsBool] [bit] NULL DEFAULT (0),
[RegDate] [datetime] NULL DEFAULT (getdate())
)
GO
CREATE TABLE [WH_WhoDateTime] (
[WDT_CD] [int] IDENTITY (1, 1) NOT NULL ,
[WDT_StartDate] [char] (10) DEFAULT (convert(varchar(10),getdate(),21)),
[WDT_LastDate] [char] (10) DEFAULT (convert(varchar(10),getdate(),21)),
[WDT_UserID] [nvarchar] (12) NOT NULL ,
[WDT_GroupCD] [int] NULL ,
[WDT_CT_CD] [int] NULL ,
[WDT_LogDate] [datetime] NULL DEFAULT (getdate())
)
GO
CREATE TABLE [WH_WorkStyle] (
[WS_CD] [int] IDENTITY (1, 1) NOT NULL ,
[WS_Name] [nvarchar] (20) NOT NULL ,
[WS_Desc] [nvarchar] (100) DEFAULT (''),
CONSTRAINT [PK_WH_WorkStyle] PRIMARY KEY CLUSTERED
(
[WS_CD]
) ON [PRIMARY]
) ON [PRIMARY]
GO
CREATE TABLE [WH_WorkCode] (
[WC_CD] [int] IDENTITY (1, 1) NOT NULL ,
[WC_Name] [nvarchar] (20) NOT NULL ,
[WC_Desc] [nvarchar] (100) DEFAULT (''),
[WC_IsActive] [tinyint] NULL DEFAULT (1),
[WS_CD] [int] NULL DEFAULT (0),
[WC_CalculatePoint] [float] NULL DEFAULT (0.0),
[WC_IsReportView] [tinyint] NULL DEFAULT (0),
[IsDualInsert] [tinyint] NULL DEFAULT (0),
CONSTRAINT [PK_WH_WorkCode] PRIMARY KEY CLUSTERED
(
[WC_CD]
) ON [PRIMARY] ,
CONSTRAINT [FK_WH_WorkCode_WH_WorkStyle] FOREIGN KEY
(
[WS_CD]
) REFERENCES [WH_WorkStyle] (
[WS_CD]
)
) ON [PRIMARY]
GO
CREATE TABLE [WH_WorkHistory] (
[WWH_CD] [int] IDENTITY (1, 1) NOT NULL ,
[WWH_UserID] [nvarchar] (12) NOT NULL ,
[WWH_ed_CD] [int] NULL DEFAULT (0),
[WWH_et_CD] [int] NULL DEFAULT (0),
[WWH_CheckYear] [smallint] NULL DEFAULT (datepart(year,getdate())),
[WWH_CheckMonth] [tinyint] NULL DEFAULT (datepart(month,getdate())),
[WWH_CheckDay] [tinyint] NULL DEFAULT (datepart(day,getdate())),
[WWH_WC_CD] [int] NULL DEFAULT (0),
[WWH_Remark] [nvarchar] (200) NULL DEFAULT (''),
[WWH_TS_CD] [int] NULL DEFAULT (1),
[WWH_RealWorkTime] [smalldatetime] NULL DEFAULT (getdate()),
[WWH_LogTime] [datetime] NULL DEFAULT (getdate()),
[WWH_ed_CD2] [int] NULL DEFAULT (0),
[WWH_et_CD2] [int] NULL DEFAULT (0),
CONSTRAINT [PK_WH_WorkHistory] PRIMARY KEY CLUSTERED
(
[WWH_CD]
) ON [PRIMARY]
) ON [PRIMARY]
GO