-- 2020-8-4 yangxb PGSQL数据库修改表字段长度
ALTER TABLE qrtz_job_details ALTER COLUMN is_durable TYPE CHARACTER VARYING(10);
ALTER TABLE qrtz_job_details ALTER COLUMN is_nonconcurrent TYPE CHARACTER VARYING(10);
ALTER TABLE qrtz_job_details ALTER COLUMN is_update_data TYPE CHARACTER VARYING(10);
ALTER TABLE qrtz_job_details ALTER COLUMN requests_recovery TYPE CHARACTER VARYING(10);
ALTER TABLE qrtz_simprop_triggers ALTER COLUMN bool_prop_1 TYPE CHARACTER VARYING(10);
ALTER TABLE qrtz_simprop_triggers ALTER COLUMN bool_prop_2 TYPE CHARACTER VARYING(10);
ALTER TABLE QRTZ_FIRED_TRIGGERS ALTER COLUMN requests_recovery TYPE CHARACTER VARYING(10);
ALTER TABLE QRTZ_FIRED_TRIGGERS ALTER COLUMN is_nonconcurrent TYPE CHARACTER VARYING(10);
UPDATE portal_sys_datasource_def set setting_json_ = '[{"name":"username","comment":"username","type":"java.lang.String","baseAttr":"1","default":"root"},{"name":"password","comment":"password","type":"java.lang.String","baseAttr":"1","default":"root"},{"isAdd":true,"name":"url","comment":"url","type":"java.lang.String","baseAttr":"1","default":""},{"name":"initialSize","comment":"initialSize","type":"int","baseAttr":"1","default":"10"},{"name":"maxActive","comment":"maxActive","type":"int","baseAttr":"1","default":"100"},{"name":"minIdle","comment":"minIdle","type":"int","baseAttr":"1","default":"10"},{"name":"maxWait","comment":"maxWait","type":"long","baseAttr":"1","default":"60000"},{"name":"validationQuery","comment":"validationQuery","type":"java.lang.String","baseAttr":"1","default":"select 1 from dual"},{"name":"testOnBorrow","comment":"testOnBorrow","type":"boolean","baseAttr":"1","default":"false"},{"name":"testOnReturn","comment":"testOnReturn","type":"boolean","baseAttr":"1","default":"false"},{"name":"testWhileIdle","comment":"testWhileIdle","type":"boolean","baseAttr":"1","default":"true"},{"name":"poolPreparedStatements","comment":"poolPreparedStatements","type":"boolean","baseAttr":"1","default":"true"},{"name":"maxPoolPreparedStatementPerConnectionSize","comment":"maxPoolPreparedStatementPerConnectionSize","type":"int","baseAttr":"1","default":"20"},{"name":"filters","comment":"filters","type":"java.util.List","baseAttr":"1","default":"config,stat"},{"name":"timeBetweenEvictionRunsMillis","comment":"timeBetweenEvictionRunsMillis","type":"long","baseAttr":"1","default":"60000"},{"name":"minEvictableIdleTimeMillis","comment":"minEvictableIdleTimeMillis","type":"long","baseAttr":"1","default":"300000"},{"name":"removeAbandoned","comment":"removeAbandoned","type":"boolean","baseAttr":"1","default":"true"},{"name":"removeAbandonedTimeoutMillis","comment":"removeAbandonedTimeoutMillis","type":"long","baseAttr":"1","default":"60000"},{"name":"logAbandoned","comment":"logAbandoned","type":"boolean","baseAttr":"1","default":"true"},{"isAdd":true,"name":"breakAfterAcquireFailure","comment":"breakAfterAcquireFailure","type":"boolean","baseAttr":"1","default":"true"}]' WHERE id_ = '1';

-- 2020-8-5 yangxb PGSQL数据库数据内容修改
UPDATE BPM_MULTI_SCRIPT SET argument_='[{"paraName":"arg0","paraType":"java.lang.Boolean","paraDesc":"是否主负责人","paraCt":null,"paraCtBindName":"","paraCtBindKey":null,"multiSelect":false}]' WHERE id_='11';
UPDATE BPM_MULTI_SCRIPT SET argument_='[{"paraName":"arg1","paraType":"java.lang.String","paraDesc":"类型ID","paraCt":"","paraCtBindName":"ID_","paraCtBindKey":"","multiSelect":false}]' WHERE id_='12';
UPDATE BPM_MULTI_SCRIPT SET argument_='[{"paraName":"arg1","paraType":"java.lang.String","paraDesc":"类型ID","paraCt":"cusdg:yhgxflxz","paraCtBindName":"ID_","paraCtBindKey":"ID_","multiSelect":false}]' WHERE id_='13';
UPDATE BPM_MULTI_SCRIPT SET argument_='[{"paraName":"arg0","paraType":"java.lang.Boolean","paraDesc":"是否主负责人","paraCt":"null","$$hashKey":"object:2340","multiSelect":false},{"paraName":"arg1","paraType":"java.lang.String","paraDesc":"维度编码（不传为默认维度）","multiSelect":false,"paraCt":"base:dem-selector","paraCtBindKey":"code","paraCtBindName":"code"}]' WHERE id_='16';
UPDATE BPM_MULTI_SCRIPT SET argument_='[{"paraName":"arg0","paraType":"java.lang.Boolean","paraDesc":"是否主负责人","paraCt":"","$$hashKey":"object:1955","multiSelect":false},{"paraName":"arg1","paraType":"java.lang.String","paraDesc":"维度编码（不传为默认维度）","multiSelect":false,"paraCt":"base:dem-selector","paraCtBindKey":"code","paraCtBindName":"code"}]' WHERE id_='17';
UPDATE BPM_MULTI_SCRIPT SET argument_='[{"paraName":"arg0","paraType":"boolean","paraDesc":"是否主负责人","paraCt":"","$$hashKey":"object:1387","multiSelect":false},{"paraName":"arg1","paraType":"java.lang.String","paraDesc":"维度编码（不传为默认维度）","multiSelect":false,"paraCt":"base:dem-selector","paraCtBindKey":"code","paraCtBindName":"code"}]' WHERE id_='18';
UPDATE BPM_MULTI_SCRIPT SET argument_='[{"paraName":"arg0","paraType":"java.lang.Boolean","paraDesc":"是否主负责人","paraCt":"null","$$hashKey":"object:1002","multiSelect":false},{"paraName":"arg1","paraType":"java.lang.String","paraDesc":"维度编码（不传为默认维度）","multiSelect":false,"paraCt":"base:dem-selector","paraCtBindKey":"code","paraCtBindName":"code"}]' WHERE id_='19';
UPDATE BPM_MULTI_SCRIPT SET argument_='[{"paraName":"arg0","paraType":"java.lang.String","paraDesc":"组织ID","paraCt":"base:org-selector","paraCtBindName":"id_","paraCtBindKey":"id","multiSelect":false,"$$hashKey":"object:645"}]' WHERE id_='2';
UPDATE BPM_MULTI_SCRIPT SET argument_='[{"paraName":"arg0","paraType":"java.lang.String","paraDesc":"组织编码","paraCt":"base:org-selector","paraCtBindName":"code","paraCtBindKey":"code","multiSelect":false},{"paraName":"arg1","paraType":"java.lang.String","paraDesc":"职务编码","paraCt":"base:dem-selector","paraCtBindName":"code","paraCtBindKey":"code","multiSelect":false}]' WHERE id_='20';
UPDATE BPM_MULTI_SCRIPT SET argument_='[{"paraName":"arg0","paraType":"java.lang.String","paraDesc":"用户id","multiSelect":false,"paraCt":"base:user-selector","paraCtBindKey":"id","paraCtBindName":"id"},{"paraName":"arg1","paraType":"java.lang.String","paraDesc":"组织id或编码","multiSelect":false,"paraCt":"base:org-selector","paraCtBindKey":"id","paraCtBindName":"id"},{"paraName":"arg2","paraType":"java.lang.String","paraDesc":"维度id或编码","multiSelect":false,"paraCt":"base:dem-selector","paraCtBindKey":"id","paraCtBindName":"id"}]' WHERE id_='21';
UPDATE BPM_MULTI_SCRIPT SET argument_='[{"paraName":"arg0","paraType":"java.lang.String","paraDesc":"组织id或编码","multiSelect":false,"paraCt":"base:org-selector","paraCtBindKey":"id","paraCtBindName":"id"},{"paraName":"arg1","paraType":"java.lang.String","paraDesc":"维度id或编码","multiSelect":false,"paraCt":"base:dem-selector","paraCtBindKey":"id","paraCtBindName":"id"}]' WHERE id_='22';
UPDATE BPM_MULTI_SCRIPT SET argument_='[{"paraName":"arg0","paraType":"java.lang.String","paraDesc":"组织id或编码","multiSelect":false,"paraCt":"base:org-selector","paraCtBindKey":"id","paraCtBindName":"id"},{"paraName":"arg1","paraType":"java.lang.String","paraDesc":"维度id或编码","multiSelect":false,"paraCt":"base:dem-selector","paraCtBindKey":"id","paraCtBindName":"id"}]' WHERE id_='23';
UPDATE BPM_MULTI_SCRIPT SET argument_='[{"paraName":"arg0","paraType":"java.lang.String","paraDesc":"岗位编码","paraCt":"base:pos-selector","paraCtBindName":"code","paraCtBindKey":"code","multiSelect":false}]' WHERE id_='3';
UPDATE BPM_MULTI_SCRIPT SET argument_='[{"paraName":"arg0","paraType":"java.lang.String","paraDesc":"组织ID","paraCt":"base:org-selector","paraCtBindName":"组织ID","paraCtBindKey":"id","multiSelect":false,"$$hashKey":"object:3067"},{"paraName":"arg1","paraType":"java.lang.Boolean","paraDesc":"是否主负责人","paraCt":null,"paraCtBindName":"","paraCtBindKey":null,"multiSelect":false,"$$hashKey":"object:3068"}]' WHERE id_='10';
UPDATE BPM_MULTI_SCRIPT SET argument_='[{"paraName":"arg0","paraType":"java.lang.String","paraDesc":"组织ID","paraCt":"base:org-selector","paraCtBindName":"id_","paraCtBindKey":"id","multiSelect":false,"$$hashKey":"object:3514"}]' WHERE id_='4';
UPDATE BPM_MULTI_SCRIPT SET argument_='[{"paraName":"arg0","paraType":"java.lang.String","paraDesc":"组织ID","paraCt":"base:org-selector","paraCtBindName":"ID_","paraCtBindKey":"id","multiSelect":false},{"paraName":"arg1","paraType":"java.lang.Boolean","paraDesc":"是否主负责人","paraCt":null,"paraCtBindName":"","paraCtBindKey":null,"multiSelect":false,"$$hashKey":"object:2506"}]' WHERE id_='9';

-- 2020-8-5 yangxb PGSQL数据库表类型修改
alter table act_re_procdef drop column if exists has_start_form_key_;
alter table act_re_procdef add column has_start_form_key_ bool;

alter table act_re_procdef drop column if exists has_graphical_notation_;
alter table act_re_procdef add column has_graphical_notation_ bool;

