placeservice.java.svn-base

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

SVN-BASE
70
字号
package cn.kmp.accommodation.service;

import com.littleQworks.commons.dao.ibatis.spring.CommonDaoGenericImpl;

import java.util.*;

import cn.kmp.accommodation.domain.*;

public class PlaceService {
	private CommonDaoGenericImpl commonDao;

	public CommonDaoGenericImpl getCommonDao() {
		return commonDao;
	}

	public void setCommonDao(CommonDaoGenericImpl commonDao) {
		this.commonDao = commonDao;
	}
	
	public Place getPlaceById(int placeNum,int departmentNum,int type,int roomNum){
		HashMap<String,Object> hashmap=new HashMap<String,Object>();
		hashmap.put("placeNum",placeNum);
		hashmap.put("departmentNum",departmentNum);
		hashmap.put("type",type);
		hashmap.put("roomNum",roomNum);
		return commonDao.getByParamter(hashmap, "getPlaceById");
	}
	
	public List<Place> getPlacesByMonthRentOrder(){
		return commonDao.getList("getPlacesByMonthRentOrder");
	}
	
	public List<Place> getPlacesByDepartmentNumAndType(int departmentNum,int type){
		HashMap<String,Object> hashmap=new HashMap<String,Object>();
		hashmap.put("departmentNum",departmentNum);
		hashmap.put("type",type);
		return commonDao.getListByParameter(hashmap, "getPlacesByDepartmentNumAndType");
	}
	
	public double getHallAvgMonthRent(){
		return commonDao.get("getHallAvgMonthRent");
	}
	
	public boolean updatePlace(Place p){
		return commonDao.updateByParameter(p, "updatePlace");
	}
	
	public boolean deletePlaceById(int placeNum,int type,int departmentNum,int roomNum){
		HashMap<String,Object> hashmap=new HashMap<String,Object>();
		hashmap.put("placeNum",placeNum);
		hashmap.put("departmentNum",departmentNum);
		hashmap.put("type",type);
		hashmap.put("roomNum",roomNum);
		return commonDao.deleteByParameter(hashmap, "deletePlaceById");
	}
	
	public boolean insertPlace(Place p){
		return commonDao.insertByParameter(p, "insertPlace");
	}
	
	public List<Place> searchPlace(int departmentNum,int type,int roomNum){
		HashMap<String,Object> hashmap=new HashMap<String,Object>();
		hashmap.put("departmentNum",departmentNum);
		hashmap.put("type",type);
		hashmap.put("roomNum",roomNum);
		return commonDao.getListByParameter(hashmap, "searchPlace");
	}
	
}

⌨️ 快捷键说明

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