⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 staffservice.java

📁 数据库系统教材中附录的课程设计accomodation宿舍管理系统源码
💻 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 birthday1,String location,String birthday2){
		HashMap<String,Object> hashmap=new HashMap<String,Object>();
		hashmap.put("staffNum", staffNum);
		hashmap.put("lname", lname);
		hashmap.put("fname", fname);
		hashmap.put("birthday1", birthday1);
		hashmap.put("birthday2", birthday2);
		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 + -