-- 修改升级标识字段
ALTER TABLE `system_upgrade`
CHANGE COLUMN `flag` `deleteFlag`  varchar(1) NULL DEFAULT NULL AFTER `areaId`,
ADD COLUMN `pssId`  bigint NULL AFTER `id`;

-- 活动详情增加字段
ALTER TABLE `sp_activity_detail`
ADD COLUMN `nzjs`  varchar(100) NULL AFTER `cdrl`,
ADD COLUMN `cdmj`  varchar(100) NULL AFTER `nzjs`,
ADD COLUMN `xccys`  varchar(100) NULL AFTER `cdmj`;

-- 活动表增加字段
ALTER TABLE `sp_activity`
ADD COLUMN `isNeedReport`  varchar(1) NULL COMMENT '是否需要风评报告' AFTER `isBackUp`;


ALTER TABLE `sp_activity_contractor`
ADD COLUMN `organizationCode`  varchar(255) NULL COMMENT '组织代码' AFTER `intro`;


-- 增加操作日志表
CREATE TABLE `log_operate` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `userId` bigint(20) DEFAULT NULL COMMENT '用户id',
  `userName` varchar(50) DEFAULT NULL COMMENT '用户名称',
  `province` varchar(50) DEFAULT NULL,
  `city` varchar(50) DEFAULT NULL,
  `area` varchar(50) DEFAULT NULL,
  `provinceName` varchar(50) DEFAULT NULL,
  `cityName` varchar(50) DEFAULT NULL,
  `areaName` varchar(50) DEFAULT NULL,
  `menuName` varchar(100) DEFAULT NULL COMMENT '菜单名称',
  `operateType` varchar(100) DEFAULT NULL COMMENT '操作类型',
  `operateObj` varchar(1000) DEFAULT NULL COMMENT '操作对象',
  `params` text COMMENT '参数',
  `result` int(1) DEFAULT NULL COMMENT '结果',
  `requestMethod` varchar(50) DEFAULT NULL COMMENT '请求方式',
  `requestUrl` varchar(255) DEFAULT NULL,
  `startTime` bigint(20) DEFAULT NULL,
  `endTime` bigint(20) DEFAULT NULL,
  `speedTime` bigint(20) DEFAULT NULL,
  `ip` varchar(50) DEFAULT NULL,
  `exception` text,
  `addTime` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `INX_LOG_OPERATE_USERID` (`userId`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='操作日志';



