package com.basic.security.manager.impl.sqlite;
|
|
import android.text.TextUtils;
|
|
import com.couchbase.lite.Expression;
|
import com.basic.security.model.ModelAdapter;
|
|
import java.util.ArrayList;
|
import java.util.List;
|
|
public class SlIdentityManager extends SlBaseManager {
|
|
public static List<ModelAdapter> findIdentityList() {
|
return findList("select * from identity ");
|
}
|
|
public static List<String> findIdentityNameListByPersonId(String personId) {
|
List<String> identityNameList = new ArrayList();
|
List<ModelAdapter> personPersonIdentity = SlPersonIdentityManager.findPersonIdentityListByPersonId(personId);
|
for (ModelAdapter personIdentity : personPersonIdentity) {
|
String identityId = personIdentity.getString("identity_id");
|
ModelAdapter identityDocument = findById("identity", identityId);
|
if (identityDocument != null) {
|
String identityName = identityDocument.getString("name");
|
if (!TextUtils.isEmpty(identityName)) {
|
identityNameList.add(identityName);
|
}
|
}
|
}
|
return identityNameList;
|
}
|
|
public static ModelAdapter findIdentityById(String id) {
|
return SlBaseManager.findById("identity", id);
|
}
|
}
|