Exemplo n.º 1
0
 public String getClassNo() throws Exception {
   Map<Integer, Object> map = new HashMap<Integer, Object>();
   map.put(1, classId);
   List<Map<String, Object>> result =
       SqlUtils.executeSqlQuery("SELECT classNo " + "FROM class WHERE id = ?", map);
   classNo = (String) result.get(0).get("classNo");
   return classNo;
 }
Exemplo n.º 2
0
 public Integer getStudentCount() throws Exception {
   Map<Integer, Object> map = new HashMap<Integer, Object>();
   map.put(1, classId);
   List<Map<String, Object>> result =
       SqlUtils.executeSqlQuery(
           "SELECT COUNT(*) AS studentCount " + "FROM student WHERE classId = ?", map);
   studentCount = (int) (long) (Long) result.get(0).get("studentCount");
   return studentCount;
 }
Exemplo n.º 3
0
 public List<Map<String, Object>> getStudentList() throws Exception {
   Map<Integer, Object> map = new HashMap<Integer, Object>();
   map.put(1, classId);
   studentList =
       SqlUtils.executeSqlQuery(
           "SELECT id, studentNo, studentName, macAddress\n"
               + "FROM student\n"
               + "WHERE classId = ?\n"
               + "ORDER BY studentNo",
           map);
   return studentList;
 }
Exemplo n.º 4
0
 public List<Map<String, Object>> getCourseList() throws Exception {
   Map<Integer, Object> map = new HashMap<Integer, Object>();
   map.put(1, classId);
   courseList =
       SqlUtils.executeSqlQuery(
           "SELECT course.id AS courseId, course.courseName AS courseName \n"
               + "FROM course, courseClass\n"
               + "WHERE course.id = courseClass.courseId AND courseClass.classId = ?\n"
               + "ORDER BY course.id",
           map);
   return courseList;
 }