alter table act_re_procdef drop column if exists generated_;
alter table act_re_procdef add column generated_ bool;

ALTER TABLE portal_sys_my_layout ALTER COLUMN user_id type varchar(64);
UPDATE portal_sys_column set data_param = '[{"name":"pageBean","type":"string","mode":"0","value":"{\"page\":1,\"pageSize\":7,\"total\":0,\"showTotal\":false}"}]' where id='1267777395872632832';
UPDATE portal_sys_column set data_param = '[{"name":"pageBean","type":"string","mode":"0","value":"{\"page\":1,\"pageSize\":7,\"total\":0,\"showTotal\":false}"}]' where id='1267768754310352896';


-- 2020-8-6 yangxb 添加移动端集成初始化数据
delete from portal_sys_menu where id_='1254651912154910720';
INSERT INTO portal_sys_menu(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_) VALUES ('1285866575999668224', '1254651824338767872', '移动端集成', 'mobileUnite', 'sysExternalUniteList', '', 1, 7, '', '-1.1.1254651824338767872.1285866575999668224.', '', '-1');
INSERT INTO portal_sys_menu(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_) VALUES ('1285866673655648256', '1285866575999668224', '移动端集成', 'sysExternalUniteList', '', '', 1, 1, '', '-1.1.1254651824338767872.1285866575999668224.1285866673655648256.', '', '-1');
INSERT INTO portal_sys_menu(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_) VALUES ('1285866737765584896', '1285866575999668224', '应用中心', 'appModelManager', '', '', 1, 2, '', '-1.1.1254651824338767872.1285866575999668224.1285866737765584896.', '', '-1');

DROP TABLE IF EXISTS portal_app;
CREATE TABLE portal_app (
  ID_ varchar(64) NOT NULL,
  NAME_ varchar(255) DEFAULT NULL,
  CONTENT_ varchar(1000) DEFAULT NULL,
  ICON_ varchar(255) DEFAULT NULL,
  ICON_COLOR_ varchar(10) DEFAULT NULL,
  TYPE_ID_ varchar(64) DEFAULT NULL,
  TYPE_NAME_ varchar(255) DEFAULT NULL,
  ENABLE_ int2 DEFAULT NULL,
  MODE_ int2 DEFAULT NULL,
  SN_ int4 DEFAULT NULL,
  CREATE_BY_ varchar(64) DEFAULT NULL,
  CREATE_TIME_ timestamp DEFAULT NULL,
  UPDATE_BY_ varchar(64) DEFAULT NULL,
  UPDATE_TIME_ timestamp DEFAULT NULL,
  TENANT_ID_ varchar(64) DEFAULT NULL,
  PRIMARY KEY (ID_)
);
COMMENT ON COLUMN portal_app.NAME_ IS
'应用名称';
COMMENT ON COLUMN portal_app.CONTENT_ IS
'内容';
COMMENT ON COLUMN portal_app.ICON_ IS
'图标';
COMMENT ON COLUMN portal_app.ICON_COLOR_ IS
'图标颜色';
COMMENT ON COLUMN portal_app.TYPE_ID_ IS
'分类id';
COMMENT ON COLUMN portal_app.TYPE_NAME_ IS
'分类名称';
COMMENT ON COLUMN portal_app.ENABLE_ IS
'是否启用：0未启用，1已启用';
COMMENT ON COLUMN portal_app.MODE_ IS
'类型：1站内地址，2站外地址，3数据报表';
COMMENT ON COLUMN portal_app.SN_ IS
'排序';
COMMENT ON COLUMN portal_app.CREATE_BY_ IS
'创建人';
COMMENT ON COLUMN portal_app.CREATE_TIME_ IS
'创建时间';
COMMENT ON COLUMN portal_app.UPDATE_BY_ IS
'更新人';
COMMENT ON COLUMN portal_app.UPDATE_TIME_ IS
'更新时间';
COMMENT ON COLUMN portal_app.TENANT_ID_ IS
'租户id';

DROP TABLE IF EXISTS form_data_template_extend;
CREATE TABLE form_data_template_extend (
  ID_ varchar(64) NOT NULL,
  CONTENT_ text,
  COUNT_ varchar(64) DEFAULT NULL,
  OBJ_ID_ varchar(2000),
  TYPE_OBJ_ varchar(64) DEFAULT NULL,
  OBJ_NAME_ text,
  RULE_ text,
  TENANT_ID_ varchar(64) DEFAULT NULL,
  FORM_DATA_TEMPLATE_ID varchar(64) DEFAULT NULL,
  SUBJECT_ varchar(500),
  PRIMARY KEY (ID_)
);
COMMENT ON COLUMN form_data_template_extend.ID_ IS
'主键';
COMMENT ON COLUMN form_data_template_extend.CONTENT_ IS
'提醒内容';
COMMENT ON COLUMN form_data_template_extend.COUNT_ IS
'提醒次数';
COMMENT ON COLUMN form_data_template_extend.OBJ_ID_ IS
'提醒对象ID';
COMMENT ON COLUMN form_data_template_extend.TYPE_OBJ_ IS
'提醒内型';
COMMENT ON COLUMN form_data_template_extend.OBJ_NAME_ IS
'提醒对象名称';
COMMENT ON COLUMN form_data_template_extend.RULE_ IS
'提醒条件';
COMMENT ON COLUMN form_data_template_extend.TENANT_ID_ IS
'COMMENT ''租户Id';
COMMENT ON COLUMN form_data_template_extend.SUBJECT_ IS
'COMMENT ''提醒主题';

CREATE TABLE portal_data_sensitive  (
  ID_ varchar(64) NOT NULL,
  DATA_SOURCE_ALIAS_ varchar(255) DEFAULT NULL,
  TABLE_NAME_ varchar(255) DEFAULT NULL,
  REULES_REMARK_ varchar(1024) DEFAULT NULL,
  DESENSITIZATION_RULES_ text NULL,
  TENANT_ID_ varchar(64) DEFAULT NULL,
  PRIMARY KEY (ID_),
  UNIQUE (DATA_SOURCE_ALIAS_, TABLE_NAME_)
);
COMMENT ON COLUMN portal_data_sensitive.ID_ IS
'COMMENT ''主键';
COMMENT ON COLUMN portal_data_sensitive.DATA_SOURCE_ALIAS_ IS
'COMMENT ''数据源别名';
COMMENT ON COLUMN portal_data_sensitive.TABLE_NAME_ IS
'COMMENT ''表名';
COMMENT ON COLUMN portal_data_sensitive.REULES_REMARK_ IS
'COMMENT ''规则说明';
COMMENT ON COLUMN portal_data_sensitive.DESENSITIZATION_RULES_ IS
'DESENSITIZATION_RULES_ ''脱敏规则';
COMMENT ON COLUMN portal_data_sensitive.TENANT_ID_ IS
'DESENSITIZATION_RULES_ ''租户id';

alter table ACT_RU_EXECUTION drop column if exists is_active_;
alter table ACT_RU_EXECUTION add column is_active_ bool;

alter table ACT_RU_EXECUTION drop column if exists is_concurrent_;
alter table ACT_RU_EXECUTION add column is_concurrent_ bool;

alter table ACT_RU_EXECUTION drop column if exists is_scope_;
alter table ACT_RU_EXECUTION add column is_scope_ bool;

alter table ACT_RU_EXECUTION drop column if exists is_event_scope_;
alter table ACT_RU_EXECUTION add column is_event_scope_ bool;

alter table portal_sys_mail_setting drop column if exists use_ssl_;
alter table portal_sys_mail_setting add column use_ssl_ bool;
COMMENT ON COLUMN portal_sys_mail_setting.use_ssl_ IS
'COMMENT ''是否使用SSL认证。0：否；1：是';

alter table portal_sys_mail_setting drop column if exists is_validate_;
alter table portal_sys_mail_setting add column is_validate_ bool;
COMMENT ON COLUMN portal_sys_mail_setting.is_validate_ IS
'COMMENT ''是否需要身份验证。0：否；1：是';

alter table portal_sys_mail_setting drop column if exists is_handle_attach_;
alter table portal_sys_mail_setting add column is_handle_attach_ bool;
COMMENT ON COLUMN portal_sys_mail_setting.is_handle_attach_ IS
'COMMENT ''是否下载附件。0：否；1：是';

alter table portal_sys_mail_setting drop column if exists is_delete_remote_;
alter table portal_sys_mail_setting add column is_delete_remote_ bool;
COMMENT ON COLUMN portal_sys_mail_setting.is_delete_remote_ IS
'COMMENT ''下载时，是否删除远程邮件。0：否；1：是';

-- 2020-8-7 yangxb 添加汇总字段
ALTER TABLE FORM_DATA_TEMPLATE ADD SUMMARY_FIELD_ TEXT DEFAULT NULL;
ALTER TABLE FORM_QUERY_VIEW ADD SUMMARY_SETTING_ TEXT DEFAULT NULL;

-- 2020-8-11 yangxb 添加前端初始化缺少的表
DROP TABLE IF EXISTS form_remind_data;
CREATE TABLE form_remind_data (
  ID_ varchar(64) NOT NULL,
  CONTENT_ text,
  COUNT_ varchar(64) DEFAULT NULL,
  OBJ_ID_ varchar(2000),
  TYPE_OBJ_ varchar(64) DEFAULT NULL,
  OPEM_TYPE varchar(64) DEFAULT NULL,
  OPEM_ID varchar(64) DEFAULT NULL,
  TENANT_ID_ varchar(64) DEFAULT NULL,
  SUBJECT_ varchar(500),
  PRIMARY KEY (ID_)
);
COMMENT ON COLUMN form_remind_data.CONTENT_ IS
'COMMENT ''提醒内容';
COMMENT ON COLUMN form_remind_data.COUNT_ IS
'COMMENT ''提醒次数';
COMMENT ON COLUMN form_remind_data.OBJ_ID_ IS
'COMMENT ''提醒对象ID';
COMMENT ON COLUMN form_remind_data.TYPE_OBJ_ IS
'COMMENT ''提醒类型';
COMMENT ON COLUMN form_remind_data.OPEM_TYPE IS
'COMMENT ''打开类型  数据报表 或者流程实例查看页面';
COMMENT ON COLUMN form_remind_data.OPEM_ID IS
'COMMENT ''流程实例Id 或者业务对象Id';
COMMENT ON COLUMN form_remind_data.SUBJECT_ IS
'COMMENT ''提醒主题';

ALTER TABLE PORTAL_SYS_DATASOURCE DROP COLUMN IF EXISTS init_on_start_;
ALTER TABLE PORTAL_SYS_DATASOURCE ADD COLUMN init_on_start_ bool;
COMMENT ON COLUMN PORTAL_SYS_DATASOURCE.init_on_start_ IS
'COMMENT ''在启动时，启动连接池，并添加到spring容器中管理。';

ALTER TABLE PORTAL_SYS_DATASOURCE DROP COLUMN IF EXISTS enabled_;
ALTER TABLE PORTAL_SYS_DATASOURCE ADD COLUMN enabled_ bool;
COMMENT ON COLUMN PORTAL_SYS_DATASOURCE.enabled_ IS
'COMMENT ''是否生效';

-- 2020-08-11 添加mysql的change.sql开始

-- 2020-7-21 qiuxd 迁移角色矩阵的代码
DROP TABLE IF EXISTS UC_MATRIX;
CREATE TABLE UC_MATRIX (
   ID_                  VARCHAR(64)          NOT NULL,
   CODE_             	VARCHAR(255)         NULL DEFAULT NULL,
   NAME_       			VARCHAR(255)         NULL DEFAULT NULL,
   TYPE_ID_     		VARCHAR(64)          NULL DEFAULT NULL,
   TYPE_NAME_          	VARCHAR(255)         NULL DEFAULT NULL,
   STATUS_             	INT4                 NULL DEFAULT NULL,
   MANAGER_ID_          VARCHAR(64)          NULL DEFAULT NULL,
   MANAGER_NAME_        VARCHAR(255)         NULL DEFAULT NULL,
   IS_DELE_             CHAR(1)              NULL DEFAULT '0',
   CREATE_BY_           VARCHAR(64)          NULL DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP                 NULL,
   CREATE_ORG_ID_       VARCHAR(64)          NULL DEFAULT NULL,
   UPDATE_BY_           VARCHAR(64)          NULL DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP                 NULL,
   TENANT_ID_           VARCHAR(64)          NULL DEFAULT NULL,
   CONSTRAINT PK_UC_MATRIX PRIMARY KEY (ID_)
);

COMMENT ON COLUMN UC_MATRIX.CODE_ IS
'编码/别名';

COMMENT ON COLUMN UC_MATRIX.STATUS_ IS
'状态：0待发布、1已发布';

COMMENT ON COLUMN UC_MATRIX.MANAGER_ID_ IS
'管理员ID';

COMMENT ON COLUMN UC_MATRIX.MANAGER_NAME_ IS
'管理员名称';

COMMENT ON COLUMN UC_MATRIX.IS_DELE_ IS
'是否已删，1已删除，0未删除';

DROP TABLE IF EXISTS UC_MATRIX_COL_DEF;
CREATE TABLE UC_MATRIX_COL_DEF (
   ID_                  VARCHAR(64)          NOT NULL,
   MATRIX_ID_           VARCHAR(255)         NULL DEFAULT NULL,
   CODE_       			VARCHAR(20)          NULL DEFAULT NULL,
   NAME_       			VARCHAR(255)         NULL DEFAULT NULL,
   STATUS_             	INT4                 NULL DEFAULT NULL,
   COL_TYPE_            INT4                 NULL DEFAULT NULL,
   SELECT_TYPE_         INT4                 NULL DEFAULT NULL,
   CTRL_TYPE_         	VARCHAR(20)          NULL DEFAULT NULL,
   QUERY_ALIAS_         VARCHAR(255)         NULL DEFAULT NULL,
   COL_CONFIG_        	VARCHAR(255)         NULL DEFAULT NULL,
   IS_DELE_             CHAR(1)              NULL DEFAULT '0',
   CREATE_BY_           VARCHAR(64)          NULL DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP                 NULL,
   CREATE_ORG_ID_       VARCHAR(64)          NULL DEFAULT NULL,
   UPDATE_BY_           VARCHAR(64)          NULL DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP                 NULL,
   TENANT_ID_           VARCHAR(64)          NULL DEFAULT NULL,
   SN_         			INT4                 NULL DEFAULT NULL,
   BIND_KEY_        	VARCHAR(255)         NULL DEFAULT NULL,
   BIND_VALUE_        	VARCHAR(255)         NULL DEFAULT NULL,
   CONSTRAINT PK_UC_MATRIX_COL_DEF PRIMARY KEY (ID_)
);

COMMENT ON COLUMN UC_MATRIX_COL_DEF.MATRIX_ID_ IS
'所属矩阵ID';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.CODE_ IS
'列字段名';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.NAME_ IS
'列中文名';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.STATUS_ IS
'列状态：0未创建列、1已创建列';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.COL_TYPE_ IS
'列类型：1条件列、2角色列';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.SELECT_TYPE_ IS
'选择类型：1单选、2多选';

COMMENT ON COLUMN UC_MATRIX_COL_DEF.IS_DELE_ IS
'是否已删，1已删除，0未删除';

-- 2020-7-22 邱喜达 人员脚本调整
UPDATE BPM_MULTI_SCRIPT SET METHOD_DESC_ = '通过下属管理获取用户的上级',ARGUMENT_ = '[{\"paraName\":\"arg0\",\"paraType\":\"java.lang.String\",\"paraDesc\":\"用户id\",\"multiSelect\":false,\"paraCt\":\"base:user-selector\",\"paraCtBindKey\":\"id\",\"paraCtBindName\":\"id\"},{\"paraName\":\"arg1\",\"paraType\":\"java.lang.String\",\"paraDesc\":\"维度id或编码\",\"multiSelect\":false,\"paraCt\":\"base:dem-selector\",\"paraCtBindKey\":\"id\",\"paraCtBindName\":\"id\"}]'
WHERE ID_ = '21';
UPDATE BPM_MULTI_SCRIPT SET METHOD_DESC_ = '通过下属管理获取当前用户的上级',ARGUMENT_ = '[{\"paraName\":\"arg0\",\"paraType\":\"java.lang.String\",\"paraDesc\":\"维度id或编码\",\"multiSelect\":false,\"paraCt\":\"base:dem-selector\",\"paraCtBindKey\":\"id\",\"paraCtBindName\":\"id\"}]'
WHERE ID_ = '22';
UPDATE BPM_MULTI_SCRIPT SET METHOD_DESC_ = '通过下属管理获取发起人的上级',ARGUMENT_ = '[{\"paraName\":\"arg0\",\"paraType\":\"java.lang.String\",\"paraDesc\":\"维度id或编码\",\"multiSelect\":false,\"paraCt\":\"base:dem-selector\",\"paraCtBindKey\":\"id\",\"paraCtBindName\":\"id\"}]'
WHERE ID_ = '23';

ALTER TABLE UC_ORG_POST ADD PARENT_ID_ VARCHAR(64) DEFAULT NULL;

ALTER TABLE UC_USER_UNDER ADD DIMEN_ID_ VARCHAR(64) DEFAULT NULL;

-- 2020-07-21 wanghb 【流程定义】配置的紧急状态没有效果  关闭
UPDATE  PORTAL_SYS_PROPERTIES SET ENCRYPT = 0 WHERE ID = '18';

-- 2020-07-22 pangquan 添加应用中心分类
INSERT INTO PORTAL_SYS_TYPE_GROUP(ID_, GROUP_KEY_, NAME_, FLAG_, SN_, TYPE_, CREATE_BY_, CREATE_TIME_, CREATE_ORG_ID_, UPDATE_BY_, UPDATE_TIME_) VALUES ('1285867753718288384', 'appType', '应用中心', 0, 0, 0, '1', null, '1', NULL, null);

-- 2020-07-23 yangxb 修改系统属性初始化数据
UPDATE portal_sys_properties SET NAME = '用户导入导出按钮显示' WHERE ID = '20';

-- 2020-07-23 lingpj 去掉报表草稿菜单
DELETE FROM PORTAL_SYS_MENU WHERE ID_ =  '1271725674687762432';

--  2020-7-23 张耀祥  新闻公告初始化数据
DROP TABLE IF EXISTS PORTAL_NEWS_NOTICE_;
CREATE TABLE PORTAL_NEWS_NOTICE_ (
   ID_                  VARCHAR(64)          NOT NULL,
   CLASSIFY_ID_         VARCHAR(255)         NOT NULL,
   CLASSIFY_NAME_       VARCHAR(1000)        NOT NULL,
   CLASSIFY_PATH_       VARCHAR(255)         NOT NULL,
   TITLE_               VARCHAR(255)         NOT NULL,
   IS_URL_              VARCHAR(255)         NOT NULL,
   TYPE_ID_             VARCHAR(64)          NOT NULL,
   URL_                 VARCHAR(64)          NOT NULL,
   CONTENT_      		VARCHAR(64)          NOT NULL,
   SN_                    INT4               NULL DEFAULT NULL,
   END_TIME_			TIMESTAMP                 NULL,
   ROTATING_DISPLAY_PICTURES_ VARCHAR(255)   NOT NULL,
   TITLE_DESCRIPTION_   VARCHAR(255)         NOT NULL,
   PAGE_HEIGHT_			NUMERIC(10,0)        NULL DEFAULT NULL,
   TENANT_ID_           VARCHAR(64)          NULL DEFAULT NULL,
   CREATE_BY_           VARCHAR(64)          NULL DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP                 NULL,
   UPDATE_BY_           VARCHAR(64)          NULL DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP                 NULL,
   TYPE_                   INT4               NULL DEFAULT NULL,
   ICON_                VARCHAR(255)          NULL DEFAULT NULL,
   FILE_                VARCHAR(255)          NULL DEFAULT NULL,
   DRAFTER_             VARCHAR(255)          NULL DEFAULT NULL,
   CONSTRAINT PK_PORTAL_NEWS_NOTICE_ PRIMARY KEY (ID_)
);

COMMENT ON COLUMN PORTAL_NEWS_NOTICE_.CLASSIFY_ID_ IS
'所属分类ID';

COMMENT ON COLUMN PORTAL_NEWS_NOTICE_.CLASSIFY_NAME_ IS
'所属分类NAME';

COMMENT ON COLUMN PORTAL_NEWS_NOTICE_.CLASSIFY_PATH_ IS
'所属分类路径';

COMMENT ON COLUMN PORTAL_NEWS_NOTICE_.TITLE_ IS
'标题';

COMMENT ON COLUMN PORTAL_NEWS_NOTICE_.IS_URL_ IS
'是否外部链接(true为是,false为不是)';

COMMENT ON COLUMN PORTAL_NEWS_NOTICE_.URL_ IS
'内容URL';

COMMENT ON COLUMN PORTAL_NEWS_NOTICE_.CONTENT_ IS
'内容';

COMMENT ON COLUMN PORTAL_NEWS_NOTICE_.SN_ IS
'排序';

COMMENT ON COLUMN PORTAL_NEWS_NOTICE_.TYPE_ IS
'所属类型(1为轮播图,2为新闻公告)';

DROP TABLE IF EXISTS PORTAL_NEWS_TREE_;
CREATE TABLE PORTAL_NEWS_TREE_ (
   ID_                  VARCHAR(64)          NOT NULL,
   NAME_                VARCHAR(64)          NOT NULL,
   PATH_                VARCHAR(64)          NOT NULL,
   PARENT_ID_           VARCHAR(255)         NOT NULL,
   RANK_                  INT4               NULL DEFAULT NULL,
   SN_                    INT4               NULL DEFAULT NULL,
   PARENT_NAME_         VARCHAR(255)         NOT NULL,
   TENANT_ID_           VARCHAR(64)          NULL DEFAULT NULL,
   CREATE_BY_           VARCHAR(64)          NULL DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP                 NULL,
   UPDATE_BY_           VARCHAR(64)          NULL DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP                 NULL,
   COL_HEIGHT_             INT4               NULL DEFAULT NULL,
   COLUMN_ID_           VARCHAR(255)          NULL DEFAULT NULL,
   INTERVAL_TIME_		   INT4               NULL DEFAULT NULL,
   CONSTRAINT PK_PORTAL_NEWS_TREE_ PRIMARY KEY (ID_)
);

COMMENT ON COLUMN PORTAL_NEWS_TREE_.NAME_ IS
'名称';

COMMENT ON COLUMN PORTAL_NEWS_TREE_.PATH_ IS
'路径';

COMMENT ON COLUMN PORTAL_NEWS_TREE_.PARENT_ID_ IS
'上级id';

COMMENT ON COLUMN PORTAL_NEWS_TREE_.RANK_ IS
'级别(总共有3级)';

COMMENT ON COLUMN PORTAL_NEWS_TREE_.SN_ IS
'排序';

COMMENT ON COLUMN PORTAL_NEWS_TREE_.PARENT_NAME_ IS
'路径名称';

-- 创建一个新闻公告的菜单
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_) VALUES ('1278989818835111936', '3711006', '新闻公告', 'portalNewsNoticeManager', NULL, NULL, '1', '3', NULL, '-1.1.3441002.3711006.1278989818835111936.', NULL, '-1');

-- 新闻公告树分类的初始化数据
INSERT INTO PORTAL_NEWS_TREE_ ( ID_, NAME_, PATH_, PARENT_ID_, RANK_, SN_, PARENT_NAME_, TENANT_ID_, CREATE_TIME_, CREATE_BY_, UPDATE_TIME_, UPDATE_BY_ )
VALUES
	( '100', '新闻公告', '100.', '0', 1, 0, '', '-1', NULL, '1', NULL, '1' );
INSERT INTO PORTAL_NEWS_TREE_ ( ID_, NAME_, PATH_, PARENT_ID_, RANK_, SN_, PARENT_NAME_, TENANT_ID_, CREATE_TIME_, CREATE_BY_, UPDATE_TIME_, UPDATE_BY_ )
VALUES
	( '200', '轮播图', '200.', '0', 1, 0, '', '-1', NULL, '1', NULL, NULL );

-- 2020-07-23 zhangxw 流程打印文件管理表
DROP TABLE IF EXISTS BPM_PRINT_RECORD;
CREATE TABLE BPM_PRINT_RECORD (
   ID_                  VARCHAR(64)          NOT NULL,
   PROC_DEF_KEY_        VARCHAR(64)          NULL DEFAULT NULL,
   PROC_DEF_NAME_       VARCHAR(64)          NULL DEFAULT NULL,
   PROC_DEF_ID_         VARCHAR(64)          NULL DEFAULT NULL,
   PROC_INST_ID_        VARCHAR(64)          NULL DEFAULT NULL,
   NODE_ID_     		VARCHAR(64)          NULL DEFAULT NULL,
   FORM_KEY_     		VARCHAR(64)          NULL DEFAULT NULL,
   TEMPLATE_ID_         VARCHAR(64)          NULL DEFAULT NULL,
   TEMPLATE_NAME_       VARCHAR(64)          NULL DEFAULT NULL,
   FILE_ID_             VARCHAR(64)          NULL DEFAULT NULL,
   LAST_VERSION_          INT4               NULL DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP                 NULL,
   CREATE_BY_           VARCHAR(64)          NULL DEFAULT NULL,
   CREATE_ORG_ID_       VARCHAR(64)          NULL DEFAULT NULL,
   UPDATE_BY_           VARCHAR(64)          NULL DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP                 NULL,
   TENANT_ID_           VARCHAR(64)          NULL DEFAULT NULL,
   CONSTRAINT PK_BPM_PRINT_RECORD PRIMARY KEY (ID_)
);

COMMENT ON COLUMN BPM_PRINT_RECORD.PROC_DEF_KEY_ IS
'流程定义KEY';

COMMENT ON COLUMN BPM_PRINT_RECORD.PROC_DEF_NAME_ IS
'流程定义名称';

COMMENT ON COLUMN BPM_PRINT_RECORD.PROC_DEF_ID_ IS
'流程定义ID';

COMMENT ON COLUMN BPM_PRINT_RECORD.PROC_INST_ID_ IS
'流程实例ID';

COMMENT ON COLUMN BPM_PRINT_RECORD.NODE_ID_ IS
'流程节点ID';

COMMENT ON COLUMN BPM_PRINT_RECORD.FORM_KEY_ IS
'表单key';

COMMENT ON COLUMN BPM_PRINT_RECORD.TEMPLATE_ID_ IS
'打印模板ID';

COMMENT ON COLUMN BPM_PRINT_RECORD.TEMPLATE_NAME_ IS
'打印模板名称';

COMMENT ON COLUMN BPM_PRINT_RECORD.FILE_ID_ IS
'打印文件id';

COMMENT ON COLUMN BPM_PRINT_RECORD.LAST_VERSION_ IS
'是否最后的版本（1：是，0：否）';

-- 2020-07-23 zhangxw 管理端添加打印记录菜单
INSERT INTO portal_sys_menu(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_) VALUES ('1264181442355793920', '4171077', '打印记录', 'printRecordManager', '', '', 1, 3, '', '-1.1.3641025.4171077.1264181442355793920.', '', '-1');

-- 2020-07-23 zhangxw 扩展登录统计表
DROP TABLE IF EXISTS UC_LOGIN_LOG;
CREATE TABLE UC_LOGIN_LOG (
   ID_                  VARCHAR(64)          NOT NULL,
   NAME_                VARCHAR(64)          NULL DEFAULT NULL,
   ACCOUNT_       	    VARCHAR(64)          NULL DEFAULT NULL,
   IP_       			VARCHAR(20)          NULL DEFAULT NULL,
   LOGIN_TYPE_          VARCHAR(20)          NULL DEFAULT NULL,
   PC_SUM_             		INT4             NULL DEFAULT NULL,
   MOBILE_SUM_            	INT4             NULL DEFAULT NULL,
   LOGIN_SUM_         		INT4             NULL DEFAULT NULL,
   CREATE_BY_           VARCHAR(64)          NULL DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP                 NULL,
   CREATE_ORG_ID_       VARCHAR(64)          NULL DEFAULT NULL,
   UPDATE_BY_           VARCHAR(64)          NULL DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP                 NULL,
   TENANT_ID_           VARCHAR(64)          NULL DEFAULT NULL,
   IS_DELE_             CHAR(1)              NULL DEFAULT '0',
   VERSION_         	   INT4              NULL DEFAULT NULL,
   CONSTRAINT PK_UC_LOGIN_LOG PRIMARY KEY (ID_)
);

COMMENT ON COLUMN UC_LOGIN_LOG.NAME_ IS
'用户名';

COMMENT ON COLUMN UC_LOGIN_LOG.ACCOUNT_ IS
'用户账号';

COMMENT ON COLUMN UC_LOGIN_LOG.IP_ IS
'登录IP';

COMMENT ON COLUMN UC_LOGIN_LOG.LOGIN_TYPE_ IS
'登录类型（pc：电脑端登录，mobile：移动端登录）';

COMMENT ON COLUMN UC_LOGIN_LOG.PC_SUM_ IS
'PC端登录次数';

COMMENT ON COLUMN UC_LOGIN_LOG.MOBILE_SUM_ IS
'移动端登录次数';

COMMENT ON COLUMN UC_LOGIN_LOG.LOGIN_SUM_ IS
'登录次数';

-- 2020-07-23 zhangxw 扩展登录统菜单
INSERT INTO portal_sys_menu(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_) VALUES ('1273944053116964864', '3441027', '登录统计', 'loginLogManager', '', '', 1, 3, '', '-1.1.3441009.3441027.1273944053116964864.', '', '-1');

-- 2020-07-26 张先稳 添加表portal_flow_upload_properties（流程附件上传配置表）
DROP TABLE IF EXISTS PORTAL_FLOW_UPLOAD_PROPERTIES;
CREATE TABLE PORTAL_FLOW_UPLOAD_PROPERTIES (
   ID_                  VARCHAR(64)          NOT NULL,
   NAME_                VARCHAR(64)          NOT NULL,
   FLOW_KEY_              TEXT         		 NOT NULL,
   FLOW_NAME_             TEXT         		 NOT NULL,
   UPLOAD_TYPE_         VARCHAR(255)         NOT NULL,
   LOCATION_            VARCHAR(255)         NOT NULL,
   FTP_URL_             VARCHAR(255)         NOT NULL,
   FTP_PORT_              INT4               NULL DEFAULT NULL,
   FTP_USER_NAME_       VARCHAR(255)         NOT NULL,
   FTP_PASSWORD_        VARCHAR(255)         NOT NULL,
   STATUS_              VARCHAR(255)         NOT NULL,
   ENCRYPT_NAME_          INT4               NULL DEFAULT NULL,
   DESC_         		VARCHAR(600)         NOT NULL,
   TENANT_ID_           VARCHAR(64)          NULL DEFAULT NULL,
   CREATE_BY_           VARCHAR(64)          NULL DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP                 NULL,
   CREATE_ORG_ID_       VARCHAR(64)          NULL DEFAULT NULL,
   UPDATE_BY_           VARCHAR(64)          NULL DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP                 NULL,
   CONSTRAINT PK_PORTAL_FLOW_UPLOAD_PROPERTIES PRIMARY KEY (ID_)
);

COMMENT ON COLUMN PORTAL_FLOW_UPLOAD_PROPERTIES.NAME_ IS
'名称';

COMMENT ON COLUMN PORTAL_FLOW_UPLOAD_PROPERTIES.FLOW_KEY_ IS
'流程key';

COMMENT ON COLUMN PORTAL_FLOW_UPLOAD_PROPERTIES.FLOW_NAME_ IS
'流程名称';

COMMENT ON COLUMN PORTAL_FLOW_UPLOAD_PROPERTIES.UPLOAD_TYPE_ IS
'上传方式：可用参数值：database（保存在数据库），folder（保存在服务器文件目录）；ftp（上传到ftp）';

COMMENT ON COLUMN PORTAL_FLOW_UPLOAD_PROPERTIES.LOCATION_ IS
'文件存储位置（存储方式为folder时需指定）';

COMMENT ON COLUMN PORTAL_FLOW_UPLOAD_PROPERTIES.FTP_URL_ IS
'ftp上传地址';

COMMENT ON COLUMN PORTAL_FLOW_UPLOAD_PROPERTIES.FTP_PORT_ IS
'FTP端口号';

COMMENT ON COLUMN PORTAL_FLOW_UPLOAD_PROPERTIES.FTP_USER_NAME_ IS
'ftp认证用户名';

COMMENT ON COLUMN PORTAL_FLOW_UPLOAD_PROPERTIES.FTP_PASSWORD_ IS
'FTP认证用户密码';

COMMENT ON COLUMN PORTAL_FLOW_UPLOAD_PROPERTIES.STATUS_ IS
'enable(生效)，disable（无效）';

COMMENT ON COLUMN PORTAL_FLOW_UPLOAD_PROPERTIES.ENCRYPT_NAME_ IS
'文件名是否加密（1：加密，0：不加密）';

COMMENT ON COLUMN PORTAL_FLOW_UPLOAD_PROPERTIES.DESC_ IS
'描述';

