📄 departmentservice.java
字号:
package cn.kmp.accommodation.service;
import com.littleQworks.commons.dao.ibatis.spring.CommonDaoGenericImpl;
import java.util.*;
import cn.kmp.accommodation.domain.*;
public class DepartmentService {
private CommonDaoGenericImpl commonDao;
public CommonDaoGenericImpl getCommonDao() {
return commonDao;
}
public void setCommonDao(CommonDaoGenericImpl commonDao) {
this.commonDao = commonDao;
}
public List<Department> getAllDepartments(){
return commonDao.getList("getAllDepartments");
}
public List<Department> getDepartmentByType(int type){
return commonDao.getListByParameter(type, "getDepartmentByType");
}
public Department getDepartmentByDepartmentNumType(int departmentNum,int type){
HashMap<String,Integer> hashmap=new HashMap<String,Integer>();
hashmap.put("departmentNum", departmentNum);
hashmap.put("type", type);
return commonDao.getByParamter(hashmap, "getDepartmentByDepartmentNumType");
}
public Department getDepartmentBySupervisor(int supervisor){
return commonDao.getByParamter(supervisor, "getDepartmentBySupervisor");
}
public boolean insertDepartment(Department department){
return commonDao.insertByParameter(department, "insertDepartment");
}
public boolean deleteDepartment(int departmentNum,int type){
HashMap<String,Integer> hashmap=new HashMap<String,Integer>();
hashmap.put("departmentNum", departmentNum);
hashmap.put("type", type);
return commonDao.deleteByParameter(hashmap, "deleteDepartment");
}
public boolean updateDepartment(Department department){
return commonDao.updateByParameter(department, "updateDepartment");
}
public List<Department> searchDepartment(int departmentNum,int type){
HashMap<String,Integer> hashmap=new HashMap<String,Integer>();
hashmap.put("departmentNum", departmentNum);
hashmap.put("type", type);
return commonDao.getListByParameter(hashmap, "searchDepartment");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -