# Conflicts: # src/core/operation/Search.jsonwlf
parent
dfcd434b07
commit
b6f6e5c73b
@ -0,0 +1,32 @@
|
||||
package core.process;
|
||||
|
||||
import core.operation.Search;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class C_TeacherSearchStudent {
|
||||
Map<String,String> StudentInfo=new HashMap<String,String>();
|
||||
public Map<String,String> search(String studentID) throws Exception{
|
||||
Search search = new Search() ;
|
||||
search.setOptions(new HashMap<>());
|
||||
String table = "student";
|
||||
search.addOptions("table",table);
|
||||
List<String> fields = new ArrayList<>();
|
||||
fields.add("*");
|
||||
search.addOptions("field",fields);
|
||||
Map<String,String> limits = new HashMap<>();
|
||||
limits.put("id",studentID);
|
||||
search.addOptions("limits",limits);
|
||||
search.addOptions("start",0);
|
||||
search.addOptions("end",1);
|
||||
Map<String, Object> options = search.execute(null);
|
||||
List<String[]> result = (List<String[]>) options.get("result");
|
||||
String[] s = result.get(0);
|
||||
StudentInfo.put("id",s[0]);
|
||||
StudentInfo.put("name",s[2]);
|
||||
return StudentInfo;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue