Last active
August 29, 2015 14:04
-
-
Save binjoo/b14cf7b96428aceabd30 to your computer and use it in GitHub Desktop.
Revisions
-
binjoo revised this gist
Aug 19, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ begin insert into sys_calendar(id, date_name, Week_Name, Week_Type, cal_name, cal_type, Am_Begin, am_end, pm_begin, pm_end) values(create_table_id('sys_calendar'), date1, '星期' || decode(week, 1, '一', 2, '二', 3, '三', 4, '四', 5, '五', 6, '六', 7, '天'), week, case when week in (6, 7) then '节假日' else '工作日' end, case when week in (6, 7) then 1 else 0 end, -
binjoo revised this gist
Jul 22, 2014 . No changes.There are no files selected for viewing
-
binjoo created this gist
Jul 22, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ declare i int; now date; date1 date; week int; begin now := trunc(sysdate); for i in 0..2000 loop date1 := now + i; week := to_number(to_char(date1 - 1, 'd')); insert into sys_calendar(id, date_name, Week_Name, Week_Type, cal_name, cal_type, Am_Begin, am_end, pm_begin, pm_end) values(create_table_id('sys_calendar'), date1, '星期' || decode(week, 1, '一', 2, '二', 3, '三', 4, '四', 5, '五', 6, '六', 7, '七'), week, case when week in (6, 7) then '节假日' else '工作日' end, case when week in (6, 7) then 1 else 0 end, to_date(to_char(date1, 'yyyy-mm-dd') || ' 08:00:00', 'yyyy-mm-dd hh24:mi:ss'), to_date(to_char(date1, 'yyyy-mm-dd') || ' 12:00:00', 'yyyy-mm-dd hh24:mi:ss'), to_date(to_char(date1, 'yyyy-mm-dd') || ' 14:00:00', 'yyyy-mm-dd hh24:mi:ss'), to_date(to_char(date1, 'yyyy-mm-dd') || ' 18:00:00', 'yyyy-mm-dd hh24:mi:ss')); end loop; end;