diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.5__add_tag_color.sql b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.5__add_tag_color.sql new file mode 100644 index 0000000000..fad88adfab --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.5__add_tag_color.sql @@ -0,0 +1,37 @@ +#添加标签颜色字段 +ALTER TABLE `epmet_gov_voice`.`tag_default` + ADD COLUMN `TAG_COLOR` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '标签颜色' AFTER `TAG_NAME`, + DROP PRIMARY KEY, + ADD PRIMARY KEY (`ID`) USING BTREE; +ALTER TABLE `epmet_gov_voice`.`tag_customer` + ADD COLUMN `TAG_COLOR` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '标签颜色' AFTER `TAG_NAME`, + DROP PRIMARY KEY, + ADD PRIMARY KEY (`ID`) USING BTREE; +#给默认标签添加颜色 +update tag_default set tag_color='#E3271C' where id='6dd39a3dab9011ea8c52c03fd56f7847'; +update tag_default set tag_color='#FB7900' where id='6dd55595ab9011ea8c52c03fd56f7847'; +update tag_default set tag_color='#FFC100' where id='6dd6c2eeab9011ea8c52c03fd56f7847'; +update tag_default set tag_color='#0089FF' where id='6dd804d1ab9011ea8c52c03fd56f7847'; +update tag_default set tag_color='#17B886' where id='6dda6acaab9011ea8c52c03fd56f7847'; + +#给已有的客户默认标签 添加统一的颜色 +update tag_customer set tag_color='#E3271C' where TAG_NAME='发现榜样'; +update tag_customer set tag_color='#FB7900' where TAG_NAME='党建动态'; +update tag_customer set tag_color='#FFC100' where TAG_NAME='通知公告'; +update tag_customer set tag_color='#0089FF' where TAG_NAME='生活服务'; +update tag_customer set tag_color='#17B886' where TAG_NAME='党建要闻'; + +#手动去执行 +#获取有哪些客户的标签需要赋值颜色 +# SELECT CUSTOMER_ID ,COUNT(ID) c FROM tag_customer where tag_color IS NULL GROUP BY CUSTOMER_ID; +#按照时间顺序 依次更新5个颜色 +# update tag_customer set tag_color='#E3271C' where tag_color is null and customer_id = '上面sql客户Id' order by created_time desc limit 1; +# update tag_customer set tag_color='#FB7900' where tag_color is null and customer_id = '上面sql客户Id' order by created_time desc limit 1; +# update tag_customer set tag_color='#FFC100' where tag_color is null and customer_id = '上面sql客户Id' order by created_time desc limit 1; +# update tag_customer set tag_color='#0089FF' where tag_color is null and customer_id = '上面sql客户Id' order by created_time desc limit 1; +# update tag_customer set tag_color='#17B886' where tag_color is null and customer_id = '上面sql客户Id' order by created_time desc limit 1; + + + + +