/*
 change.sql 说明
 1.数据库相关修改添加到对应的 change.sql 文件，无需调整其他 sql  文件
 2.sql 语句验证正确后再提交
*/
-- jjx 内部消息地址修改

-- yjj 2022-04-19 增加表单列表数据导入日志记录表
CREATE TABLE `form_data_template_import_log`  (
`ID_` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '主键',
`IMPORT_ACCOUNT_` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '导入人账号',
`IMPORT_NAME_` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '导入人名称',
`IMPORT_TIME_` datetime(0) NULL DEFAULT NULL COMMENT '导入时间',
`STATUS_` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '导入状态 1-导入成功 0-导入失败',
`TENANT_ID_` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户id',
`TEMP_ALIAS_` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '导入表单列表别名',
`REASON_` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '表单列表导入日志记录' ROW_FORMAT = DYNAMIC;

-- 2022-04-24 yijj 增加关联表sql字段
ALTER TABLE `form_data_template`
ADD COLUMN `JOIN_TABLES_SQL_` longtext NULL COMMENT '关联表SQL' AFTER `JOIN_TABLES_`;


-- 黎扬贵 2022-04-28 删除索引 该字段值都是null 并且业务上没有使用到改字段作为查询
ALTER TABLE `act_ru_execution`
DROP INDEX `ACT_IDX_EXEC_BUSKEY`;
-- 黎扬贵 2022-05-7 新增任务表索引
ALTER TABLE `bpm_task`
    ADD INDEX `IDX_BPM_TASK_OWNERID`(`OWNER_ID_`),
ADD INDEX `IDX_BPM_TASK_ASSIGNEEID`(`ASSIGNEE_ID_`);

-- 黎扬贵 2022-05-7 新增任务候选人表索引
ALTER TABLE `bpm_task_candidate`
    ADD INDEX `IDX_TASKCANDIDATE_EXECUTOR`(`EXECUTOR_`),
ADD INDEX `IDX_TASKCANDIDATE_TYPE`(`TYPE_`);

-- 欧阳高龙 2022-05-09 组织与外部通讯录关系表
CREATE TABLE `UC_ORG_UNITE` (
  `ID_` varchar(64) NOT NULL COMMENT '主键',
  `ORG_ID_` varchar(64) DEFAULT NULL COMMENT '平台组织id',
  `WX_WORK_ID_` varchar(100) DEFAULT NULL COMMENT '企业微信组织id',
  `DINGTALK_ID_` varchar(100) DEFAULT NULL COMMENT '阿里钉钉组织id',
  `FLYBOOK_ID_` varchar(100) DEFAULT NULL COMMENT '飞书组织id',
  `DELETE_FLAG_` tinyint DEFAULT 0  NOT NULL COMMENT '是否删除',
  `UPDATE_TIME_` datetime COMMENT '更新时间',
  `CREATE_TIME_` datetime COMMENT '创建时间',
  `TENANT_ID_` varchar(64) DEFAULT NULL COMMENT '租户ID',
	PRIMARY KEY (`ID_`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT = '组织与外部通讯录关系表';

-- 欧阳高龙 2022-05-09 增加外部通讯录同步使用到的配置信息
ALTER TABLE UC_USER_UNITE ADD COLUMN `FLYBOOK_ID_` varchar(100) DEFAULT NULL COMMENT '飞书用户ID';
ALTER TABLE PORTAL_SYS_EXTERNAL_UNITE ADD COLUMN `SYNC_FLAG_` tinyint DEFAULT 0 NOT NULL COMMENT '是否同步组织架构';
ALTER TABLE PORTAL_SYS_EXTERNAL_UNITE ADD COLUMN `SYNC_SCOPE_` SMALLINT DEFAULT 0 NOT NULL COMMENT '同步范围，0-全部；1-仅用户；2-部分';
ALTER TABLE PORTAL_SYS_EXTERNAL_UNITE ADD COLUMN `SYNC_ORG_ID_` varchar(64) DEFAULT NULL COMMENT '同步的组织的ID';
ALTER TABLE PORTAL_SYS_EXTERNAL_UNITE ADD COLUMN `SYNC_ORG_` varchar(64) DEFAULT NULL COMMENT '同步组织';
ALTER TABLE PORTAL_SYS_EXTERNAL_UNITE ADD COLUMN `SYNC_DIRECTION_` SMALLINT DEFAULT 0 NOT NULL COMMENT '同步方式，拉取或上传';
ALTER TABLE PORTAL_SYS_EXTERNAL_UNITE ADD COLUMN `AUTO_SYNC_` SMALLINT DEFAULT 0 NOT NULL COMMENT '同步方法，是否自动同步';
ALTER TABLE PORTAL_SYS_EXTERNAL_UNITE ADD COLUMN `SYNC_FREQUENCY_` SMALLINT DEFAULT 0 NOT NULL COMMENT '同步频率，0-每周；1-每月；2-每小时';
ALTER TABLE PORTAL_SYS_EXTERNAL_UNITE ADD COLUMN `SYNC_STARTING_TIME` datetime COMMENT '同步起始时间';
ALTER TABLE PORTAL_SYS_EXTERNAL_UNITE ADD COLUMN `AGENT_NAME_` varchar(64) DEFAULT NULL COMMENT '应用名称';
ALTER TABLE PORTAL_SYS_EXTERNAL_UNITE ADD COLUMN `ALIAS_` varchar(64) DEFAULT NULL COMMENT '应用别名';




-- 2022-04-24 yijj 增加角色授权菜单设置为是否本级及下级
ALTER TABLE `portal_sys_role_auth`
ADD COLUMN `IS_OPEN_` int NULL COMMENT '否本级及下级，1-是本级及下级，0-不是本级及下级' AFTER `TENANT_ID_`;

-- 2022-7-25 liangjc portal_sys_column 增加长度
alter table portal_sys_column   modify DATA_PARAM varchar(4000) null;


-- 2022-7-22 liangjc修改栏目类型的类型 增加js脚本字段
ALTER TABLE portal_sys_column MODIFY COL_TYPE varchar(50);
ALTER TABLE portal_sys_column ADD TEMPLATE_JAVA_SCRIPT_ text default null COMMENT '栏目js脚本';

-- 2022-07-22 liangjc迁移 个人待办事项表（三门核电）
CREATE TABLE PORTAL_CUSTOM_TODO (
  ID_ varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '主键',
  USER_ID_ varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户id',
  TASK_NAME_ varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '任务事项',
  MARK_ varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '标记',
  STATUS_ varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '状态。0:未完成，1：已完成',
  REMARK_ varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '备注',
  IS_REPEAT_ varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '是否重复任务。0:否，1:是',
  REPEAT_RATE_ int COMMENT '重复频率',
  REPEAT_TYPE_ varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '重复类型：1:年。2:月，3:日，4:小时，5:分钟',
  REPEAT_START_TIME_ timestamp(0) COMMENT '重复任务开始时间',
  CREATE_TIME_ timestamp(0) COMMENT '创建时间',
  COMPLETE_TIME_ timestamp(0) COMMENT '完成时间',
  DEAD_LINE_ timestamp(0) COMMENT '截止时间',
  UPDATE_TIME_ timestamp(0) COMMENT '更新时间',
  SN_ int COMMENT '排序号',
  PRIMARY KEY (`ID_`) USING BTREE
)ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;


-- 2022-7-25 liangjc portal_sys_column 增加长度
ALTER TABLE portal_sys_column MODIFY DATA_PARAM VARCHAR(4000);

-- 2022-7-26 liangjc 拉取公众号永久素材
INSERT INTO qrtz_job_details(SCHED_NAME, JOB_NAME, JOB_GROUP, DESCRIPTION, JOB_CLASS_NAME, IS_DURABLE, IS_NONCONCURRENT, IS_UPDATE_DATA, REQUESTS_RECOVERY, JOB_DATA) VALUES ('quartzScheduler', '获取微信公众号素材列表', '-1', '获取微信公众号素材列表', 'com.hotent.column.job.PullWeixinMaterialJob', '1', '1', '0', '0', 0xACED0005737200156F72672E71756172747A2E4A6F62446174614D61709FB083E8BFA9B0CB020000787200266F72672E71756172747A2E7574696C732E537472696E674B65794469727479466C61674D61708208E8C3FBC55D280200015A0013616C6C6F77735472616E7369656E74446174617872001D6F72672E71756172747A2E7574696C732E4469727479466C61674D617013E62EAD28760ACE0200025A000564697274794C00036D617074000F4C6A6176612F7574696C2F4D61703B787000737200116A6176612E7574696C2E486173684D61700507DAC1C31660D103000246000A6C6F6164466163746F724900097468726573686F6C6478703F40000000000010770800000010000000007800);

-- 2022-7-28 heyf 在bpm_task_signdata的inst_id_列上添加索引解决轻峰死锁问题
ALTER TABLE `bpm_task_signdata` ADD INDEX `IDX_TASK_SIGNDATA_INST_ID_`(`INST_ID_`) USING BTREE;

-- 2022-7-29 liangjc portal_sys_column 增加长度
ALTER TABLE portal_sys_column MODIFY DATA_PARAM text;

-- 2022-8-1 liangjc portal_sys_layout_manage 增加栏目间隔
ALTER TABLE portal_sys_layout_manage ADD GUTTER_ int default null COMMENT '栏目间隔';


-- 2022-8-4 xiejun uc_user 增加双因素验证密钥
alter table uc_user add TWO_VERIFY_SECRET_ varchar(50) null comment '双因素验证绑定密钥';

DROP TABLE IF EXISTS UC_ONE_TIME_CODE;
CREATE TABLE UC_ONE_TIME_CODE(
    ID_ VARCHAR(64) NOT NULL   COMMENT '主键' ,
    CODE_ VARCHAR(50) NOT NULL   COMMENT '一次性验证码' ,
    USER_ID_ VARCHAR(64) NOT NULL   COMMENT '所属用户ID' ,
    IS_USED_ TINYINT(1)   DEFAULT 0 COMMENT '是否已使用;0:未使用 1:已使用' ,
  TENANT_ID_ VARCHAR(64) COMMENT '租户id' ,
    CREATE_TIME_ DATETIME NOT NULL   COMMENT '创建时间' ,
    CREATOR_ VARCHAR(32) NOT NULL   COMMENT '创建人' ,
    CREATE_BY_ VARCHAR(64) NOT NULL   COMMENT '创建人ID' ,
    IS_DELE_ TINYINT(1) NOT NULL  DEFAULT 0 COMMENT '是否删除;0否 1是' ,
    PRIMARY KEY (ID_)
)  COMMENT = '双因素验证一次性码表';

-- 2022-8-19 liangjc portal_user_layout_config 增加创建时间字段
alter table portal_user_layout_config add CREATE_TIME_ datetime comment '创建时间';

-- 2022-8-26 jjx 增加双因子认证系统属性默认配置
INSERT INTO `portal_sys_properties`(`ID`, `NAME`, `ALIAS`, `GROUP_`, `VALUE`, `ENCRYPT`, `DESCRIPTION`, `UPDATE_TIME_`, `CREATE_BY_`, `CREATE_TIME_`, `CREATE_ORG_ID_`, `UPDATE_BY_`, `TENANT_ID_`) VALUES ('8', '双因素认证', 'twoVerifyConf', NULL, 'false', 0, '双因子验证系统配置', '2022-08-26 10:44:06', '1', '2022-08-26 10:30:46', '', '1', NULL);

-- 2022-08-26 月活跃限制
CREATE TABLE `bpm_bloom`  (
  `ID_` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '主键',
  `BLOOM_BYTES_` longblob NULL COMMENT '布隆过滤器的数据',
  `CODE_` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '编码，做唯一记录识别',
  PRIMARY KEY (`ID_`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '布隆过滤器数据表' ROW_FORMAT = DYNAMIC;

-- 2022-08-29 yijj  BO定义表增加后端校验json字段
ALTER TABLE `form_bo_def`
ADD COLUMN `VERIFY_JSON_` text NULL COMMENT '后端接口校验json' AFTER `TENANT_ID_`;

-- 2022-8-30 liangjc 删除模板管理菜单
delete from portal_sys_menu where ALIAS_='formTemplateList';

-- 2022-8-30 liangjc 增加元件管理关联查询 对话框 流水号 分类 ，默认分类初始化
INSERT INTO portal_sys_type_group VALUES ('16', 'Query_TYPE', '元件关联查询', 1, 16, 1, NULL, NULL, NULL, '1', NULL);
INSERT INTO portal_sys_type_group VALUES ('17', 'DIALOG_TYPE', '元件对话框', 1, 17, 1, NULL, NULL, NULL, '1', NULL);
INSERT INTO portal_sys_type_group VALUES ('18', 'IDENTITY_MANAGER_TYPE', '元件流水号', 1, 18, 1, NULL, NULL, NULL, '1', NULL);
INSERT INTO portal_sys_type(ID_, TYPE_GROUP_KEY_, NAME_, TYPE_KEY_, STRU_TYPE_, PARENT_ID_, DEPTH_, PATH_, IS_LEAF_, OWNER_ID_, SN_, CREATE_BY_, CREATE_TIME_, CREATE_ORG_ID_, UPDATE_BY_, UPDATE_TIME_, ICON_, TENANT_ID_) VALUES ('16100', 'Query_TYPE', '默认分类', 'default', '1', '16', 1, '16.16100.', 'Y', '0', 0, '1', NULL, NULL, NULL, NULL, NULL, '-1');
INSERT INTO portal_sys_type(ID_, TYPE_GROUP_KEY_, NAME_, TYPE_KEY_, STRU_TYPE_, PARENT_ID_, DEPTH_, PATH_, IS_LEAF_, OWNER_ID_, SN_, CREATE_BY_, CREATE_TIME_, CREATE_ORG_ID_, UPDATE_BY_, UPDATE_TIME_, ICON_, TENANT_ID_) VALUES ('17100', 'DIALOG_TYPE', '默认分类', 'default', '1', '17', 1, '17.17100.', 'Y', '0', 0, '1', NULL, NULL, NULL, NULL, NULL, '-1');
INSERT INTO portal_sys_type(ID_, TYPE_GROUP_KEY_, NAME_, TYPE_KEY_, STRU_TYPE_, PARENT_ID_, DEPTH_, PATH_, IS_LEAF_, OWNER_ID_, SN_, CREATE_BY_, CREATE_TIME_, CREATE_ORG_ID_, UPDATE_BY_, UPDATE_TIME_, ICON_, TENANT_ID_) VALUES ('18100', 'IDENTITY_MANAGER_TYPE', '默认分类', 'default', '1', '18', 1, '18.18100.', 'Y', '0', 0, '1', NULL, NULL, NULL, NULL, NULL, '-1');

-- 2022-8-31 liangjc 增加元件管理关联查询 对话框 流水号 分类字段
ALTER TABLE form_custom_query ADD TYPE_ID_ varchar(64)  COMMENT '分类id';
ALTER TABLE form_custom_query ADD TYPE_NAME_ varchar(64)  COMMENT '分类名称';
ALTER TABLE form_custom_dialog ADD TYPE_ID_ varchar(64)  COMMENT '分类id';
ALTER TABLE form_custom_dialog ADD TYPE_NAME_ varchar(64)  COMMENT '分类名称';
ALTER TABLE portal_sys_identity ADD TYPE_ID_ varchar(64)  COMMENT '分类id';
ALTER TABLE portal_sys_identity ADD TYPE_NAME_ varchar(64)  COMMENT '分类名称';

-- 2022-8-31 liangjc form_url_form增加所属系统编码字段
ALTER TABLE form_url_form ADD SYS_CODE_ varchar(50)  COMMENT '所属系统编码';

-- 2022-8-31 liangjc form_url_form系统编码字段修复
update form_url_form t1,portal_biz_system t2 set t1.SYS_CODE_ = t2.SYS_CODE_ where t1.SYS_ID_=t2.ID_ and t1.SYS_CODE_ is null;

-- 2022-9-1 jjx 添加应用端安全设置页面--执行后需要手动在菜单管理中执行下更新动作
INSERT INTO `portal_sys_menu`(`ID_`, `PARENT_ID_`, `NAME_`, `ALIAS_`, `ACTIVE_TAB_`, `MENU_ICON_`, `OPENED_`, `SN_`, `TABS_STYLE_`, `PATH_`, `HREF_`, `TENANT_ID_`, `ROUTE_EXTEND_`, `TYPE_`) VALUES ('1564899937980067840', '1441341228585766912', '安全设置', 'security', '', '', NULL, 4, '', '-1.3.1441341228585766912.1564899937980067840.', '', '-1', '{\"path\":\"security\",\"component\":\"@/views/personal/security\",\"redirect\":\"\",\"alwaysShow\":false,\"caseSensitive\":false,\"meta\":{\"title\":\"安全设置\",\"isChildren\":true}}', 'page');

-- 2022-9-1 liangjc邮件增加smtpHost，sendPort字段
ALTER TABLE uc_tenant_mail_server ADD SMTP_HOST_ varchar(128)  COMMENT 'smt主机';
ALTER TABLE uc_tenant_mail_server ADD SEND_PORT_ varchar(20)  COMMENT '邮件服务器的端口';

-- 2022-9-2 yijj  菜单增加是否刷新字段和国际化temp字段
ALTER TABLE `portal_sys_menu`
ADD COLUMN `IS_REFRESH_` int(0) NULL COMMENT '是否刷新，默认刷新， 1刷新0不刷新' AFTER `TYPE_`;

-- 2022-9-2  yijj 设置我的任务和流程启动默认不刷新
UPDATE portal_sys_menu SET IS_REFRESH_ = '0' WHERE ALIAS_ in ('myTask','startProcess');

-- 欧阳高龙 2022-09-02 租户域名
ALTER TABLE `uc_tenant_manage`
ADD COLUMN `BASE_URL_` varchar(128) DEFAULT NULL COMMENT '租户域名';

-- 2022-9-5 liangjc表单模板增加汇总区域字段
ALTER TABLE form_data_template ADD COLUMN SUMMARY_REGION_HTML_ LONGTEXT NULL COMMENT '汇总区域' ;

-- 2022-09-19 yijj 修改菜单别名
UPDATE portal_sys_menu SET ALIAS_ = 'Index' WHERE ID_ ='1441359958220918784';
UPDATE portal_sys_menu SET ALIAS_ = 'NewMatter' WHERE ID_ ='1441342209381814272';
UPDATE portal_sys_menu SET ALIAS_ = 'MyTask' WHERE ID_ ='1441342471236407296';
UPDATE portal_sys_menu SET ALIAS_ = 'Request' WHERE ID_ ='1441342583597617152';
UPDATE portal_sys_menu SET ALIAS_ = 'CirculateMatter' WHERE ID_ ='1443153816786980864';
UPDATE portal_sys_menu SET ALIAS_ = 'Setting' WHERE ID_ ='1441938397294415872';
UPDATE portal_sys_menu SET ALIAS_ = 'Message' WHERE ID_ ='1494487013470261248';
UPDATE portal_sys_menu SET ALIAS_ = 'EmailCenter' WHERE ID_ ='1441938698676129792';
UPDATE portal_sys_menu SET ALIAS_ = 'AppCenter' WHERE ID_ ='1441941148611039232';

-- 2022-9-23 liangjc 表单设计、用户管理、组织管理 tab标签样式与其他模块保持一致
update portal_sys_menu set TABS_STYLE_='' where ID_ in  ('3391046','3441027','3441023');

-- 2022-09-30 增加催办消息模板
INSERT INTO PORTAL_SYS_MSG_TPL (ID_,NAME_,KEY_,TYPE_KEY_,IS_DEFAULT_,SUBJECT_,PLAIN_,HTML_,CREATE_BY_,CREATE_TIME_,CREATE_ORG_ID_,UPDATE_BY_,UPDATE_TIME_,SMS_TEMPLATE_NO_,VOICE_TEMPLATE_NO_,TENANT_ID_)
VALUES('22','催办模板',	'promoter-default',	'promoter',	1,'催办提醒','${taskSubject}','<p><a href="${baseUrl}/${frontBaseUrl}/matter/approvalForm?taskId=${taskId}&instId=${instId}&isGetApprovalBtn=true">${taskSubject}</a></p>',	NULL,NULL,NULL,	NULL,NULL,NULL,NULL,'-1');

-- 2022-10-8 liangjc 数据视图 增加汇总区域字段
ALTER TABLE form_query_view ADD COLUMN SUMMARY_REGION_HTML_ LONGTEXT NULL COMMENT '汇总区域' ;

-- 2022-10-9 jjx  修改人员脚本内提示信息
UPDATE bpm_multi_script SET  ARGUMENT_ = '[{\"paraName\":\"arg0\",\"paraType\":\"java.lang.String\",\"paraDesc\":\"组织别名\",\"paraCt\":\"base:org-selector\",\"paraCtBindKey\":\"code\"},{\"paraName\":\"arg1\",\"paraType\":\"java.lang.String\",\"paraDesc\":\"角色别名\",\"paraCt\":\"base:role-selector\",\"paraCtBindKey\":\"code\"}]' WHERE ID_ = '1338367741324824576';
UPDATE bpm_multi_script SET ARGUMENT_ = '[{\"paraName\":\"arg1\",\"paraType\":\"java.lang.String\",\"paraDesc\":\"汇报线类型编码\",\"paraCt\":\"\",\"paraCtBindName\":\"ID_\",\"paraCtBindKey\":\"\",\"multiSelect\":false}]' WHERE ID_ = '12';
UPDATE bpm_multi_script SET  ARGUMENT_ = '[{\"paraName\":\"arg1\",\"paraType\":\"java.lang.String\",\"paraDesc\":\"汇报线类型编码\",\"paraCt\":\"\",\"paraCtBindName\":\"ID_\",\"paraCtBindKey\":\"\",\"multiSelect\":false}]' WHERE ID_ = '13';
UPDATE bpm_multi_script SET METHOD_DESC_ = '获取逐级审批(获取主负责人)' WHERE ID_ = '1338375124944031744';
UPDATE bpm_multi_script SET METHOD_DESC_ = 'sql查询用户ID(固定值SQL要用\" \"包裹)' WHERE ID_ = '1338379764150439936';
delete from bpm_multi_script where ID_ = "1338384186821709824";
UPDATE bpm_multi_script SET METHOD_DESC_ = '获取上一节点用户的上级部门（主）的负责人' WHERE ID_ = '16';
UPDATE bpm_multi_script SET METHOD_DESC_ = '获取上一点节用户所在部门的（主）负责人'  WHERE ID_ = '18';
UPDATE bpm_multi_script SET METHOD_DESC_ = '通过下属管理获取上一节点用户的上级' WHERE ID_ = '22';
UPDATE bpm_multi_script SET  ARGUMENT_ = '[{\"paraName\":\"arg0\",\"paraType\":\"java.lang.Boolean\",\"paraDesc\":\"是否主负责人(值为true或false)\",\"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\":\"是否主负责人(值为true或false)\",\"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\":\"是否主负责人(值为true或false)\",\"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\":\"是否主负责人(值为true或false)\",\"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},{\"paraName\":\"arg1\",\"paraType\":\"java.lang.Boolean\",\"paraDesc\":\"是否主负责人(值为true或false)\",\"paraCt\":null,\"paraCtBindName\":\"\",\"paraCtBindKey\":null,\"multiSelect\":false,\"$$hashKey\":\"object:2506\"}]' WHERE ID_ = '9';
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\":\"是否主负责人(值为true或false)\",\"paraCt\":null,\"paraCtBindName\":\"\",\"paraCtBindKey\":null,\"multiSelect\":false,\"$$hashKey\":\"object:3068\"}]' WHERE ID_ = '10';
UPDATE bpm_multi_script SET  ARGUMENT_ = '[{\"paraName\":\"arg0\",\"paraType\":\"java.lang.Boolean\",\"paraDesc\":\"是否主负责人(值为true或false)\",\"paraCt\":\"\"},{\"paraName\":\"arg1\",\"paraType\":\"java.lang.String\",\"paraDesc\":\"传维度id或编码都可以          \"}]' WHERE ID_ = '11';
UPDATE bpm_multi_script SET METHOD_DESC_ = '获取上一节点用户的上级部门（主）的负责人(主组织生效)' WHERE ID_ = '16';
-- 2022-10-12 liangjc 修改人员脚本getUserById入参
update bpm_multi_script set ARGUMENT_='[{"paraName":"arg0","paraType":"java.lang.String","paraDesc":"ID"}]'  where ID_=1338377219818524672;

-- 2022-10-13 jason 修改目标节点字段长度
ALTER TABLE `bpm_exe_stack`
    MODIFY COLUMN `TARGET_NODE_` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '驳回时返回节点' AFTER `NODE_TYPE_`;

-- 2022-10-17 yijj 增加流程实例删除事由字段长度
ALTER TABLE bpm_inst_delete_log MODIFY CONTENT_ VARCHAR(550);

-- jjx 2022-10-25 删除栏目中的不兼容的配置
DELETE FROM PORTAL_SYS_COLUMN WHERE ID = '1267788861858254848';
DELETE FROM PORTAL_SYS_COLUMN WHERE ID = '1267788537730830336';

-- 2022-10-25 jjx 字段长度调整
alter table portal_sys_popup  modify NAME_ varchar(200) null comment '名称';
alter table bpm_task_commu  modify OPINION_ varchar(1500) null comment '意见';
alter table bpm_pro_cpto    modify OPINION_ varchar(1500) null comment '意见';

-- 2022-10-26 liangjc修改发布新闻公告和轮播图到栏目默认高度
update PORTAL_NEWS_TREE_ set COL_HEIGHT_=432 where COL_HEIGHT_ in (100,0);

-- 2022-10-27 jjx修改菜单名称
UPDATE PORTAL_SYS_MENU SET  NAME_ = '工具管理' WHERE ALIAS_ = 'synergy';
UPDATE PORTAL_SYS_MENU SET  NAME_ = '协同办公' WHERE ALIAS_ = 'portalNewsNoticeManager';

-- 2022-10-28 liangjc portal_news_notice_ 字段FILE_增加长度
ALTER TABLE portal_news_notice_ MODIFY FILE_ LONGTEXT;

-- 2022-10-28 liangjc增加新闻公告已阅待阅表
CREATE TABLE portal_news_notice_read (
  ID_ varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  PORTAL_NEWS_NOTICE_ID_ varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '新闻id',
  USER_ID_ varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '用户id',
  TENANT_ID_ varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  PRIMARY KEY (ID_) USING BTREE,
  KEY IDX_PORTAL_NEWS_NOTICE_ID (PORTAL_NEWS_NOTICE_ID_) USING BTREE,
  KEY IDX_USER_ID (USER_ID_) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='新闻阅读记录';

-- 2022-11-1 jjx 栏目 增加分类
INSERT INTO `portal_sys_type`(`ID_`, `TYPE_GROUP_KEY_`, `NAME_`, `TYPE_KEY_`, `STRU_TYPE_`, `PARENT_ID_`, `DEPTH_`, `PATH_`, `IS_LEAF_`, `OWNER_ID_`, `SN_`, `CREATE_BY_`, `CREATE_TIME_`, `CREATE_ORG_ID_`, `UPDATE_BY_`, `UPDATE_TIME_`, `ICON_`, `TENANT_ID_`) VALUES ('1565643948817477632', 'INDEX_COLUMN_TYPE', '应用端', 'yyd', '0', '2', 1, '2.1565643948817477632.', 'Y', '0', 0, '1', '2022-09-02 18:13:00', '', NULL, NULL, NULL, '-1');
INSERT INTO `portal_sys_type`(`ID_`, `TYPE_GROUP_KEY_`, `NAME_`, `TYPE_KEY_`, `STRU_TYPE_`, `PARENT_ID_`, `DEPTH_`, `PATH_`, `IS_LEAF_`, `OWNER_ID_`, `SN_`, `CREATE_BY_`, `CREATE_TIME_`, `CREATE_ORG_ID_`, `UPDATE_BY_`, `UPDATE_TIME_`, `ICON_`, `TENANT_ID_`) VALUES ('1565643975514222592', 'INDEX_COLUMN_TYPE', '管理端', 'gld', '0', '2', 1, '2.1565643975514222592.', 'Y', '0', 0, '1', '2022-09-02 18:13:07', '', NULL, NULL, NULL, '-1');
INSERT INTO `portal_sys_type`(`ID_`, `TYPE_GROUP_KEY_`, `NAME_`, `TYPE_KEY_`, `STRU_TYPE_`, `PARENT_ID_`, `DEPTH_`, `PATH_`, `IS_LEAF_`, `OWNER_ID_`, `SN_`, `CREATE_BY_`, `CREATE_TIME_`, `CREATE_ORG_ID_`, `UPDATE_BY_`, `UPDATE_TIME_`, `ICON_`, `TENANT_ID_`) VALUES ('1565644010700238848', 'INDEX_COLUMN_TYPE', '移动端', 'ydd', '0', '2', 1, '2.1565644010700238848.', 'Y', '0', 0, '1', '2022-09-02 18:13:15', '', NULL, NULL, NULL, '-1');

-- 2022-10-26 jason  驳回的节点
ALTER TABLE `bpm_pro_status`
    ADD COLUMN `RECYCLE_NODE_` varchar(2) NULL COMMENT '驳回按流程图执行回收的节点 0默认值  1因为驳回按照流程图执行目标节点之后的节点为1，如果重新运行到该节点变为0' AFTER `TENANT_ID_`;

-- 2022-10-27 jason  驳回的节点
ALTER TABLE `bpm_task`
    ADD COLUMN `TARGET_NODE_` varchar(255) NULL COMMENT '回到本节点' AFTER `PC_TASK_URL_`;

-- 2022-11-2 jjx  轮播图长度修改
alter table portal_news_notice_   modify ROTATING_DISPLAY_PICTURES_ varchar(550) null comment '轮播展示图片';

-- 2022-11-2 liangjc 增加 发布菜单源与菜单关联关系
CREATE TABLE portal_sys_auth_menu (
  ID_ varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  AUTHORIZE_ID_ varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '发布菜单源主表ID',
  MENU_ID_ varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '菜单id',
  TENANT_ID_ varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  PRIMARY KEY (ID_) USING BTREE,
  KEY IDX_AUTHUSER_AUTHID (AUTHORIZE_ID_) USING BTREE,
  KEY IDX_MENU_ID_ (MENU_ID_) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='发布菜单源与菜单关联关系';

-- 2022-11-4 liangjc portal_sys_column别名字段索引改为唯一索引
DROP INDEX ALIAS_TENANT_ID__index ON portal_sys_column;
ALTER TABLE portal_sys_column ADD UNIQUE ALIAS_TENANT_ID__index (`ALIAS`,`TENANT_ID_`) USING BTREE;