
-- 2022-03-08 补充初始化sql文件中栏目表的遗漏字段
ALTER TABLE PORTAL_SYS_COLUMN ADD SHOW_TITLE_ SMALLINT;
ALTER TABLE PORTAL_SYS_COLUMN ADD CONTAIN_COL_ VARCHAR2(2000);
ALTER TABLE PORTAL_SYS_COLUMN ADD APPID_ VARCHAR2(255);
ALTER TABLE PORTAL_SYS_COLUMN ADD SECRET_ VARCHAR2(255);
COMMENT ON COLUMN PORTAL_SYS_COLUMN.SHOW_TITLE_ IS '是否 显示栏目名称';
COMMENT ON COLUMN PORTAL_SYS_COLUMN.CONTAIN_COL_ IS '组合栏目包含子栏目别名（逗号分隔）';
COMMENT ON COLUMN PORTAL_SYS_COLUMN.APPID_ IS '公众号appid';
COMMENT ON COLUMN PORTAL_SYS_COLUMN.SECRET_ IS '公众号secret';

-- 2022-03-08 补充初始化sql文件中遗漏的表
CREATE TABLE PORTAL_NEWS_TAG(
ID_ VARCHAR2(64) NOT NULL,
NAME_ VARCHAR2(64) DEFAULT NULL,
ALIAS_ VARCHAR2(64) DEFAULT NULL,
STYLE_ VARCHAR2(255) DEFAULT NULL,
TENANT_ID_ VARCHAR2(255) DEFAULT NULL,
CREATE_TIME_ DATE,
CREATE_BY_ VARCHAR2(255) DEFAULT NULL,
UPDATE_TIME_ DATE,
UPDATE_BY_ VARCHAR2(255) DEFAULT NULL,
PRIMARY KEY(ID_)
);

COMMENT ON COLUMN PORTAL_NEWS_TAG.ID_ IS '主键';
COMMENT ON COLUMN PORTAL_NEWS_TAG.NAME_ IS '标签名称';
COMMENT ON COLUMN PORTAL_NEWS_TAG.ALIAS_ IS '标签别名';
COMMENT ON COLUMN PORTAL_NEWS_TAG.STYLE_ IS '标签风格';
COMMENT ON COLUMN PORTAL_NEWS_TAG.TENANT_ID_ IS '租户id';
COMMENT ON COLUMN PORTAL_NEWS_TAG.CREATE_TIME_ IS '创建时间';
COMMENT ON COLUMN PORTAL_NEWS_TAG.CREATE_BY_ IS '创建人';
COMMENT ON COLUMN PORTAL_NEWS_TAG.UPDATE_TIME_ IS '更新时间';
COMMENT ON COLUMN PORTAL_NEWS_TAG.UPDATE_BY_ IS '更新人';

