package com.fxy.utils;

import com.fxy.realm.AsyncUploadRealm;

import io.realm.Realm;
import io.realm.RealmResults;

public class UploadUtils {
    public static int getAwaitNum(Realm mRealm,String uploadType){
        RealmResults<AsyncUploadRealm> realmResults  = mRealm.where(AsyncUploadRealm.class)
                .equalTo("isDelete",0)
                .equalTo("pushStatus",0)
                .equalTo("uploadType",uploadType)
                .sort("pushStatus").findAll();
        realmResults.load();
        return  realmResults.size();
    }
    public static int getAwaitNum(Realm mRealm, String[] uploadTypeList){
        RealmResults<AsyncUploadRealm> realmResults  = mRealm.where(AsyncUploadRealm.class)
                .equalTo("isDelete",0)
                .equalTo("pushStatus",0)
                .in("uploadType",uploadTypeList)
                .sort("pushStatus").findAll();
        realmResults.load();
        return  realmResults.size();
    }
}
