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

📄 placeservice.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 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");
	}
	public int getPlaceNumberByDepartmentNumType(int departmentNum,int type){
		HashMap<String,Integer> hashmap=new HashMap<String,Integer>();
		hashmap.put("departmentNum", departmentNum);
		hashmap.put("type", type);
		return commonDao.getByParamter(hashmap, "getPlaceNumberByDepartmentNumType");
	}
}

⌨️ 快捷键说明

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