记得上下班打卡 | git大法好,push需谨慎

Commit 1fc61c4f authored by 胡佳晨's avatar 胡佳晨

Merge remote-tracking branch 'origin/dev' into dev

parents 04707487 4f74f7ca
...@@ -11,12 +11,13 @@ create table adam_third_party ...@@ -11,12 +11,13 @@ create table adam_third_party
nickname varchar(64) comment '第三方昵称', nickname varchar(64) comment '第三方昵称',
platform varchar(20) comment '平台名称', platform varchar(20) comment '平台名称',
state tinyint comment '0-INIT,1-NORMAL,2-INVALID', state tinyint comment '0-INIT,1-NORMAL,2-INVALID',
created_at datetime, created_at datetime not null,
updated_at datetime, updated_at datetime,
comment text comment text
) engine = InnoDB comment '用户第三方账号信息'; ) engine = InnoDB comment '用户第三方账号信息';
create unique index uidx_third_party_uid_open_id on adam_third_party (uid, open_id); create index idx_third_party_uid_platform on adam_third_party (uid, platform);
create index idx_third_party_state on adam_third_party (state);
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------
# drop table if exists adam_login; # drop table if exists adam_login;
# create table adam_login # create table adam_login
...@@ -104,7 +105,10 @@ create table adam_real_name ...@@ -104,7 +105,10 @@ create table adam_real_name
comment text comment text
) engine = InnoDB comment '实名信息'; ) engine = InnoDB comment '实名信息';
create unique index idx_real_name_uid on adam_real_name (uid); create unique index idx_real_name_id on adam_real_name (real_name_id);
create index idx_real_name_id_card_type on adam_real_name (id_card, type);
create index idx_real_name_uid on adam_real_name (uid);
create index idx_real_name_state on adam_real_name (state);
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------
drop table if exists adam_enters; drop table if exists adam_enters;
create table adam_enters create table adam_enters
......
...@@ -37,7 +37,7 @@ public class DMRealNameProcessor extends DataMigrationProcessorService { ...@@ -37,7 +37,7 @@ public class DMRealNameProcessor extends DataMigrationProcessorService {
} }
String sqlCount = "select count(1) from user_real_name where 1=1"; String sqlCount = "select count(1) from user_real_name where 1=1";
String field = "id,uid,real_name,id_card,created_at,updated_at"; String field = "id,uid,real_name,id_card,ifnull(created_at, '1970-01-01 00:00:00') created_at,updated_at";
// 1-id,2-uid,3-real_name,4-id_card,5-created_at,6-updated_at // 1-id,2-uid,3-real_name,4-id_card,5-created_at,6-updated_at
String sql = sqlCount.replace("count(1)", field); String sql = sqlCount.replace("count(1)", field);
if ("1".equals(flg)) { if ("1".equals(flg)) {
......
...@@ -36,7 +36,9 @@ public class DMThirdPartsProcessor extends DataMigrationProcessorService { ...@@ -36,7 +36,9 @@ public class DMThirdPartsProcessor extends DataMigrationProcessorService {
log.info("DM.flush.AdamThirdPartInfoVo:{}", mongoTemplate.remove(Query.query(Criteria.where("_id").exists(true)), AdamThirdPartInfoVo.class.getSimpleName()).getDeletedCount()); log.info("DM.flush.AdamThirdPartInfoVo:{}", mongoTemplate.remove(Query.query(Criteria.where("_id").exists(true)), AdamThirdPartInfoVo.class.getSimpleName()).getDeletedCount());
} }
String sqlCount = "select count(1) from user_third_parts where `status`=1 and delete_tag=0"; String sqlCount = "select count(1) from (\n" +
" select row_number() over (partition by uid,type order by created_at desc) rn,uid,open_id,avatar,nickname,type,created_at,updated_at from user_third_parts where `status`=1 and delete_tag in (0,1) and open_id<>'' and uid>0\n" +
" ) t where t.rn = 1";
String field = "uid,open_id,avatar,nickname,type,created_at,updated_at"; String field = "uid,open_id,avatar,nickname,type,created_at,updated_at";
// 1-uid,2-open_id,3-avatar,4-nickname,5-type,6-created_at,7-updated_at // 1-uid,2-open_id,3-avatar,4-nickname,5-type,6-created_at,7-updated_at
String sql = sqlCount.replace("count(1)", field); String sql = sqlCount.replace("count(1)", field);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment