📄 staffservice.java
字号:
package cn.kmp.accommodation.service;
import com.littleQworks.commons.dao.ibatis.spring.CommonDaoGenericImpl;
import java.util.*;
import cn.kmp.accommodation.domain.*;
public class StaffService {
private CommonDaoGenericImpl commonDao;
public CommonDaoGenericImpl getCommonDao() {
return commonDao;
}
public void setCommonDao(CommonDaoGenericImpl commonDao) {
this.commonDao = commonDao;
}
public List<Staff> getAllStaffs(){
return commonDao.getList("getAllStaffs");
}
public List<Staff> getStaffsByAge(String nowDate){
return commonDao.getListByParameter(nowDate, "getStaffsByAge");
}
public Staff getStaffByStaffNum(int staffNum){
return commonDao.getByParamter(staffNum, "getStaffByStaffNum");
}
public List<Staff> getStaffsByName(String fname,String lname){
HashMap<String,String> hashmap=new HashMap<String,String>();
hashmap.put("fname", fname);
hashmap.put("lname", lname);
return commonDao.getListByParameter(hashmap, "getStaffsByName");
}
public List<Staff> getSupervisors(){
return commonDao.getList("getSupervisors");
}
public boolean updateStaff(Staff staff){
return commonDao.updateByParameter(staff,"updateStaff");
}
public boolean insertStaff(Staff staff){
return commonDao.insertByParameter(staff, "insertStaff");
}
//高级搜索职员
public List<Staff> searchStaff(int staffNum,String lname,String fname,String birthday,String location){
HashMap<String,Object> hashmap=new HashMap<String,Object>();
hashmap.put("staffNum", staffNum);
hashmap.put("lname", lname);
hashmap.put("fname", fname);
hashmap.put("birthday", birthday);
hashmap.put("location", location);
return commonDao.getListByParameter(hashmap, "searchStaff");
}
//delete staff
public boolean deleteStaffByStaffNum(int staffNum){
return commonDao.deleteByParameter(staffNum, "deleteStaffByStaffNum");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -