zhangzengfei
2020-03-31 0ce893695d32ab686f9e2309509e80c6feb0d380
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
package com.basic.security.manager.impl.sqlite;
 
import com.basic.security.model.ModelAdapter;
 
import java.util.List;
 
public class SlOfficeManager extends SlBaseManager {
 
    public static List<ModelAdapter> findIdentityList() {
        return findList("select * from office ");
    }
 
    public static void addOffice(String ip) {
        synchronized (SlOfficeManager.class) {
            ModelAdapter office = findOne("select * from office where ip='" + ip + "'");
            if (office == null) {
                office = new ModelAdapter();
                office.setString("ip", ip);
                save(office);
            }
        }
    }
 
    public static void setOfficeValid(String ip, String valid) {
        ModelAdapter office = findOne("select * from office where ip='" + ip + "'");
        if (office != null) {
            office.setString("valid", valid);
            save(office);
        }
    }
 
}