数据库切换回 238
This commit is contained in:
parent
f435bb8d49
commit
8577b7f1e4
|
@ -0,0 +1,3 @@
|
|||
UPDATE sys_notice SET `from` = '评论' WHERE title LIKE '需求%';
|
||||
UPDATE sys_notice SET `from` = '通知' WHERE title LIKE '流程%';
|
||||
UPDATE sys_notice SET `from` = '其他' WHERE title IS NULL;
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE `sys_user` ADD COLUMN `guid` varchar(100) NULL;
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE `sys_notice` ADD COLUMN `from` varchar(255) NULL COMMENT '通知来源';
|
|
@ -0,0 +1,77 @@
|
|||
CREATE TABLE `tb_project` (
|
||||
`id` bigint(20) NOT NULL COMMENT '主键',
|
||||
`project_name` varchar(128) DEFAULT NULL COMMENT '项目名称',
|
||||
`apply_dep` varchar(128) DEFAULT NULL COMMENT '申请单位',
|
||||
`apply_user` varchar(128) DEFAULT NULL COMMENT '申请人',
|
||||
`apply_time` datetime DEFAULT NULL COMMENT '申请时间',
|
||||
`region_name` varchar(128) DEFAULT NULL COMMENT '所属区市',
|
||||
`resp_dep` varchar(128) DEFAULT NULL COMMENT '责任处室',
|
||||
`business_user` varchar(128) DEFAULT NULL COMMENT '业务联系人',
|
||||
`business_phone` varchar(32) DEFAULT NULL COMMENT '业务联系电话',
|
||||
`tech_user` varchar(128) DEFAULT NULL COMMENT '技术联系人',
|
||||
`tech_phone` varchar(32) DEFAULT NULL COMMENT '技术联系电话',
|
||||
`creator` bigint(20) DEFAULT NULL COMMENT '创建人',
|
||||
`create_date` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`updater` bigint(20) DEFAULT NULL COMMENT '修改人',
|
||||
`update_date` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`note1` longtext COMMENT '备用字段',
|
||||
`note2` varchar(200) DEFAULT NULL COMMENT '备用字段',
|
||||
`note3` varchar(500) DEFAULT NULL COMMENT '备用字段',
|
||||
`note4` varchar(1000) DEFAULT NULL COMMENT '备用字段',
|
||||
`note5` varchar(2000) DEFAULT NULL COMMENT '备用字段',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='项目表';
|
||||
|
||||
CREATE TABLE `tb_project_contrib` (
|
||||
`id` bigint(20) NOT NULL COMMENT '主键',
|
||||
`project_name` varchar(128) DEFAULT NULL COMMENT '项目名称',
|
||||
`resource_name` varchar(128) DEFAULT NULL COMMENT '应用名称',
|
||||
`ability_name` varchar(128) DEFAULT NULL COMMENT '能力名称',
|
||||
`ability_type` varchar(64) DEFAULT NULL COMMENT '能力类型',
|
||||
`apply_time` datetime DEFAULT NULL COMMENT '上架时间',
|
||||
`apply_num` varchar(10) DEFAULT NULL COMMENT '申请次数',
|
||||
`browse_num` varchar(10) DEFAULT NULL COMMENT '浏览次数',
|
||||
`creator` bigint(20) DEFAULT NULL COMMENT '创建人',
|
||||
`create_date` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`updater` bigint(20) DEFAULT NULL COMMENT '修改人',
|
||||
`update_date` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`note1` longtext COMMENT '备用字段',
|
||||
`note2` varchar(200) DEFAULT NULL COMMENT '备用字段',
|
||||
`note3` varchar(500) DEFAULT NULL COMMENT '备用字段',
|
||||
`note4` varchar(1000) DEFAULT NULL COMMENT '备用字段',
|
||||
`note5` varchar(2000) DEFAULT NULL COMMENT '备用字段',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='项目贡献表';
|
||||
|
||||
CREATE TABLE `tb_project_use` (
|
||||
`id` bigint(20) NOT NULL COMMENT '主键',
|
||||
`project_name` varchar(128) DEFAULT NULL COMMENT '项目名称',
|
||||
`resource_name` varchar(128) DEFAULT NULL COMMENT '应用名称',
|
||||
`ability_name` varchar(128) DEFAULT NULL COMMENT '能力名称',
|
||||
`ability_type` varchar(64) DEFAULT NULL COMMENT '能力类型',
|
||||
`apply_time` datetime DEFAULT NULL COMMENT '上架时间',
|
||||
`apply_num` varchar(10) DEFAULT NULL COMMENT '申请次数',
|
||||
`browse_num` varchar(10) DEFAULT NULL COMMENT '浏览次数',
|
||||
`creator` bigint(20) DEFAULT NULL COMMENT '创建人',
|
||||
`create_date` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`updater` bigint(20) DEFAULT NULL COMMENT '修改人',
|
||||
`update_date` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`note1` longtext COMMENT '备用字段',
|
||||
`note2` varchar(200) DEFAULT NULL COMMENT '备用字段',
|
||||
`note3` varchar(500) DEFAULT NULL COMMENT '备用字段',
|
||||
`note4` varchar(1000) DEFAULT NULL COMMENT '备用字段',
|
||||
`note5` varchar(2000) DEFAULT NULL COMMENT '备用字段',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='项目使用表';
|
||||
|
||||
CREATE TABLE `tb_data_resource_rel` (
|
||||
`key_id` bigint(20) DEFAULT NULL COMMENT '应用资源id',
|
||||
`reference_id` bigint(20) DEFAULT NULL COMMENT '关联id',
|
||||
`del_flag` int(11) DEFAULT '0' COMMENT '删除标志:\r\n0:正常;\r\n1:已删除;\r\n2:待审核;\r\n3:审核中;\r\n9其他',
|
||||
`creator` bigint(20) DEFAULT NULL COMMENT '创建人',
|
||||
`create_date` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`updater` bigint(20) DEFAULT NULL COMMENT '修改人',
|
||||
`update_date` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`id` bigint(20) NOT NULL COMMENT 'id',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='组件-应用资源关系表';
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE `t_demand_comment` ADD COLUMN `del_flag` int(11) NULL COMMENT '删除标志:\r\n0:正常;\r\n1:已删除;\r\n2:待审核;\r\n3:审核中;\r\n9其他';
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE `t_demand_comment` ADD COLUMN `instance_id` varchar(64) NULL COMMENT '流程实例ID';
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE sys_log_operation ADD COLUMN result_data text NULL COMMENT '返回结果';
|
|
@ -0,0 +1,7 @@
|
|||
ALTER TABLE `tb_project_contrib`
|
||||
MODIFY COLUMN `note1` bigint(20) DEFAULT NULL COMMENT '项目id,tb_project主键',
|
||||
MODIFY COLUMN `note2` bigint(20) DEFAULT NULL COMMENT '应用id,tb_data_resource中类型为应用资源的主键id';
|
||||
|
||||
ALTER TABLE `tb_project_use`
|
||||
MODIFY COLUMN `note1` bigint(20) DEFAULT NULL COMMENT '项目id,tb_project主键',
|
||||
MODIFY COLUMN `note2` bigint(20) DEFAULT NULL COMMENT '应用id,tb_data_resource中类型为应用资源的主键id';
|
|
@ -0,0 +1,28 @@
|
|||
-- 删除索引
|
||||
alter table `tb_resource_collection` drop index `resourceid`;
|
||||
alter table `tb_resource_car` drop index `resourceid`;
|
||||
alter table `tb_resource_score` drop index `resourceid`;
|
||||
alter table `tb_resource_browse` drop index `resourceid`;
|
||||
alter table `t_ability_application` drop index `resourceid`;
|
||||
alter table `t_ability_application` drop index `userId`;
|
||||
alter table `tb_data_resource` drop index `type`;
|
||||
alter table `tb_data_attr` drop index `attr_value`;
|
||||
alter table `tb_data_resource` drop index `name`;
|
||||
alter table `tb_data_resource` drop index `deptId`;
|
||||
alter table `sys_dept` drop index `type`;
|
||||
alter table `sys_dept` drop index `district`;
|
||||
alter table `tb_resource_collection` drop index `userId`;
|
||||
-- 创建索引
|
||||
alter table `tb_resource_collection` ADD INDEX `resourceid`(`resource_id`) USING BTREE comment '收藏的资源id';
|
||||
alter table `tb_resource_car` ADD INDEX `resourceid`(`resource_id`) USING BTREE comment '加入申购车的id';
|
||||
alter table `tb_resource_score` ADD INDEX `resourceid`(`resource_id`) USING BTREE comment '评分的资源id';
|
||||
alter table `tb_resource_browse` ADD INDEX `resourceid`(`resource_id`) USING BTREE comment '资源id索引';
|
||||
alter table `t_ability_application` ADD INDEX `resourceid`(`resource_id`) USING BTREE comment '资源id';
|
||||
alter table `t_ability_application` ADD INDEX `userId`(`user_id`) USING BTREE comment '用户';
|
||||
alter table `tb_data_resource` ADD FULLTEXT INDEX `type`(`type`) with parser ngram;
|
||||
alter table `tb_data_attr` ADD FULLTEXT INDEX `attr_value`(`attr_value`) with parser ngram;
|
||||
alter table `tb_data_resource` ADD FULLTEXT INDEX `name`(`name`) with parser ngram;
|
||||
alter table `tb_data_resource` ADD INDEX `deptId`(`dept_id`) USING BTREE;
|
||||
alter table `sys_dept` ADD INDEX `type`(`type`) USING BTREE;
|
||||
alter table `sys_dept` ADD INDEX `district`(`district`) USING BTREE;
|
||||
alter table `tb_resource_collection` ADD INDEX `userId`(`user_id`) USING BTREE;
|
|
@ -0,0 +1,13 @@
|
|||
create view `tb_data_resource_assignmark` AS select
|
||||
tdr.id,
|
||||
(IFNULL( visits / 100, 0 ) + IFNULL( trs.score, 0 ) + IFNULL( applyCount, 0 ) + IFNULL( collectCount, 0 )) as total
|
||||
from
|
||||
tb_data_resource tdr
|
||||
left join ( select resource_id, avg( score ) as "score" from tb_resource_score where 1 = 1 and del_flag = 0 group by resource_id ) trs on tdr.id = trs.resource_id
|
||||
left join ( select resource_id, count( id ) as "applyCount" from t_ability_application where 1 = 1 and del_flag = 0 group by resource_id ) taa on tdr.id = taa.resource_id
|
||||
left join ( select resource_id, count( id ) as "collectCount" from tb_resource_collection where 1 = 1 and del_flag = 0 group by resource_id ) trc on tdr.id = trc.resource_id
|
||||
where
|
||||
1 = 1
|
||||
and tdr.del_flag = 0
|
||||
order by
|
||||
total desc ;
|
|
@ -0,0 +1,9 @@
|
|||
alter table `tb_data_resource` ADD COLUMN `total` int NULL comment '整体评分';
|
||||
|
||||
update tb_data_resource,
|
||||
tb_data_resource_assignmark
|
||||
SET tb_data_resource.total = round(tb_data_resource_assignmark.total)
|
||||
WHERE
|
||||
tb_data_resource.id = tb_data_resource_assignmark.id;
|
||||
|
||||
alter table `tb_data_resource`ADD INDEX `total`(`total` DESC) USING BTREE;
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE t_ability_application ADD COLUMN `cameraList` json NULL COMMENT '摄像头ID数组';
|
|
@ -6,10 +6,10 @@ spring:
|
|||
#MySQL
|
||||
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
#url: jdbc:mysql://15.2.21.238:3310/share_platform?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&useSSL=false
|
||||
url: jdbc:mysql://15.2.21.221:3306/share_platform?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&useSSL=false
|
||||
url: jdbc:mysql://15.2.21.238:3310/share_platform?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&useSSL=false
|
||||
#url: jdbc:mysql://15.2.21.221:3306/share_platform?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&useSSL=false
|
||||
username: root
|
||||
password: Liwen073898!
|
||||
password: Hisense2019
|
||||
#Hisense2019
|
||||
# #Oracle
|
||||
# driver-class-name: oracle.jdbc.OracleDriver
|
||||
|
|
Loading…
Reference in New Issue