StringwxSql=String.format("SELECT `user_id`, `open_id`, `union_id` from wechat_userinfo where app_name='%s' and user_id is not null and `open_id` IN (%s)",WECHAT_XYQB,openIdStrs);
Stringsql=String.format("INSERT INTO wechat_info_relation(`user_id`, `open_id`, `union_id`, `type`, `task_period`) SELECT `user_id`, `open_id`, `union_id`, '%s', %s from wechat_userinfo where app_name='%s' and user_id is not null and `open_id` IN (%s)",WECHAT_ACCOUNT,period,WECHAT_XYQB,openIdStrs);
jdbcTemplate.update(sql);
Stringsql="INSERT INTO wechat_info_relation(`user_id`, `open_id`, `union_id`, `type`, `task_period`) values (?,?,?,?,?)";
longstime=System.currentTimeMillis();
jdbcTemplate.batchUpdate(sql,objectArrayList);
longetime=System.currentTimeMillis();
System.out.printf("执行时间:%d 毫秒",(etime-stime));
}
}
if(nextOpenId!=""){
executeWechatFollowStatus(nextOpenId,period);
...
...
@@ -206,7 +220,6 @@ public class WechatFollowServiceImpl implements IWechatFollowService {
Stringsql=String.format("INSERT INTO wechat_info_relation(`user_id`, `open_id`, `union_id`, `type`, `task_period`) SELECT `user_id`, `open_id`, `union_id`, '%s', %s from wechat_userinfo where user_id is not null and `union_id` IN (%s)",ENTERPRISE_WECHAT,period,unionIdStrs);
jdbcTemplate.update(sql);
// 查询微信信息
StringwxSql=String.format(" SELECT `user_id`, `open_id`, `union_id` from wechat_userinfo where user_id is not null and `union_id` IN (%s)",unionIdStrs);
Stringsql=String.format("INSERT INTO wechat_info_relation(`user_id`, `open_id`, `union_id`, `type`, `task_period`) SELECT `user_id`, `open_id`, `union_id`, '%s', %s from wechat_userinfo where user_id is not null and `union_id` IN (%s)",ENTERPRISE_WECHAT,period,unionIdStrs);
jdbcTemplate.update(sql);
// 查询微信信息
StringwxSql=String.format(" SELECT `user_id`, `open_id`, `union_id` from wechat_userinfo where user_id is not null and `union_id` IN (%s)",unionIdStrs);