|
@@ -53,7 +53,16 @@ public class NotUserUploadUserCacheJob {
|
|
|
}
|
|
|
|
|
|
private List<String> queryNotUserUploadUser() {
|
|
|
- String sql = "SELECT distinct uid FROM loghubods.operators_channel_day where type != 'userupload' order by uid desc;";
|
|
|
+ String sql = "SELECT DISTINCT c.uid\n" +
|
|
|
+ "FROM loghubods.operators_channel_day c\n" +
|
|
|
+ "WHERE c.type != 'userupload'\n" +
|
|
|
+ "AND NOT EXISTS (\n" +
|
|
|
+ " SELECT 1\n" +
|
|
|
+ " FROM loghubods.operators_channel_day b\n" +
|
|
|
+ " WHERE b.uid = c.uid\n" +
|
|
|
+ " AND b.type = 'userupload'\n" +
|
|
|
+ ")\n" +
|
|
|
+ "ORDER BY c.uid DESC;";
|
|
|
List<Record> records = odpsManager.query(sql);
|
|
|
if (records == null || records.size() == 0) {
|
|
|
return Collections.emptyList();
|