staffservice.java.svn-base

来自「数据库系统教材中附录的课程设计accomodation宿舍管理系统源码」· SVN-BASE 代码 · 共 56 行

SVN-BASE
56
字号
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 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){
		HashMap<String,Object> hashmap=new HashMap<String,Object>();
		hashmap.put("staffNum", staffNum);
		hashmap.put("lname", lname);
		hashmap.put("fname", fname);
		hashmap.put("birthday", birthday);
		return commonDao.getListByParameter(hashmap, "searchStaff");
	}
	//delete staff
	public boolean deleteStaffByStaffNum(int staffNum){
		return commonDao.deleteByParameter(staffNum, "deleteStaffByStaffNum");
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?