554325746@qq.com
2019-08-07 2539f53391765abb74b6fe63f46e5a2c701e950f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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);
    }
}