From b6f6e5c73ba8455ac4d946ebd390b38be257e1ed Mon Sep 17 00:00:00 2001 From: wan <2499498893@qq.com> Date: Sat, 12 Jan 2019 17:44:20 +0800 Subject: [PATCH] Merge remote-tracking branch 'remotes/origin/master' into wmj # Conflicts: # src/core/operation/Search.json --- src/core/process/C_TeacherSearchStudent.java | 32 ++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/core/process/C_TeacherSearchStudent.java diff --git a/src/core/process/C_TeacherSearchStudent.java b/src/core/process/C_TeacherSearchStudent.java new file mode 100644 index 0000000..8fe27b0 --- /dev/null +++ b/src/core/process/C_TeacherSearchStudent.java @@ -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 StudentInfo=new HashMap(); + public Map search(String studentID) throws Exception{ + Search search = new Search() ; + search.setOptions(new HashMap<>()); + String table = "student"; + search.addOptions("table",table); + List fields = new ArrayList<>(); + fields.add("*"); + search.addOptions("field",fields); + Map limits = new HashMap<>(); + limits.put("id",studentID); + search.addOptions("limits",limits); + search.addOptions("start",0); + search.addOptions("end",1); + Map options = search.execute(null); + List result = (List) options.get("result"); + String[] s = result.get(0); + StudentInfo.put("id",s[0]); + StudentInfo.put("name",s[2]); + return StudentInfo; + } +}