-- 2022-03-08 补充portal_sys_menu表中漏掉的前端菜单数据
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1441339605377536000', '3', '流程中心', 'matter', '', 'icon-process', NULL, 6, '', '-1.3.1441339605377536000.', '', '-1', '{"path":"/matter","component":"Layout","redirect":"noRedirect","name":"matter","alwaysShow":true,"meta":{"title":"流程中心","icon":"matterCenter"}}');
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1441341228585766912', '3', '个人中心', 'personal', '', 'icon-user1', NULL, 7, '', '-1.3.1441341228585766912.', '', '-1', '{"path":"/personal","component":"Layout","redirect":"noRedirect","name":"personal","alwaysShow":true,"meta":{"title":"个人中心","icon":"user"}}');
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1441341831483412480', '3', '应用中心', 'appCenter1', '', 'icon-application1', NULL, 8, '', '-1.3.1441341831483412480.', '', '-1', '{"meta":{"title":"应用中心","icon":"matterCenter"},"path":"/appCenter","component":"Layout","redirect":"noRedirect","alwaysShow":true}');
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1441342209381814272', '1441339605377536000', '新建流程', 'new', '', '', NULL, 1, '', '-1.3.1441339605377536000.1441342209381814272.', '', '-1', '{"meta":{"title":"新建流程","isChildren":true},"component":"@/views/matter/newMatter/index","path":"new","hidden":false}');
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1441342342999756800', '1441339605377536000', '流程启动', 'startProcess', '', '', NULL, 2, '', '-1.3.1441339605377536000.1441342342999756800.', '', '-1', '{"meta":{"title":"流程启动","isChildren":true},"component":"@/views/matter/StartProcess","path":"startProcess","hidden":true}');
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1441342471236407296', '1441339605377536000', '我的任务', 'myTask', '', '', NULL, 3, '', '-1.3.1441339605377536000.1441342471236407296.', '', '-1', '{"meta":{"title":"我的任务","isChildren":true},"path":"myTask","component":"@/views/matter/myTask/index"}');
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1441342583597617152', '1441339605377536000', '我的申请', 'apply', '', '', NULL, 4, '', '-1.3.1441339605377536000.1441342583597617152.', '', '-1', '{"meta":{"title":"我的申请","isChildren":true},"path":"apply","component":"@/views/matter/myRequest/index"}');
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1441359555827781632', '3', '首页', 'homePage', '', 'icon-aside-home', NULL, 5, '', '-1.3.1441359555827781632.', '', '-1', '{"meta":{},"component":"Layout","redirect":"index","path":"/"}');
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1441359958220918784', '1441359555827781632', '首页', 'Index', '', '', NULL, 1, '', '-1.3.1441359555827781632.1441359958220918784.', '', '-1', '{"path":"index","name":"Index","component":"@/views/home/index","meta":{"title":"首页","icon":"home","affix":true,"isChildren":true}}');
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1441938397294415872', '1441341228585766912', '个人设置', 'setting', '', '', NULL, 1, '', '-1.3.1441341228585766912.1441938397294415872.', '', '-1', '{"path":"setting","name":"setting","component":"@/views/personal/setting","meta":{"title":"个人设置","isChildren":true}}');
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1441938698676129792', '1441341228585766912', '邮件中心', 'mail', '', '', NULL, 2, '', '-1.3.1441341228585766912.1441938698676129792.', '', '-1', '{"path":"mail","name":"mail","component":"@/views/personal/mail","meta":{"title":"邮件中心","isChildren":true}}');
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1441941148611039232', '1441341831483412480', '应用中心', 'appCenter2', '', '', NULL, 1, '', '-1.3.1441341831483412480.1441941148611039232.', '', '-1', '{"path":"index","component":"@/views/appCenter/index","name":"AppCenter","meta":{"title":"首页","isChildren":true}}');
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1441946969948475392', '1441359555827781632', '个人中心', 'personalCenter', '', '', NULL, 2, '', '-1.3.1441359555827781632.1441946969948475392.', '', '-1', '{"path":"personalCenter","name":"personalCenter","component":"@/views/personalCenter/index","meta":{"title":"个人中心","icon":"laptop","isChildren":true},"hidden":true}');
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1441966593469501440', '1441339605377536000', '审批表单', 'approvalForm', '', '', NULL, 5, '', '-1.3.1441339605377536000.1441966593469501440.', '', '-1', '{"path":"approvalForm","name":"approvalForm","component":"@/views/matter/ApprovalForm","meta":{"title":"审批表单"},"hidden":true}');
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1443153816786980864', '1441339605377536000', '传阅事项', 'circulateMatter', '', '', NULL, 5, '', '-1.3.1441339605377536000.1443153816786980864.', '', '-1', '{"path":"circulateMatter","component":"@/views/matter/circulateMatter","redirect":"","alwaysShow":false,"caseSensitive":false,"meta":{"title":"传阅事项","isChildren":true}}');
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1494487013470261248', '1441341228585766912', '消息中心', 'xxzx', '', '', NULL, 1, '', '-1.3.1441341228585766912.1494487013470261248.', '', '-1', '{"path":"message","component":"@/views/personal/message","redirect":"","alwaysShow":false,"caseSensitive":false,"meta":{"title":"消息中心","isChildren":true}}');
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1432175565783007232', '4073629', '权限调整', 'permissionAdjustmentManage', '', '', NULL, 4, '', '-1.1.3641025.4073629.1432175565783007232.', '', '-1', NULL);

delete from portal_sys_menu where name_ = '外部接口调用日志' or name_ = '外部系统消息日志' or name_ = '外部接口管理';

INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1451456425861406720', '1437975457390284800', '外部接口管理', 'apiManager', '', '', NULL, 4, '', '- 1.1.1437982148582154240.1437975457390284800.1451456425861406720.', '', '-1', '{ "path" : "","component" : "","redirect" : "","alwaysShow" : false,"caseSensitive" : false, "meta" :{ "title" : "" }}');
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1451818951124017152', '5403008', '外部接口调用日志', 'externalSystemLog', '', '', NULL, 6, '', '- 1.1.3421053.5403008.1451818951124017152.', '', '-1', '{ "path" : "", "component" : "","redirect" : "","alwaysShow" : false,"caseSensitive" : false,"meta" :{ "title" : "" }}');
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1467391005218881536', '5403008', '外部系统消息日志', 'externalSystemQueueLog', '', '', NULL, 7, '', '-1.1.3421053.5403008.1467391005218881536.', '', '-1', '{"path":"","component":"Layout","redirect":"","alwaysShow":false,"caseSensitive":false,"meta":{"title":""}}');

-- bug #16597
CREATE TABLE bpm_flow_default_button
(
    ID_ varchar(64) NOT NULL,
    NAME_ varchar(64)  NOT NULL,
    ALIAS_ varchar(64)  NOT NULL,
    BEFORESCRIPT_ clob,
    AFTERSCRIPT_ clob,
    GROOVYSCRIPT_ clob,
    COMPLETEEVENTGROOVYSCRIPT_ clob,
    REJECTMODE_ varchar(64),
    REJECTNODE_ varchar(64),
    ISLOCK_ number,
    SUPPORTSCRIPT_ number,
    MSGCONFIG_ varchar(255),
    TYPE_ varchar(64),
    DISABLED_ number,
    constraint bpm_flow_default_button_pk PRIMARY KEY (ID_)
);
comment on column bpm_flow_default_button.ID_ is '主键';
comment on column bpm_flow_default_button.NAME_ is '按钮名称';
comment on column bpm_flow_default_button.ALIAS_ is '按钮别名';
comment on column bpm_flow_default_button.BEFORESCRIPT_ is '前置脚本';
comment on column bpm_flow_default_button.AFTERSCRIPT_ is '后置脚本';
comment on column bpm_flow_default_button.GROOVYSCRIPT_ is '后台java脚本';
comment on column bpm_flow_default_button.COMPLETEEVENTGROOVYSCRIPT_ is '后台完成任务后执行的java脚本';
comment on column bpm_flow_default_button.REJECTMODE_ is '驳回模式 reject 驳回指定节点  rejectPre 驳回上一步   backToStart 驳回发起人';
comment on column bpm_flow_default_button.REJECTNODE_ is '指定驳回的节点';
comment on column bpm_flow_default_button.SUPPORTSCRIPT_ is '是否支持脚本';
comment on column bpm_flow_default_button.MSGCONFIG_ is '按钮消息配置';
comment on column bpm_flow_default_button.TYPE_ is '按钮节点类型';
comment on column bpm_flow_default_button.DISABLED_ is '启用或者禁用';
comment on table bpm_flow_default_button is '流程默认按钮表';

-- 2022-03-09 补充遗漏的流程按钮相关数据
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1430769509001445376', '3641025', '流程按钮', 'flowButtonManager', 'startTaskButtons', '', NULL, 6, '', '-1.1.3641025.1430769509001445376.', '', '-1', NULL);
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1430788426285563904', '1430769509001445376', '用户任务节点', 'userTaskButtons', '', '', NULL, 2, '', '-1.1.3641025.1430769509001445376.1430788426285563904.', '', '-1', NULL);
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1430788606049239040', '1430769509001445376', '会签任务节点', 'signTaskButtons', '', '', NULL, 3, '', '-1.1.3641025.1430769509001445376.1430788606049239040.', '', '-1', NULL);
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1430789609448390656', '1430769509001445376', '开始任务节点', 'startTaskButtons', '', '', NULL, 1, '', '-1.1.3641025.1430769509001445376.1430789609448390656.', '', '-1', NULL);

INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('1', '启动', 'startFlow', '', '', '', '', 'backToStart,rejectPre,reject', '', 0, 1, '', 'start', 0);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('10', '签收', 'lockUnlock', '', '', '', '', 'backToStart,rejectPre,reject', '', 0, 0, '', 'userTask', 0);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('11', '保存', 'saveDraft', '', '', '', '', 'backToStart,rejectPre,reject', '', 0, 1, '', 'userTask', 0);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('12', '挂起', 'hangUp', '', '', '', '', 'backToStart,rejectPre,reject', '', 0, 0, '', 'userTask', 0);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('13', '取消挂起', 'cancelHangUp', '', '', '', '', 'backToStart,rejectPre,reject', '', 0, 0, '', 'userTask', 0);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('14', '反对', 'oppose', '', '', '', '', 'backToStart,rejectPre,reject', '', 0, 1, '', 'userTask', 0);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('15', '流转', 'startTrans', '', '', '', '', 'backToStart,rejectPre,reject', '', 0, 0, '', 'userTask', 0);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('16', '加签', 'addSign', '', '', '', '', 'backToStart,rejectPre,reject', '', 0, 0, '', 'userTask', 0);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('17', '终止', 'endProcess', '', '', '', '', 'backToStart,rejectPre,reject', '', 0, 1, '', 'userTask', 0);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('18', '传阅', 'instanceTrans', '', '', '', '', 'backToStart,rejectPre,reject', '', 0, 0, '', 'userTask', 1);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('19', '驳回发起人', 'backToStart', '', '', '', '', 'backToStart,rejectPre,reject', '', 0, 1, '', 'userTask', 1);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('2', '保存', 'saveDraft', NULL, NULL, NULL, NULL, 'backToStart,rejectPre,reject', NULL, 0, 1, NULL, 'start', 0);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('20', '同意', 'agree', NULL, NULL, NULL, NULL, 'backToStart,rejectPre,reject', NULL, 0, 1, NULL, 'signTask', 0);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('21', '沟通反馈', 'commu', '', '', '', '', 'backToStart,rejectPre,reject', '', 0, 1, '', 'signTask', 1);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('22', '驳回', 'reject', NULL, NULL, NULL, NULL, 'backToStart,rejectPre,reject', NULL, 0, 1, NULL, 'signTask', 0);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('23', '征询', 'inqu', NULL, NULL, NULL, NULL, 'backToStart,rejectPre,reject', NULL, 0, 0, NULL, 'signTask', 0);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('24', '转办', 'delegate', NULL, NULL, NULL, NULL, 'backToStart,rejectPre,reject', NULL, 0, 0, NULL, 'signTask', 0);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('25', '保存', 'saveDraft', NULL, NULL, NULL, NULL, 'backToStart,rejectPre,reject', NULL, 0, 1, NULL, 'signTask', 0);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('26', '反对', 'oppose', NULL, NULL, NULL, NULL, 'backToStart,rejectPre,reject', NULL, 0, 1, NULL, 'signTask', 0);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('27', '驳回发起人', 'backToStart', '', '', '', '', 'backToStart,rejectPre,reject', '', 0, 1, '', 'signTask', 1);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('28', '传阅', 'instanceTrans', '', '', '', '', 'backToStart,rejectPre,reject', '', 0, 0, '', 'signTask', 1);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('29', '加签', 'addSign', NULL, NULL, NULL, NULL, 'backToStart,rejectPre,reject', NULL, 0, 0, NULL, 'signTask', 0);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('3', '同意', 'agree', '', '', '', '', 'backToStart,rejectPre,reject', '', 0, 1, '', 'userTask', 0);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('4', '同意（流转）', 'agreeTrans', NULL, NULL, NULL, NULL, 'backToStart,rejectPre,reject', NULL, 0, 1, NULL, 'userTask', 0);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('5', '反对（流转）', 'opposeTrans', NULL, NULL, NULL, NULL, 'backToStart,rejectPre,reject', NULL, 0, 1, NULL, 'userTask', 0);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('6', '沟通反馈', 'commu', '', '', '', '', 'backToStart,rejectPre,reject', '', 0, 1, '', 'userTask', 1);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('7', '驳回', 'reject', NULL, NULL, NULL, NULL, 'backToStart,rejectPre,reject', NULL, 0, 1, NULL, 'userTask', 0);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('8', '征询', 'inqu', NULL, NULL, NULL, NULL, 'backToStart,rejectPre,reject', NULL, 0, 0, NULL, 'userTask', 0);
INSERT INTO BPM_FLOW_DEFAULT_BUTTON(ID_, NAME_, ALIAS_, BEFORESCRIPT_, AFTERSCRIPT_, GROOVYSCRIPT_, COMPLETEEVENTGROOVYSCRIPT_, REJECTMODE_, REJECTNODE_, ISLOCK_, SUPPORTSCRIPT_, MSGCONFIG_, TYPE_, DISABLED_) VALUES ('9', '转办', 'delegate', NULL, NULL, NULL, NULL, 'backToStart,rejectPre,reject', NULL, 0, 0, NULL, 'userTask', 0);

-- 补充流程发起人账号字段
ALTER TABLE BPM_PRO_INST ADD CREATE_ACCOUNT_ VARCHAR2(64);
COMMENT ON COLUMN BPM_PRO_INST.CREATE_ACCOUNT_ IS '流程发起人账号';

-- 补充新闻表遗漏字段
ALTER TABLE PORTAL_NEWS_NOTICE_ ADD TAG_ VARCHAR2(64);
ALTER TABLE PORTAL_NEWS_NOTICE_ ADD ICON_COLOR_ VARCHAR2(10);
ALTER TABLE PORTAL_NEWS_NOTICE_ ADD DEPARTMENT_ VARCHAR2(255);
ALTER TABLE PORTAL_NEWS_NOTICE_ ADD PUBLISH_TIME_ DATE;
COMMENT ON COLUMN PORTAL_NEWS_NOTICE_.TAG_ IS '标签';
COMMENT ON COLUMN PORTAL_NEWS_NOTICE_.ICON_COLOR_ IS '图表颜色';
COMMENT ON COLUMN PORTAL_NEWS_NOTICE_.DEPARTMENT_ IS '拟稿部门';
COMMENT ON COLUMN PORTAL_NEWS_NOTICE_.PUBLISH_TIME_ IS '发布时间';


-- 2022-03-02 yijj 新增流程实例回收站菜单
INSERT INTO portal_sys_menu(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_, ROUTE_EXTEND_) VALUES ('1497089603655909376', '4171077', '实例回收站', 'instanceRecovery', '', '', NULL, 4, '', '-1.1.3641025.4171077.1497089603655909376.', '', '-1', '{"path":"","component":"Layout","redirect":"","alwaysShow":false,"caseSensitive":false,"meta":{"title":""}}');

-- 2022-03-15 jjx 添加首页布局标题名
UPDATE portal_sys_menu SET  ROUTE_EXTEND_ = '{"meta":{"title":"首页"},"component":"Layout","redirect":"index","path":"/"}' WHERE ID_ = '1441359555827781632';


CREATE TABLE "PORTAL_AGENDA_DAY" (
  "ID_" VARCHAR2(64) NOT NULL,
  "CREATOR_" VARCHAR2(64),
  "SUBJECT_" VARCHAR2(255),
  "START_TIME_" DATE NOT NULL,
  "END_TIME_" DATE,
  "CONTENT_" VARCHAR2(4000),
  "SHARE_ID_" VARCHAR2(2000),
  "SHARE_NAME_" VARCHAR2(2000),
  "CREATE_BY_" VARCHAR2(64),
  "UPDATE_BY_" VARCHAR2(64),
  "CREATE_TIME_" DATE,
  "UPDATE_TIME_" DATE,
  "CREATE_ORG_ID_" VARCHAR2(64),
  "TENANT_ID_" VARCHAR2(64),
  PRIMARY KEY ("ID_")
)
;

COMMENT ON COLUMN "PORTAL_AGENDA_DAY"."ID_" IS '主键';

COMMENT ON COLUMN "PORTAL_AGENDA_DAY"."CREATOR_" IS '创建人';

COMMENT ON COLUMN "PORTAL_AGENDA_DAY"."SUBJECT_" IS '日程标题';

COMMENT ON COLUMN "PORTAL_AGENDA_DAY"."START_TIME_" IS '开始时间';

COMMENT ON COLUMN "PORTAL_AGENDA_DAY"."END_TIME_" IS '结束时间';

COMMENT ON COLUMN "PORTAL_AGENDA_DAY"."CONTENT_" IS '日程内容';

COMMENT ON COLUMN "PORTAL_AGENDA_DAY"."SHARE_ID_" IS '日程共享人id';

COMMENT ON COLUMN "PORTAL_AGENDA_DAY"."SHARE_NAME_" IS '日程共享人姓名';

COMMENT ON COLUMN "PORTAL_AGENDA_DAY"."CREATE_BY_" IS '创建人id';

COMMENT ON COLUMN "PORTAL_AGENDA_DAY"."UPDATE_BY_" IS '更新人id';

COMMENT ON COLUMN "PORTAL_AGENDA_DAY"."CREATE_TIME_" IS '创建时间';

COMMENT ON COLUMN "PORTAL_AGENDA_DAY"."UPDATE_TIME_" IS '更新时间';

COMMENT ON COLUMN "PORTAL_AGENDA_DAY"."CREATE_ORG_ID_" IS '创建人所属部门id';

COMMENT ON COLUMN "PORTAL_AGENDA_DAY"."TENANT_ID_" IS '租户id';

COMMENT ON TABLE "PORTAL_AGENDA_DAY" IS '日程管理';


CREATE TABLE "PORTAL_WEIXIN_MATERIAL" (
  "ID_" VARCHAR2(64) NOT NULL,
  "APPID" VARCHAR2(255),
  "TITLE" VARCHAR2(600),
  "AUTHOR" VARCHAR2(64),
  "DIGEST" VARCHAR2(255),
  "CONTENT" BLOB,
  "CONTENT_SOURCE_URL" VARCHAR2(600),
  "THUMB_MEDIA_ID" VARCHAR2(255),
  "SHOW_COVER_PIC" INT,
  "URL" VARCHAR2(600),
  "NEED_OPEN_COMMENT" INT,
  "THUMB_URL" VARCHAR2(600),
  "ONLY_FANS_CAN_COMMENT" INT,
  "CREATE_TIME" DATE,
  "UPDATE_TIME" DATE,
  "PULL_TIME" DATE,
  PRIMARY KEY ("ID_")
)
;

CREATE INDEX IDX_APPID  ON PORTAL_WEIXIN_MATERIAL (APPID);


COMMENT ON COLUMN "PORTAL_WEIXIN_MATERIAL"."ID_" IS '主键';

COMMENT ON COLUMN "PORTAL_WEIXIN_MATERIAL"."APPID" IS '用户凭证';

COMMENT ON COLUMN "PORTAL_WEIXIN_MATERIAL"."TITLE" IS '标题';

COMMENT ON COLUMN "PORTAL_WEIXIN_MATERIAL"."AUTHOR" IS '作者';

COMMENT ON COLUMN "PORTAL_WEIXIN_MATERIAL"."DIGEST" IS '摘要';

COMMENT ON COLUMN "PORTAL_WEIXIN_MATERIAL"."CONTENT" IS '内容';

COMMENT ON COLUMN "PORTAL_WEIXIN_MATERIAL"."CONTENT_SOURCE_URL" IS '图文消息的原文地址，即点击“阅读原文”后的URL';

COMMENT ON COLUMN "PORTAL_WEIXIN_MATERIAL"."THUMB_MEDIA_ID" IS '图文消息的封面图片素材id（必须是永久mediaID）';

COMMENT ON COLUMN "PORTAL_WEIXIN_MATERIAL"."SHOW_COVER_PIC" IS '是否显示封面，0为false，即不显示，1为true，即显示';

COMMENT ON COLUMN "PORTAL_WEIXIN_MATERIAL"."URL" IS '图文页的URL';

COMMENT ON COLUMN "PORTAL_WEIXIN_MATERIAL"."NEED_OPEN_COMMENT" IS '是否打开评论，0不打开，1打开';

COMMENT ON COLUMN "PORTAL_WEIXIN_MATERIAL"."THUMB_URL" IS '素材图片地址';

COMMENT ON COLUMN "PORTAL_WEIXIN_MATERIAL"."ONLY_FANS_CAN_COMMENT" IS '是否粉丝才可评论，0所有人可评论，1粉丝才可评论';

COMMENT ON COLUMN "PORTAL_WEIXIN_MATERIAL"."CREATE_TIME" IS '创建时间';

COMMENT ON COLUMN "PORTAL_WEIXIN_MATERIAL"."UPDATE_TIME" IS '更新时间';

COMMENT ON COLUMN "PORTAL_WEIXIN_MATERIAL"."PULL_TIME" IS '拉取时间';

COMMENT ON TABLE "PORTAL_WEIXIN_MATERIAL" IS '微信永久素材列表';

-- 2022-03-19 jjx 修改索引
create index ALIAS_TENANT_ID__INDEX
   on PORTAL_SYS_COLUMN (ALIAS, TENANT_ID_)
/