--档案打印方案
create table UR_SYS_ARCHIVE_PRT_PLAN  (
   ARCH_PLAN_ID         VARCHAR2(36)                     not null,
   ARCH_PLAN_NAME       VARCHAR2(255),
   SEQ_NO               INTEGER                        default 0,
   USER_ID              VARCHAR2(36),
   IS_SYS_SHARE         VARCHAR2(1)                    default '0',
   IS_SYS               VARCHAR2(1)                    default '0',
   constraint PK_UR_SYS_ARCHIVE_PRT_PLAN primary key (ARCH_PLAN_ID)
);
create index IDX_UR_SYS_ARCHIVE_PRT_PLAN_U on UR_SYS_ARCHIVE_PRT_PLAN (
   USER_ID ASC
);


create table UR_SYS_ARCHIVE_PRT_PLAN_T  (
   ARCH_PLAN_ID         VARCHAR2(36)                     not null,
   TMPL_CODE            VARCHAR2(30)                     not null,
   IS_HEAD              VARCHAR2(1)                    default '0',
   HEAD_S               INTEGER                        default 0,
   HEAD_E               INTEGER                        default 0,
   IS_PHEAD             VARCHAR2(1)                    default '0',
   PHEAD_S              INTEGER                        default 0,
   PHEAD_E              INTEGER                        default 0,
   IS_PTAIL             VARCHAR2(1)                    default '0',
   PTAIL_S              INTEGER                        default 0,
   PTAIL_E              INTEGER                        default 0,
   IS_TAIL              VARCHAR2(1)                    default '0',
   TAIL_S               INTEGER                        default 0,
   TAIL_E               INTEGER                        default 0,
   constraint PK_UR_SYS_ARCHIVE_PRT_PLAN_T primary key (ARCH_PLAN_ID, TMPL_CODE)
);

create table UR_SYS_ARCHIVE_PRT_PLAN_TF  (
   ARCH_PLAN_ID         VARCHAR2(36)                     not null,
   TMPL_CODE            VARCHAR2(30)                     not null,
   ROW_NO               INTEGER                        default 0  not null,
   IS_FIX_PAGE          VARCHAR2(1)                    default '0',
   FIX_PAGE_ROW_COUNT   INTEGER                        default 0,
   IS_AUTO_HEIGTH       VARCHAR2(1)                    default '0',
   MIN_HEIGTH           INTEGER,
   constraint PK_UR_SYS_ARCHIVE_PRT_PLAN_TF primary key (ARCH_PLAN_ID, TMPL_CODE, ROW_NO)
);

--系统级默认方案
Insert into ur_sys_archive_prt_plan (arch_plan_id, arch_plan_name, seq_no, user_id, is_sys_share, is_sys)
 Values ('SYS_ARCH_PRINT_ID', '系统级打印方案', 0, '*', '1', '1');


--菜单
Insert into ur_sys_menu
   (mod_id, l_code, is_end, mod_code, mod_name, mod_type, form_name, pack_name, param, mod_tag, user_id)
 Values
   ('SYS_ARCH_PRINT', '00600012', '1', 'SYS_ARCH_PRINT', '档案打印设置', 
    'MOD', 'TFrmPrint', 'RptArch.exe', NULL, 7, '*');

Insert into ur_sys_res
   (lang_type, mod_id, res_id, res_type, seq_no, org_name, disp_name, mark)
 Values
   ('chi', 'SYS_ARCH_PRINT', 'MOD', 'R', 10, 
    '档案打印设置', '档案打印设置', '档案打印设置');
Insert into ur_sys_res
   (lang_type, mod_id, res_id, res_type, seq_no, org_name, disp_name, mark)
 Values
   ('chi', 'SYS_ARCH_PRINT', 'FUNC_SET', 'F', 20, 
    '设置打印方案', '设置打印方案', '设置打印方案');
