📄 studentservice.java.svn-base
字号:
package cn.kmp.accommodation.service;
import com.littleQworks.commons.dao.ibatis.spring.CommonDaoGenericImpl;
import java.util.*;
import cn.kmp.accommodation.domain.*;
public class StudentService {
private CommonDaoGenericImpl commonDao;
public CommonDaoGenericImpl getCommonDao() {
return commonDao;
}
public void setCommonDao(CommonDaoGenericImpl commonDao) {
this.commonDao = commonDao;
}
public List<Student> basicSearchStudent(Student student){
return commonDao.getListByParameter(student, "basicSearchStudent");
}
public List<Student> getStudentsByCategory(int category){
return commonDao.getListByParameter(category, "getStudentsByCategory");
}
public List<Student> getStudentsByStatus(int status){
return commonDao.getListByParameter(status, "getStudentsByStatus");
}
public boolean insertStudent(Student student){
return commonDao.insertByParameter(student, "insertStudent");
}
public boolean updateStudent(Student student){
return commonDao.updateByParameter(student, "updateStudent");
}
//获得每类学生的总数
public int getStudentNumberByCategory(int category){
return commonDao.getByParamter(category, "getStudentNumberByCategory");
}
//根据学号删除学生
public boolean deleteStudentByStudentNum(int studentNum){
return commonDao.deleteByParameter(studentNum, "deleteStudentByStudentNum");
}
public Student getStudentByStudentNum(int studentNum){
return commonDao.getByParamter(studentNum, "getStudentByStudentNum");
}
//高级搜索
public List<Student> advancedSearchStudent(int departmentNum,int roomNum,int type,int placeNum){
HashMap<String,Integer> hashmap=new HashMap<String,Integer>();
hashmap.put("departmentNum", departmentNum);
hashmap.put("roomNum", roomNum);
hashmap.put("type", type);
hashmap.put("placeNum", placeNum);
return commonDao.getListByParameter(hashmap, "advancedSearchStudent");
}
//类别搜索
public List<Student> categorySearch(int category,int status){
HashMap<String,Integer> hashmap=new HashMap<String,Integer>();
hashmap.put("category", category);
hashmap.put("status", status);
return commonDao.getListByParameter(hashmap, "categorySearch");
}
//所有学生的总数
public int getAllStudentNumber(){
return commonDao.get("getAllStudentNumber");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -