|
|
|
@ -1,24 +1,29 @@
|
|
|
|
|
package core.process;
|
|
|
|
|
|
|
|
|
|
import core.operation.Search;
|
|
|
|
|
import error.GExcptInit;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
public class C_StudentSearchTeacher {
|
|
|
|
|
public class C_StudentSearchTeacher extends TempProcess{
|
|
|
|
|
String teacherID;
|
|
|
|
|
|
|
|
|
|
static String table = "teacher";
|
|
|
|
|
|
|
|
|
|
Map<String,String> TeacherInfo=new HashMap<String, String>();
|
|
|
|
|
public Map<String,String> search(String teacherID) throws Exception {
|
|
|
|
|
public Map<String,String> search() throws Exception {
|
|
|
|
|
if(!check()) throw new GExcptInit("teacherID Attrs init error!");
|
|
|
|
|
Search search = new Search() ;
|
|
|
|
|
search.setOptions(new HashMap<>());
|
|
|
|
|
String table = "teacher";
|
|
|
|
|
search.addOptions("table",table);
|
|
|
|
|
List<String> fields = new ArrayList<>();
|
|
|
|
|
fields.add("*");
|
|
|
|
|
search.addOptions("field",fields);
|
|
|
|
|
Map<String,String> limits = new HashMap<>();
|
|
|
|
|
limits.put("id",teacherID);
|
|
|
|
|
limits.put("id",this.getTeacherID());
|
|
|
|
|
search.addOptions("limits",limits);
|
|
|
|
|
search.addOptions("start",0);
|
|
|
|
|
search.addOptions("end",1);
|
|
|
|
@ -27,6 +32,20 @@ public class C_StudentSearchTeacher {
|
|
|
|
|
String[] s = result.get(0);
|
|
|
|
|
TeacherInfo.put("id",s[0]);
|
|
|
|
|
TeacherInfo.put("name",s[2]);
|
|
|
|
|
TeacherInfo.put("e_mail_location",s[3]);
|
|
|
|
|
TeacherInfo.put("phone_number",s[4]);
|
|
|
|
|
return TeacherInfo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected boolean check() {
|
|
|
|
|
if(this.getTeacherID()==null)
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
public String getTeacherID(){
|
|
|
|
|
return teacherID;
|
|
|
|
|
}
|
|
|
|
|
public void setTeacherID(String teacherID){
|
|
|
|
|
this.teacherID=teacherID;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|