-- 2020-07-26 张先稳 添加菜单：流程附件配置
INSERT INTO portal_sys_menu(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_) VALUES ('1287308260197666816', '3761202', '流程附件配置', 'flowUploadProperties', '', '', 1, 4, '', '-1.1.3641025.3761202.1287308260197666816.', '', '-1');

-- 2020-07-27 黎扬贵 数据敏感管理
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_) VALUES ('1287699251299749888', '3421053', '数据敏感管理', 'portalDataSensitiveManager', '', '', 1, 10, '', '-1.1.3421053.1287699251299749888.', '', '-1');

-- 2020-08-05 邱喜达 角色矩阵
UPDATE PORTAL_SYS_MENU SET NAME_ = '角色矩阵管理',ALIAS_ = 'roleMatrixManager' WHERE ID_ = '3441030';
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_) VALUES ('1290961424914452480', '3441030', '角色管理', 'roleManager', '', '', 1, 3, '', '-1.1.3441009.3441030.1290961424914452480.', NULL, '-1');
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_) VALUES ('1290961558574338048', '3441030', '矩阵管理', 'matrixManager', '', '', 1, 2, '', '-1.1.3441009.3441030.1290961558574338048.', NULL, '-1');

-- 2020-08-06 wanghb 
ALTER TABLE form_data_import_log ADD COLUMN BO_ALIAS_  VARCHAR(64);

-- 2020-08-11 pangquan 用户表添加设备信息，用于app推送
ALTER TABLE uc_user ADD COLUMN CLIENT_ID_ varchar(255);
ALTER TABLE uc_user ADD COLUMN CLIENT_TOKEN_ varchar(255);

-- 2020-08-11 添加mysql的change.sql结束

-- 2020-08-11 表ACT_GE_BYTEARRAY的generated_修改类型
alter table ACT_GE_BYTEARRAY drop column if exists generated_;
alter table ACT_GE_BYTEARRAY add column generated_ bool;

-- 2020-08-12 表PORTAL_FLOW_UPLOAD_PROPERTIES存储位置改为可null
ALTER TABLE PORTAL_FLOW_UPLOAD_PROPERTIES ALTER location_ DROP NOT NULL;
ALTER TABLE PORTAL_FLOW_UPLOAD_PROPERTIES ALTER ftp_url_ DROP NOT NULL;
ALTER TABLE PORTAL_FLOW_UPLOAD_PROPERTIES ALTER ftp_port_ DROP NOT NULL;
ALTER TABLE PORTAL_FLOW_UPLOAD_PROPERTIES ALTER ftp_user_name_ DROP NOT NULL;
ALTER TABLE PORTAL_FLOW_UPLOAD_PROPERTIES ALTER ftp_password_ DROP NOT NULL;
ALTER TABLE PORTAL_FLOW_UPLOAD_PROPERTIES ALTER desc_ DROP NOT NULL;

--2020-08-13 邱喜达
ALTER TABLE BPM_TASK_REMINDER ADD COLUMN SEND_USER_ID_ VARCHAR(64);

INSERT INTO PORTAL_SYS_TYPE_GROUP(ID_, GROUP_KEY_, NAME_, FLAG_, SN_, TYPE_, CREATE_BY_, CREATE_TIME_, CREATE_ORG_ID_, UPDATE_BY_, UPDATE_TIME_) VALUES ('1285467330515701760', 'jzfl', '矩阵分类', 0, 0, 0, '1', '2020-08-13 09:54:06', NULL, NULL, '2020-08-13 09:54:06');

DROP TABLE IF EXISTS UC_SHIFT_RULE;
CREATE TABLE UC_SHIFT_RULE (
  ID_ varchar(64) NOT NULL,
  NAME_ varchar(128) DEFAULT NULL,
  KEY_ varchar(128) DEFAULT NULL,
  DESC_ TEXT,
  RULE_ TEXT,
  HOLIDAY_ID_ varchar(64) DEFAULT NULL,
  IS_DELE_ smallint DEFAULT NULL,
  CREATE_TIME_ timestamp DEFAULT NULL,
  UPDATE_TIME_ timestamp DEFAULT NULL,
  CREATE_BY_ varchar(64) DEFAULT NULL,
  UPDATE_BY_ varchar(64) DEFAULT NULL,
  CREATE_ORG_ID_ varchar(64) DEFAULT NULL,
  TENANT_ID_ varchar(64) DEFAULT NULL,
  VERSION_ int DEFAULT NULL,
  PRIMARY KEY (ID_)
);

COMMENT ON COLUMN UC_SHIFT_RULE.ID_ IS '主键';
COMMENT ON COLUMN UC_SHIFT_RULE.NAME_ IS '名称';
COMMENT ON COLUMN UC_SHIFT_RULE.KEY_ IS 'KEY';
COMMENT ON COLUMN UC_SHIFT_RULE.DESC_ IS '描述';
COMMENT ON COLUMN UC_SHIFT_RULE.RULE_ IS '规则';
COMMENT ON COLUMN UC_SHIFT_RULE.HOLIDAY_ID_ IS '节假日ID';
COMMENT ON COLUMN UC_SHIFT_RULE.IS_DELE_ IS '是否已删，1已删除，0未删除';
COMMENT ON COLUMN UC_SHIFT_RULE.CREATE_TIME_ IS '创建时间';
COMMENT ON COLUMN UC_SHIFT_RULE.UPDATE_TIME_ IS '更新时间';
COMMENT ON COLUMN UC_SHIFT_RULE.CREATE_BY_ IS '创建人ID';
COMMENT ON COLUMN UC_SHIFT_RULE.UPDATE_BY_ IS '更新人ID';
COMMENT ON COLUMN UC_SHIFT_RULE.CREATE_ORG_ID_ IS '创建组织ID';
COMMENT ON COLUMN UC_SHIFT_RULE.VERSION_ IS '版本';
COMMENT ON COLUMN UC_SHIFT_RULE.TENANT_ID_ IS '租户ID';

DROP TABLE IF EXISTS UC_SHIFT_USER;
CREATE TABLE UC_SHIFT_USER (
  ID_ varchar(64) NOT NULL,
  USER_ID_ varchar(64) DEFAULT NULL,
  SHIFT_ID_ varchar(64) DEFAULT NULL,
  TENANT_ID_ varchar(64) DEFAULT NULL,
  IS_DELE_ smallint DEFAULT NULL,
  VERSION_ int DEFAULT NULL,
  CREATE_BY_ varchar(64) DEFAULT NULL,
  UPDATE_BY_ varchar(64) DEFAULT NULL,
  CREATE_TIME_ TIMESTAMP DEFAULT NULL,
  UPDATE_TIME_ TIMESTAMP DEFAULT NULL,
  CREATE_ORG_ID_ varchar(64) DEFAULT NULL,
  PRIMARY KEY (ID_)
);

COMMENT ON COLUMN UC_SHIFT_USER.ID_ IS '主键';
COMMENT ON COLUMN UC_SHIFT_USER.USER_ID_ IS '用户ID';
COMMENT ON COLUMN UC_SHIFT_USER.SHIFT_ID_ IS '排班ID';
COMMENT ON COLUMN UC_SHIFT_USER.IS_DELE_ IS '是否已删，1已删除，0未删除';
COMMENT ON COLUMN UC_SHIFT_USER.CREATE_TIME_ IS '创建时间';
COMMENT ON COLUMN UC_SHIFT_USER.UPDATE_TIME_ IS '更新时间';
COMMENT ON COLUMN UC_SHIFT_USER.CREATE_BY_ IS '创建人ID';
COMMENT ON COLUMN UC_SHIFT_USER.UPDATE_BY_ IS '更新人ID';
COMMENT ON COLUMN UC_SHIFT_USER.CREATE_ORG_ID_ IS '创建组织ID';
COMMENT ON COLUMN UC_SHIFT_USER.VERSION_ IS '版本';
COMMENT ON COLUMN UC_SHIFT_USER.TENANT_ID_ IS '租户ID';

DROP TABLE IF EXISTS UC_HOLIDAY;
CREATE TABLE UC_HOLIDAY (
  ID_ varchar(64) NOT NULL,
  NAME_ varchar(128) DEFAULT NULL,
  KEY_ varchar(128) DEFAULT NULL,
  DESC_ text DEFAULT NULL,
  IS_DELE_ smallint DEFAULT NULL,
  CREATE_TIME_ TIMESTAMP DEFAULT NULL,
  UPDATE_TIME_ TIMESTAMP DEFAULT NULL,
  CREATE_BY_ varchar(64) DEFAULT NULL,
  UPDATE_BY_ varchar(64) DEFAULT NULL,
  CREATE_ORG_ID_ varchar(64) DEFAULT NULL ,
  VERSION_ int DEFAULT NULL ,
  TENANT_ID_ varchar(64) DEFAULT NULL,
  PRIMARY KEY (ID_)
);
COMMENT ON COLUMN UC_HOLIDAY.ID_ IS '主键';
COMMENT ON COLUMN UC_HOLIDAY.NAME_ IS '节日名称';
COMMENT ON COLUMN UC_HOLIDAY.KEY_ IS '节日KEY';
COMMENT ON COLUMN UC_HOLIDAY.DESC_ IS '描述';
COMMENT ON COLUMN UC_HOLIDAY.IS_DELE_ IS '是否已删，1已删除，0未删除';
COMMENT ON COLUMN UC_HOLIDAY.CREATE_TIME_ IS '创建时间';
COMMENT ON COLUMN UC_HOLIDAY.UPDATE_TIME_ IS '更新时间';
COMMENT ON COLUMN UC_HOLIDAY.CREATE_BY_ IS '创建人ID';
COMMENT ON COLUMN UC_HOLIDAY.UPDATE_BY_ IS '更新人ID';
COMMENT ON COLUMN UC_HOLIDAY.CREATE_ORG_ID_ IS '创建组织ID';
COMMENT ON COLUMN UC_HOLIDAY.VERSION_ IS '版本';
COMMENT ON COLUMN UC_HOLIDAY.TENANT_ID_ IS '租户ID';

DROP TABLE IF EXISTS UC_HOLIDAY_TIME;
CREATE TABLE UC_HOLIDAY_TIME (
  ID_ varchar(64) NOT NULL,
  START_TIME_ TIMESTAMP DEFAULT NULL,
  END_TIME_ TIMESTAMP DEFAULT NULL,
  HOLIDAY_ID_ varchar(64) DEFAULT NULL,
  TENANT_ID_ varchar(64) DEFAULT NULL,
  PRIMARY KEY (ID_)
);
COMMENT ON COLUMN UC_HOLIDAY_TIME.ID_ IS '主键';
COMMENT ON COLUMN UC_HOLIDAY_TIME.START_TIME_ IS '假期开始时间';
COMMENT ON COLUMN UC_HOLIDAY_TIME.END_TIME_ IS '假期结束时间';
COMMENT ON COLUMN UC_HOLIDAY_TIME.HOLIDAY_ID_ IS '假期ID';
COMMENT ON COLUMN UC_HOLIDAY_TIME.TENANT_ID_ IS '租户ID';

INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_) VALUES ('1290200609563217920', '3441009', '排班管理', 'scheduling', '', '', 1, 8, '', '-1.1.3441009.1290200609563217920.', '', '-1');
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_) VALUES ('1290200842779103232', '1290200609563217920', '法定假期', 'holidayManager', '', '', 1, 1, '', '-1.1.3441009.1290200609563217920.1290200842779103232.', '', '-1');
INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_) VALUES ('1290565469010530304', '1290200609563217920', '轮班规则', 'shiftRuleManager', '', '', 1, 2, '', '-1.1.3441009.1290200609563217920.1290565469010530304.', '', '-1');

-- 2020-08-14 tangxin PORTAL_SYS_DATASOURCE表字段去掉默认值
alter table PORTAL_SYS_DATASOURCE alter INIT_METHOD_ drop default;
alter table PORTAL_SYS_DATASOURCE alter CLOSE_METHOD_ drop default;

-- 2020/8/15 邱喜达
DROP TABLE IF EXISTS PORTAL_SYS_TAG;
CREATE TABLE PORTAL_SYS_TAG (
  ID_ varchar(64) NOT NULL,
  TYPE_ID_ varchar(64) DEFAULT NULL ,
  KEY_ varchar(40) DEFAULT NULL ,
  NAME_ varchar(128) DEFAULT NULL ,
  SN_ int DEFAULT NULL,
  TENANT_ID_ varchar(64) DEFAULT NULL,
  PRIMARY KEY (ID_)
);
COMMENT ON COLUMN PORTAL_SYS_TAG.ID_ IS '主键';
COMMENT ON COLUMN PORTAL_SYS_TAG.TYPE_ID_ IS '分类ID';
COMMENT ON COLUMN PORTAL_SYS_TAG.KEY_ IS 'KEY';
COMMENT ON COLUMN PORTAL_SYS_TAG.NAME_ IS '名称';
COMMENT ON COLUMN PORTAL_SYS_TAG.SN_ IS '排序';
COMMENT ON COLUMN PORTAL_SYS_TAG.TENANT_ID_ IS '租户ID';

INSERT INTO PORTAL_SYS_TYPE_GROUP(ID_, GROUP_KEY_, NAME_, FLAG_, SN_, TYPE_, CREATE_BY_, CREATE_TIME_, CREATE_ORG_ID_, UPDATE_BY_, UPDATE_TIME_) VALUES ('11', 'TAG', '标签分类', '1', '9', '1', null, null, null, '1', null);

ALTER TABLE FORM_RIGHT ADD COLUMN DATA_KEY_ VARCHAR(64) DEFAULT NULL;
COMMENT ON COLUMN FORM_RIGHT.DATA_KEY_ IS '数据报表权限';

INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_,HREF_, TENANT_ID_) VALUES ('1287643583943413760', '3631013', '系统标签', 'sysTagManager', '', '', 1, 4, '', '-1.1.3441002.3631013.1287643583943413760.', '', '-1');

-- 2020-08-14 黎扬贵 表单历史记录 添加表单key 和版本号字段
ALTER TABLE FORM_HISTORY_RECORD
ADD COLUMN FORM_KEY_ varchar(255) NULL;
ADD COLUMN VERSION_ int NULL;

-- 2020-08-21 tangxin 流程bpm_task_trans表添加INQU_TYPE_字段
ALTER TABLE bpm_task_trans ADD COLUMN INQU_TYPE_ VARCHAR(20) DEFAULT NULL;

-- 2020-08-24 zhaoxiangyun 新增审批意见暂存表
CREATE TABLE "BPM_SAVE_OPINION"
(
   ID_                  VARCHAR(255)        NOT NULL,
   PROC_INST_ID_        VARCHAR(255)        NOT NULL,
   TASK_ID_             VARCHAR(255)        NOT NULL,
   OPINION_             VARCHAR(2000)       NOT NULL,
   CREATE_BY_           VARCHAR(64)         DEFAULT NULL,
   CREATE_TIME_         TIMESTAMP                 DEFAULT NULL,
   UPDATE_BY_           VARCHAR(64)         DEFAULT NULL,
   UPDATE_TIME_         TIMESTAMP                 DEFAULT NULL,
   TENANT_ID_           VARCHAR(64)         DEFAULT NULL,
   CONSTRAINT PK_BPM_SAVE_OPINION PRIMARY KEY (ID_)
);

COMMENT ON COLUMN "BPM_SAVE_OPINION".ID_ IS
'主键ID';

COMMENT ON COLUMN "BPM_SAVE_OPINION".PROC_INST_ID_ IS
'流程实例ID';

COMMENT ON COLUMN "BPM_SAVE_OPINION".TASK_ID_ IS
'任务ID';

COMMENT ON COLUMN "BPM_SAVE_OPINION".OPINION_ IS
'暂存的审批意见';

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

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

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

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

COMMENT ON COLUMN "BPM_SAVE_OPINION".TENANT_ID_ IS
'租户ID';

-- 2020-08-24 zhaoxiangyun 数据报表草稿数据表新增更新人、更新时间字段
alter table form_data_template_draft add UPDATE_BY_ varchar(64);
alter table form_data_template_draft add UPDATE_TIME_ DATE;

-- 2020-08-25 黎扬贵 修改微服务名称
UPDATE portal_sys_logs_settings SET MODULE_TYPE_ = 'eip-uc' WHERE ID_ = '1';
UPDATE portal_sys_logs_settings SET MODULE_TYPE_ = 'eip-portal' WHERE ID_ = '2';
UPDATE portal_sys_logs_settings SET MODULE_TYPE_ = 'eip-form' WHERE ID_ = '3';
UPDATE portal_sys_logs_settings SET MODULE_TYPE_ = 'eip-bpm-model' WHERE ID_ = '4';
UPDATE portal_sys_logs_settings SET MODULE_TYPE_ = 'eip-bpm-runtime' WHERE ID_ = '5';
UPDATE portal_sys_logs_settings SET MODULE_TYPE_ = 'base' WHERE ID_ = '6';

-- 2020-08-26 刘美琴 修改自定义SQL字段长度
ALTER TABLE FORM_CUSTOM_QUERY ALTER  COLUMN  DIY_SQL_  TYPE VARCHAR(4000) ;
ALTER TABLE FORM_CUSTOM_DIALOG ALTER  COLUMN  DIY_SQL_  TYPE VARCHAR(4000) ;

-- 2020-08-27 qiuxida 应用中心
DROP PORTAL_SYS_APP IF EXISTS;
CREATE TABLE PORTAL_SYS_APP (
  ID_ varchar(64) NOT NULL,
  NAME_ varchar(128) DEFAULT NULL,
  ICON_ varchar(128) DEFAULT NULL,
  ICON_COLOR_ varchar(10) DEFAULT NULL,
  TYPE_ smallint(2) DEFAULT NULL,
  PAGE_ int(10) DEFAULT NULL,
  IS_PUBLISH_ smallint(2) DEFAULT NULL,
  SN_ int(2) DEFAULT NULL,
  CONTENT_ text,
  CREATE_TIME_ datetime DEFAULT NULL,
  UPDATE_TIME_ datetime DEFAULT NULL,
  CREATE_BY_ varchar(64) DEFAULT NULL,
  UPDATE_BY_ varchar(64) DEFAULT NULL,
  TENANT_ID_ varchar(64) DEFAULT NULL,
  PRIMARY KEY (ID_)
);

COMMENT ON COLUMN PORTAL_SYS_APP.ID_ IS '主键';
COMMENT ON COLUMN PORTAL_SYS_APP.NAME_ IS '应用名称';
COMMENT ON COLUMN PORTAL_SYS_APP.ICON_ IS '图标';
COMMENT ON COLUMN PORTAL_SYS_APP.ICON_COLOR_ IS '图标颜色';
COMMENT ON COLUMN PORTAL_SYS_APP.TYPE_ IS '类型';
COMMENT ON COLUMN PORTAL_SYS_APP.PAGE_ IS '所在页';
COMMENT ON COLUMN PORTAL_SYS_APP.IS_PUBLISH_ IS '是否发布 1发布 0未发布';
COMMENT ON COLUMN PORTAL_SYS_APP.SN_ IS '顺序';
COMMENT ON COLUMN PORTAL_SYS_APP.CONTENT_ IS '内容';
COMMENT ON COLUMN PORTAL_SYS_APP.CREATE_TIME_ IS '创建时间';
COMMENT ON COLUMN PORTAL_SYS_APP.UPDATE_TIME_ IS '更新时间';
COMMENT ON COLUMN PORTAL_SYS_APP.CREATE_BY_ IS '创建人';
COMMENT ON COLUMN PORTAL_SYS_APP.UPDATE_BY_ IS '更新人';
COMMENT ON COLUMN PORTAL_SYS_APP.TENANT_ID_ IS '租户ID';

DROP PORTAL_SYS_APP_MENU IF EXISTS;
CREATE TABLE PORTAL_SYS_APP_MENU (
  ID_ varchar(64) NOT NULL,
  PARENT_ID_ varchar(64) DEFAULT NULL ,
  NAME_ varchar(128) DEFAULT NULL ,
  ALIAS_ varchar(255) DEFAULT NULL,
  TYPE_ int(2) DEFAULT NULL,
  CONTENT_ text ,
  SN_ varchar(255) DEFAULT NULL,
  APP_ID_ varchar(64) DEFAULT NULL,
  CREATE_TIME_ datetime DEFAULT NULL,
  CREATE_BY_ varchar(64) DEFAULT NULL,
  UPDATE_TIME_ datetime DEFAULT NULL,
  UPDATE_BY_ varchar(0) DEFAULT NULL,
  TENANT_ID_ varchar(64) DEFAULT NULL,
  PRIMARY KEY (ID_)
);

COMMENT ON COLUMN PORTAL_SYS_APP_MENU.ID_ IS '主键';
COMMENT ON COLUMN PORTAL_SYS_APP_MENU.PARENT_ID_ IS '父节点ID';
COMMENT ON COLUMN PORTAL_SYS_APP_MENU.NAME_ IS '菜单名称';
COMMENT ON COLUMN PORTAL_SYS_APP_MENU.ALIAS_ IS '别名';
COMMENT ON COLUMN PORTAL_SYS_APP_MENU.TYPE_ IS '类型';
COMMENT ON COLUMN PORTAL_SYS_APP_MENU.CONTENT_ IS '内容';
COMMENT ON COLUMN PORTAL_SYS_APP_MENU.SN_ IS '排序';
COMMENT ON COLUMN PORTAL_SYS_APP_MENU.APP_ID_ IS 'APPID';
COMMENT ON COLUMN PORTAL_SYS_APP_MENU.CREATE_TIME_ IS '创建时间';
COMMENT ON COLUMN PORTAL_SYS_APP_MENU.CREATE_BY_ IS '创建人';
COMMENT ON COLUMN PORTAL_SYS_APP_MENU.UPDATE_TIME_ IS '更新时间';
COMMENT ON COLUMN PORTAL_SYS_APP_MENU.UPDATE_BY_ IS '更新人';
COMMENT ON COLUMN PORTAL_SYS_APP_MENU.TENANT_ID_ IS '租户ID';

INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_) VALUES ('1296282423985836032', '3711006', '应用中心', 'appCenter', '', '', 1, 5, '', '-1.1.3441002.3711006.1296282423985836032.', '', '-1');

INSERT INTO PORTAL_SYS_COLUMN(ID, NAME, ALIAS, CATALOG, COL_TYPE, DATA_MODE, DATA_FROM, DS_ALIAS, DS_NAME, COL_HEIGHT, COL_URL, TEMPLATE_HTML, IS_PUBLIC, SUPPORT_REFESH, REFESH_TIME, SHOW_EFFECT, MEMO, DATA_PARAM, NEEDPAGE, ORG_ID, CREATOR, CREATE_BY_, UPDATE_BY_, CREATE_TIME_, UPDATE_TIME_, REQUEST_TYPE, CATALOG_NAME, CREATE_ORG_ID_, TENANT_ID_) VALUES ('1298555788968726528', '应用中心', 'yyzx', '31081', 0, 3, '${portal}/portal/sysApp/v1/listJson', '', NULL, 250, '/appCenterFront', 'PGVsLXJvdyBzdHlsZT0icGFkZGluZy10b3A6MTBweDt0ZXh0LWFsaWduOiBjZW50ZXI7Ij4KICAgIDxlbC1jb2wgCiAgICAgICAgOnNwYW49JzYnIAogICAgICAgIHN0eWxlPSJ0ZXh0LWFsaWduOiBjZW50ZXIiCiAgICAgICAgdi1mb3I9J2FwcCBpbiBkYXRhLnJvd3MnPgogICAgICAgIDxlbC1jYXJkCiAgICAgICAgICAgICAgc2hhZG93PSJob3ZlciIKICAgICAgICAgICAgICA6c3R5bGU9IntoZWlnaHQ6ICc5MHB4Jyx3aWR0aDogJzkwcHgnLGJhY2tncm91bmQ6IGFwcC5pY29uQ29sb3I/YXBwLmljb25Db2xvcjonIzEzMzlFMCcsY3Vyc29yOidwb2ludGVyJ30iCiAgICAgICAgICAgICAgOmJvZHktc3R5bGU9InsgcGFkZGluZzogJzBweCcgfSIKICAgICAgICAgICAgICBAY2xpY2submF0aXZlPSJjbGlja0FwcChhcHApIj4KICAgICAgICAgICAgPGkgc3R5bGU9ImZvbnQtc2l6ZTo4MHB4O3BhZGRpbmctdG9wOiA1cHg7Y29sb3I6ICNmZmZmZmYiIDpjbGFzcz0iYXBwLmljb24/YXBwLmljb246J2ljb24taG90ZW50LUgnIj48L2k+CiAgICAgICAgICA8L2VsLWNhcmQ+CiAgICAgICAgICA8ZGl2IHN0eWxlPSJmb250LXNpemU6IDEwcHg7dGV4dC1vdmVyZmxvdzplbGxpcHNpczt3aWR0aDogOTBweDsiPnt7YXBwLm5hbWV9fTwvZGl2PgogICAgPC9lbC1jb2w+CjwvZWwtcm93Pg==', 2, NULL, NULL, NULL, '', '[{\"name\":\"pageBean\",\"type\":\"string\",\"mode\":\"0\",\"value\":\"{\\\"page\\\":1,\\\"pageSize\\\":8,\\\"total\\\":0,\\\"showTotal\\\":false}\"},{\"name\":\"querys\",\"type\":\"string\",\"mode\":\"0\",\"value\":\"[{\\\"property\\\": \\\"is_publish_\\\", \\\"value\\\": \\\"1\\\", \\\"group\\\": \\\"main\\\", \\\"operation\\\": \\\"EQUAL\\\", \\\"relation\\\": \\\"OR\\\"}]\"},{\"name\":\"sorter\",\"type\":\"string\",\"mode\":\"0\",\"value\":\"[{\\\"direction\\\": \\\"ASC\\\",\\\"property\\\": \\\"sn_\\\"}]\"}]', 0, NULL, NULL, NULL, '1', '2020-08-26 17:40:01', '2020-08-27 10:28:40', 'POST', '默认分类', NULL, '-1');

UPDATE PORTAL_SYS_LAYOUT_MANAGE SET NAME = '应用端-系统默认布局', MEMO = '', TEMPLATE_HTML = '', DESIGN_HTML = 'eyJsaXN0IjpbeyJ0eXBlIjoiZ3JpZCIsIm5hbWUiOiLmoIXmoLzluIPlsYAiLCJpY29uIjoiaWNvbi1ncmlkIiwiY29sdW1ucyI6W3sic3BhbiI6MjQsImxpc3QiOlt7Im5hbWUiOiLkuKrkurrkv6Hmga/moI/nm64iLCJhbGlhcyI6ImdyeHhsbSIsIm9wdGlvbnMiOnsicmVtb3RlRnVuYyI6ImZ1bmNfMTU5MTE0OTIwODAwMF81NDE1MyJ9LCJrZXkiOiIxNTkxMTQ5MjA4MDAwXzU0MTUzIiwibW9kZWwiOiJ1bmRlZmluZWRfMTU5MTE0OTIwODAwMF81NDE1MyIsInJ1bGVzIjpbXX1dfV0sIm9wdGlvbnMiOnsiZ3V0dGVyIjowLCJqdXN0aWZ5Ijoic3RhcnQiLCJhbGlnbiI6InRvcCIsInJlbW90ZUZ1bmMiOiJmdW5jXzE1OTEwOTcxNTIwMDBfNjQwMzAifSwia2V5IjoiMTU5MTA5NzE1MjAwMF82NDAzMCIsIm1vZGVsIjoiZ3JpZF8xNTkxMDk3MTUyMDAwXzY0MDMwIiwicnVsZXMiOltdfSx7InR5cGUiOiJncmlkIiwibmFtZSI6IuagheagvOW4g+WxgCIsImljb24iOiJpY29uLWdyaWQiLCJjb2x1bW5zIjpbeyJzcGFuIjoxMiwibGlzdCI6W3sibmFtZSI6IuaIkeeahOW+heWKniIsImFsaWFzIjoidnVlVG9kbyIsIm9wdGlvbnMiOnsicmVtb3RlRnVuYyI6ImZ1bmNfMTU5MTE0OTIxMjAwMF84ODQ3MyJ9LCJrZXkiOiIxNTkxMTQ5MjEyMDAwXzg4NDczIiwibW9kZWwiOiJ1bmRlZmluZWRfMTU5MTE0OTIxMjAwMF84ODQ3MyIsInJ1bGVzIjpbXX1dfSx7InNwYW4iOjEyLCJsaXN0IjpbeyJuYW1lIjoi5bi455So5rWB56iLIiwiYWxpYXMiOiJ2dWVPZnRlbkZsb3ciLCJvcHRpb25zIjp7InJlbW90ZUZ1bmMiOiJmdW5jXzE1OTExNDkyMTYwMDBfNjA2OTAifSwia2V5IjoiMTU5MTE0OTIxNjAwMF82MDY5MCIsIm1vZGVsIjoidW5kZWZpbmVkXzE1OTExNDkyMTYwMDBfNjA2OTAiLCJydWxlcyI6W119XX1dLCJvcHRpb25zIjp7Imd1dHRlciI6NSwianVzdGlmeSI6InN0YXJ0IiwiYWxpZ24iOiJ0b3AiLCJyZW1vdGVGdW5jIjoiZnVuY18xNTkxMDk3MTc5MDAwXzU1NTcxIn0sImtleSI6IjE1OTEwOTcxNzkwMDBfNTU1NzEiLCJtb2RlbCI6ImdyaWRfMTU5MTA5NzE3OTAwMF81NTU3MSIsInJ1bGVzIjpbXX0seyJ0eXBlIjoiZ3JpZCIsIm5hbWUiOiLmoIXmoLzluIPlsYAiLCJpY29uIjoiaWNvbi1ncmlkIiwiY29sdW1ucyI6W3sic3BhbiI6MTIsImxpc3QiOlt7Im5hbWUiOiLmiJHnmoTor7fmsYIiLCJhbGlhcyI6InZ1ZU15cmVxdWVzdCIsIm9wdGlvbnMiOnsicmVtb3RlRnVuYyI6ImZ1bmNfMTU5MTE0OTIyMDAwMF85MDA3MyJ9LCJrZXkiOiIxNTkxMTQ5MjIwMDAwXzkwMDczIiwibW9kZWwiOiJ1bmRlZmluZWRfMTU5MTE0OTIyMDAwMF85MDA3MyIsInJ1bGVzIjpbXX1dfSx7InNwYW4iOjEyLCJsaXN0IjpbeyJuYW1lIjoi55+l6K+G5b+F6K+7IiwiYWxpYXMiOiJ2dWV6c2JkIiwib3B0aW9ucyI6eyJyZW1vdGVGdW5jIjoiZnVuY18xNTkxMTQ5MjI0MDAwXzUzOTIifSwia2V5IjoiMTU5MTE0OTIyNDAwMF81MzkyIiwibW9kZWwiOiJ1bmRlZmluZWRfMTU5MTE0OTIyNDAwMF81MzkyIiwicnVsZXMiOltdfV19XSwib3B0aW9ucyI6eyJndXR0ZXIiOjUsImp1c3RpZnkiOiJzdGFydCIsImFsaWduIjoidG9wIiwicmVtb3RlRnVuYyI6ImZ1bmNfMTU5MTA5NzIwNDAwMF8xNzc4MiJ9LCJrZXkiOiIxNTkxMDk3MjA0MDAwXzE3NzgyIiwibW9kZWwiOiJncmlkXzE1OTEwOTcyMDQwMDBfMTc3ODIiLCJydWxlcyI6W119LHsidHlwZSI6ImdyaWQiLCJuYW1lIjoi5qCF5qC85biD5bGAIiwiaWNvbiI6Imljb24tZ3JpZCIsImNvbHVtbnMiOlt7InNwYW4iOjEyLCJsaXN0IjpbeyJuYW1lIjoi5Lu75Yqh6Z2i5p2/IiwiYWxpYXMiOiJyd21idnVlIiwib3B0aW9ucyI6eyJyZW1vdGVGdW5jIjoiZnVuY18xNTkxMTQ5MjI5MDAwXzEyMTAxIn0sImtleSI6IjE1OTExNDkyMjkwMDBfMTIxMDEiLCJtb2RlbCI6InVuZGVmaW5lZF8xNTkxMTQ5MjI5MDAwXzEyMTAxIiwicnVsZXMiOltdfV19LHsic3BhbiI6NiwibGlzdCI6W3sibmFtZSI6IuW6lOeUqOS4reW/gyIsImFsaWFzIjoieXl6eCIsIm9wdGlvbnMiOnsicmVtb3RlRnVuYyI6ImZ1bmNfMTU5ODQzNTE0ODAwMF81Mzg1NyJ9LCJrZXkiOiIxNTk4NDM1MTQ4MDAwXzUzODU3IiwibW9kZWwiOiJ1bmRlZmluZWRfMTU5ODQzNTE0ODAwMF81Mzg1NyIsInJ1bGVzIjpbXX1dfSx7InNwYW4iOjYsImxpc3QiOlt7Im5hbWUiOiLmnIDmlrDpobnnm64iLCJhbGlhcyI6Inp4eG12dWUiLCJvcHRpb25zIjp7InJlbW90ZUZ1bmMiOiJmdW5jXzE1OTg0MzUxNTMwMDBfNTI2NTkifSwia2V5IjoiMTU5ODQzNTE1MzAwMF81MjY1OSIsIm1vZGVsIjoidW5kZWZpbmVkXzE1OTg0MzUxNTMwMDBfNTI2NTkiLCJydWxlcyI6W119XX1dLCJvcHRpb25zIjp7Imd1dHRlciI6NSwianVzdGlmeSI6InN0YXJ0IiwiYWxpZ24iOiJ0b3AiLCJyZW1vdGVGdW5jIjoiZnVuY18xNTkxMDk3MjIzMDAwXzgzMjM0In0sImtleSI6IjE1OTEwOTcyMjMwMDBfODMyMzQiLCJtb2RlbCI6ImdyaWRfMTU5MTA5NzIyMzAwMF84MzIzNCIsInJ1bGVzIjpbXX0seyJ0eXBlIjoiZ3JpZCIsIm5hbWUiOiLmoIXmoLzluIPlsYAiLCJpY29uIjoiaWNvbi1ncmlkIiwiY29sdW1ucyI6W3sic3BhbiI6MjQsImxpc3QiOlt7Im5hbWUiOiLlhbPkuo7miJHku6wiLCJhbGlhcyI6Imd5d212dWUiLCJvcHRpb25zIjp7InJlbW90ZUZ1bmMiOiJmdW5jXzE1OTExNDkyMzcwMDBfMjQ5NDUifSwia2V5IjoiMTU5MTE0OTIzNzAwMF8yNDk0NSIsIm1vZGVsIjoidW5kZWZpbmVkXzE1OTExNDkyMzcwMDBfMjQ5NDUiLCJydWxlcyI6W119XX1dLCJvcHRpb25zIjp7Imd1dHRlciI6MCwianVzdGlmeSI6InN0YXJ0IiwiYWxpZ24iOiJ0b3AiLCJyZW1vdGVGdW5jIjoiZnVuY18xNTkxMDk3MjQzMDAwXzgzMTY3In0sImtleSI6IjE1OTEwOTcyNDMwMDBfODMxNjciLCJtb2RlbCI6ImdyaWRfMTU5MTA5NzI0MzAwMF84MzE2NyIsInJ1bGVzIjpbXX1dLCJjb25maWciOnsibGFiZWxXaWR0aCI6MTAwLCJsYWJlbFBvc2l0aW9uIjoicmlnaHQiLCJzaXplIjoic21hbGwifX0=', IS_DEF = 1, LAYOUT_TYPE = 2, ORG_ID = '', ORG_NAME = NULL, ENABLE = 1, SHARE_TO_SUB = 0, TENANT_ID_ = '-1' WHERE ID = '2';

INSERT INTO PORTAL_SYS_AUTH_USER(ID_, AUTHORIZE_ID_, OWNER_ID_, OWNER_NAME_, RIGHT_TYPE_, OBJ_TYPE_, TENANT_ID_) VALUES ('1298555789090361344', '1298555788968726528', NULL, NULL, 'everyone', 'indexColumn', '-1');

INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_) VALUES ('1300728049968484352', '3', '应用中心', 'appCenterFront', '', '', NULL, 4, '', '-1.3.1300728049968484352.', '', '-1');

-- lingpj 默认角色的菜单授权
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163664288452608', 'xtgly', 'bpm_platform', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163664317812736', 'xtgly', 'manage_menu', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163665894871040', 'xtgly', 'orgManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163665915842560', 'xtgly', 'jobManage', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163665932619776', 'xtgly', 'postManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163665953591296', 'xtgly', 'prgParamManage', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163665974562816', 'xtgly', 'ucManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163665995534336', 'xtgly', 'userListManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666016505856', 'xtgly', 'userParamManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666033283072', 'xtgly', 'loginLogManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666050060288', 'xtgly', 'roleMatrixManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666071031808', 'xtgly', 'matrixManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666092003328', 'xtgly', 'roleManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666117169152', 'xtgly', 'reportLine', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666138140672', 'xtgly', 'pwdStrategy', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666154917888', 'xtgly', 'heiOrganization', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666171695104', 'xtgly', 'scheduling', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666196860928', 'xtgly', 'holidayManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666217832448', 'xtgly', 'shiftRuleManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666230415360', 'xtgly', 'tenant', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666251386880', 'xtgly', 'tenantTypeManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666276552704', 'xtgly', 'tenantManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666289135616', 'xtgly', 'tenantParamsManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666310107136', 'xtgly', 'front_menu', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666326884352', 'xtgly', 'v-flow', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666343661568', 'xtgly', 'v-leader', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666364633088', 'xtgly', 'v-todo', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666385604608', 'xtgly', 'v-done', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666402381824', 'xtgly', 'v-request', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666419159040', 'xtgly', 'v-flowList', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666435936256', 'xtgly', 'v-todoRead', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666452713472', 'xtgly', 'v-doneRead', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666473684992', 'xtgly', 'v-myRead', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666486267904', 'xtgly', 'v-myDelegate', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666507239424', 'xtgly', 'v-mail', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666524016640', 'xtgly', 'v-mailList', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666549182464', 'xtgly', 'v-linkmanList', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666565959680', 'xtgly', 'v-settingList', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666582736896', 'xtgly', 'v-personal', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666599514112', 'xtgly', 'v-agent', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666616291328', 'xtgly', 'v-approvalItem', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163666637262848', 'xtgly', 'v-secretary', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705140973568', 'rsgly', 'bpm_platform', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705157750784', 'rsgly', 'manage_menu', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705174528000', 'rsgly', 'orgStructure', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705199693824', 'rsgly', 'organization', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705220665344', 'rsgly', 'demension', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705241636864', 'rsgly', 'orgManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705266802688', 'rsgly', 'jobManage', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705287774208', 'rsgly', 'postManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705312940032', 'rsgly', 'prgParamManage', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705338105856', 'rsgly', 'ucManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705367465984', 'rsgly', 'userListManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705392631808', 'rsgly', 'userParamManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705413603328', 'rsgly', 'loginLogManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705430380544', 'rsgly', 'roleMatrixManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705447157760', 'rsgly', 'matrixManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705472323584', 'rsgly', 'roleManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705501683712', 'rsgly', 'reportLine', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705518460928', 'rsgly', 'pwdStrategy', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705543626752', 'rsgly', 'heiOrganization', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705568792576', 'rsgly', 'scheduling', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705589764096', 'rsgly', 'holidayManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705606541312', 'rsgly', 'shiftRuleManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705623318528', 'rsgly', 'tenant', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705644290048', 'rsgly', 'tenantTypeManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705669455872', 'rsgly', 'tenantManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163705690427392', 'rsgly', 'tenantParamsManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163775647223808', 'lcgly', 'bpm_platform', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1299163775689166848', 'lcgly', 'designCenter', NULL, NULL, '-1');

-- 2020-09-03 zhaoxiangyun 租户管理表新增应用端租户名称字段
alter table UC_TENANT_MANAGE add NAME_FRONT_ varchar(128);

-- 2020-9-8 流程水印 qiuxd
DROP TABLE IF EXISTS bpm_watermark;
CREATE TABLE bpm_watermark (
  ID_ varchar(64) NOT NULL,
  NAME_ varchar(128) DEFAULT NULL,
  CONTENT_ text ,
  TYPE_ int DEFAULT NULL,
  COLOR_ varchar(32) DEFAULT NULL,
  AMOUNT_ int DEFAULT NULL,
  CREATE_TIME_ timestamp DEFAULT NULL,
  CREATE_BY_ varchar(64) DEFAULT NULL,
  UPDATE_TIME_ timestamp DEFAULT NULL,
  UPDATE_BY_ varchar(64) DEFAULT NULL,
  CREATE_ORG_ID_ varchar(64) DEFAULT NULL,
  TENANT_ID_ varchar(64) DEFAULT NULL,
  PRIMARY KEY (ID_)
);

DROP TABLE IF EXISTS bpm_watermark_type;
CREATE TABLE bpm_watermark_type (
  ID_ varchar(64) NOT NULL,
  TYPE_ID_ varchar(64) DEFAULT NULL,
  WATERMARK_ID_ varchar(64) DEFAULT NULL,
  TYPE_NAME_ varchar(256) DEFAULT NULL,
  TENANT_ID_ varchar(64) DEFAULT NULL,
  PRIMARY KEY (ID_)
);

INSERT INTO PORTAL_SYS_MENU(ID_, PARENT_ID_, NAME_, ALIAS_, ACTIVE_TAB_, MENU_ICON_, OPENED_, SN_, TABS_STYLE_, PATH_, HREF_, TENANT_ID_) VALUES ('1303147346326065152', '3761202', '流程水印', 'watermarkManager', '', '', NULL, 5, '', '-1.1.3641025.3761202.1303147346326065152.', '', '-1');
-- 2020-09-09 lingpj 流程水印菜单授权
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1303524385981861888', 'xtgly', 'watermarkManager', NULL, NULL, '-1');
INSERT INTO PORTAL_SYS_ROLE_AUTH(ID_, ROLE_ALIAS_, MENU_ALIAS_, METHOD_ALIAS_, DATA_PERMISSION_, TENANT_ID_) VALUES ('1303524446065266688', 'lcgly', 'watermarkManager', NULL, NULL, '-1');
-- 2020-09-10 李洪桥 移动端获取数据台信息调用getDefaultInfoMap接口（迁移海雅分支#58277）
UPDATE PORTAL_SYS_COLUMN SET DATA_FROM='${bpmRunTime}/runtime/instance/v1/getDefaultInfoMap' where ID = '1267991710768697344';

-- 2020-09-09 qiuxd 催办历史添加taskID
ALTER TABLE BPM_REMINDER_HISTORY ADD TASK_ID_ VARCHAR(64) NOT NULL;

-- 2020-09-10 赵祥云 人员脚本 获取上一节点执行人的部门负责人新增一个参数（传维度id或编码都可以）
DELETE FROM BPM_MULTI_SCRIPT WHERE ID_='11';
INSERT INTO BPM_MULTI_SCRIPT(ID_, ALIAS_NAME_, ALIAS_DESC_, CLASS_NAME_, CLASS_INS_NAME_, METHOD_NAME_, METHOD_DESC_, RETURN_TYPE_, ARGUMENT_, ENABLE_, TYPE_, TENANT_ID_) VALUES ('11', NULL, NULL, 'com.hotent.runtime.script.UserRelScript', 'userRelScript', 'getChargesByPreNode', '获取上一节点执行人的部门负责人', 'java.util.Set', '[{\"paraName\":\"arg0\",\"paraType\":\"java.lang.Boolean\",\"paraDesc\":\"是否主负责人\",\"paraCt\":\"\"},{\"paraName\":\"arg1\",\"paraType\":\"java.lang.String\",\"paraDesc\":\"传维度id或编码都可以          \"}]', '1', '2', '-1');