DROP TABLE ADM_AttendanceRules
go

CREATE TABLE ADM_AttendanceRules
(
   [Id]                    NVARCHAR (50) NOT NULL,
   week_start              INT NOT NULL DEFAULT 0,
   week_end                INT NOT NULL DEFAULT 0,
   working_start            NVARCHAR (50) NOT NULL,
   working_end              NVARCHAR (50) NOT NULL,
   offwork_start            NVARCHAR (50) NOT NULL,
   offwork_end              NVARCHAR (50) NOT NULL,
   full_attendance         DECIMAL (18, 2) NOT NULL DEFAULT 0,
   late_payment1           DECIMAL (18, 2) NOT NULL DEFAULT 0,
   late_payment2           DECIMAL (18, 2) NOT NULL DEFAULT 0,
   late_payment3           DECIMAL (18, 2) NOT NULL DEFAULT 0,
   late_payment4           DECIMAL (18, 2) NOT NULL DEFAULT 0,
   absenteeism             DECIMAL (18, 2) NOT NULL DEFAULT 0,
   absenteeism_payment1    DECIMAL (18, 2) NOT NULL DEFAULT 0,
   absenteeism_payment2    DECIMAL (18, 2) NOT NULL DEFAULT 0,
   personal_payment1       DECIMAL (18, 2) NOT NULL DEFAULT 0,
   personal_payment2       DECIMAL (18, 2) NOT NULL DEFAULT 0,
   personal_payment3       DECIMAL (18, 2) NOT NULL DEFAULT 0,
   personal_payment4       DECIMAL (18, 2) NOT NULL DEFAULT 0,
   sick_payment1           DECIMAL (18, 2) NOT NULL DEFAULT 0,
   sick_payment2           DECIMAL (18, 2) NOT NULL DEFAULT 0,
   sick_payment3           DECIMAL (18, 2) NOT NULL DEFAULT 0,
   sick_payment4           DECIMAL (18, 2) NOT NULL DEFAULT 0,
   holiday                 NVARCHAR (50) NOT NULL,
   Rest                    NVARCHAR (50) NOT NULL,
   gala                    INT NOT NULL DEFAULT 0,
   weekend                 INT NOT NULL DEFAULT 0,
   usually                 INT NOT NULL DEFAULT 0,
   [rec_status]            NVARCHAR (1) NOT NULL DEFAULT ('A'),
   [creater]               NVARCHAR (50) NOT NULL DEFAULT ('1'),
   [createtime]            DATETIME NOT NULL DEFAULT (getdate ()),
   [modifier]              NVARCHAR (50) NOT NULL DEFAULT ('1'),
   [modifytime]            DATETIME NOT NULL DEFAULT (getdate ())
)
go
DROP TABLE [dbo].[ADM_AttendanceRules_dtl];

CREATE TABLE [dbo].[ADM_AttendanceRules_dtl]
(
   [Id]             NVARCHAR (50) NOT NULL,
   [pid]            NVARCHAR (50) NOT NULL,
   [value_start]    DATE NOT NULL DEFAULT (getdate ()),
   [value_end]      DATE NOT NULL DEFAULT (getdate ()),
   [Name]           NVARCHAR (200) NULL,
   [rec_status]     NVARCHAR (1) NOT NULL DEFAULT ('A'),
   [creater]        NVARCHAR (50) NOT NULL DEFAULT ('1'),
   [createtime]     DATETIME NOT NULL DEFAULT (getdate ()),
   [modifier]       NVARCHAR (50) NOT NULL DEFAULT ('1'),
   [modifytime]     DATETIME NOT NULL DEFAULT (getdate ())
)
go

INSERT INTO [dbo].[plt_page] ([Id],
                              [system_id],
                              [page_name],
                              [page_shortcut],
                              [display_seq],
                              [page_path],
                              [page_method],
                              [page_type],
                              [page_superior],
                              [page_ico],
                              [open_type],
                              [rec_status],
                              [creater],
                              [createtime],
                              [modifier],
                              [modifytime])
VALUES ('6ac55344-245f-4058-b446-77685cd4f3cb',
        '0',
        '考勤规则',
        '',
        3,
        '/Signin/AttendanceRule/',
        '01',
        'M',
        '954224ea-3d74-435d-a091-df9bc95769cc',
        '',
        0,
        'A',
        'e4c93811-b9b1-4998-89f5-c416ebab0c07',
        '2021-03-24 14:57:47',
        'e4c93811-b9b1-4998-89f5-c416ebab0c07',
        '2021-03-24 14:57:47')
GO

ALTER TABLE ADM_MemoBook
   ADD[HaveRead] INT NULL DEFAULT ((0))
go