leaseservice.java.svn-base
来自「数据库系统教材中附录的课程设计accomodation宿舍管理系统源码」· SVN-BASE 代码 · 共 66 行
SVN-BASE
66 行
package cn.kmp.accommodation.service;
import com.littleQworks.commons.dao.ibatis.spring.CommonDaoGenericImpl;
import java.util.*;
import cn.kmp.accommodation.domain.*;
public class LeaseService {
private CommonDaoGenericImpl commonDao;
public CommonDaoGenericImpl getCommonDao() {
return commonDao;
}
public void setCommonDao(CommonDaoGenericImpl commonDao) {
this.commonDao = commonDao;
}
public List<Lease> getAllLeases(){
return commonDao.getList("getAllLeases");
}
public Lease getLeaseByLeaseNum(int leaseNum){
return commonDao.getByParamter(leaseNum, "getLeaseByLeaseNum");
}
public List<Lease> getLeasesByStudentNum(int studentNum){
return commonDao.getListByParameter(studentNum, "getLeasesByStudentNum");
}
public Lease getLeaseByPlaceAndDuration(int placeNum,int departmentNum,int type,int roomNum,String duration,int schoolYear){
HashMap<String,Object> hashmap=new HashMap<String,Object>();
hashmap.put("placeNum",placeNum);
hashmap.put("departmentNum",departmentNum);
hashmap.put("type",type);
hashmap.put("roomNum",roomNum);
hashmap.put("duration",duration);
hashmap.put("schoolYear",schoolYear);
return commonDao.getByParamter(hashmap,"getLeaseByPlaceAndDuration");
}
public List<Lease> getLeasesByPlace(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.getListByParameter(hashmap,"getLeasesByPlace");
}
public List<Lease> getLeasesByDuration(){
return commonDao.getList("getLeasesByDuration");
}
public boolean insertLease(Lease lease){
return commonDao.insertByParameter(lease, "insertLease");
}
public boolean updateLease(Lease lease){
return commonDao.updateByParameter(lease, "updateLease");
}
public boolean deleteLeaseByLeaseNum(int leaseNum){
return commonDao.deleteByParameter(leaseNum, "deleteLeaseByLeaseNum");
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?