| package com.matrix.system.hive.service.imp; | 
|   | 
|   | 
|   | 
| import com.matrix.core.pojo.PaginationVO; | 
| import com.matrix.system.hive.bean.SysBedInfo; | 
| import com.matrix.system.hive.bean.SysProjServices; | 
| import com.matrix.system.hive.dao.SysBedInfoDao; | 
| import com.matrix.core.tools.DateUtil; | 
| import com.matrix.system.hive.service.SysBedInfoService; | 
| import org.springframework.stereotype.Service; | 
| import org.springframework.beans.factory.annotation.Autowired; | 
|   | 
| import java.util.List; | 
|   | 
| /** | 
|  * | 
|  * @date 2016-07-03 20:53 | 
|  */ | 
| @Service("sysBedInfoService") | 
| public class  SysBedInfoServiceImpl implements SysBedInfoService { | 
|   | 
|      | 
|     @Autowired | 
|     private SysBedInfoDao sysBedInfoDao; | 
|      | 
|      | 
|     @Override | 
|     public int add(SysBedInfo sysBedInfo){ | 
|          | 
|         return sysBedInfoDao.insert(sysBedInfo); | 
|          | 
|     } | 
|         | 
|     @Override | 
|     public int modify(SysBedInfo sysBedInfo){ | 
|      | 
|         return sysBedInfoDao.update(sysBedInfo); | 
|      | 
|     } | 
|      | 
|     @Override | 
|     public int remove(List<Long> list){ | 
|      | 
|         return sysBedInfoDao.deleteByIds(list); | 
|      | 
|     } | 
|   | 
|     @Override | 
|     public int removeById(Long id){ | 
|      | 
|         return sysBedInfoDao.deleteById(id); | 
|      | 
|     } | 
|      | 
|     @Override | 
|     public List<SysBedInfo> findInPage(SysBedInfo sysBedInfo,  PaginationVO pageVo){ | 
|      | 
|          | 
|         return sysBedInfoDao.selectInPage(sysBedInfo , pageVo); | 
|      | 
|     } | 
|      | 
|     @Override | 
|     public List<SysBedInfo> findByModel(SysBedInfo sysBedInfo){ | 
|      | 
|         return sysBedInfoDao.selectByModel(sysBedInfo); | 
|      | 
|     } | 
|      | 
|     @Override | 
|     public int  findTotal(SysBedInfo sysBedInfo){ | 
|      | 
|         return sysBedInfoDao.selectTotalRecord(sysBedInfo); | 
|      | 
|     } | 
|      | 
|     @Override | 
|     public SysBedInfo  findById(Long id){ | 
|      | 
|         return sysBedInfoDao.selectById(id); | 
|      | 
|     } | 
|     //查询空余的床位数量 | 
|     @Override | 
|     public int findFreeBedCount(SysProjServices sysProjServices) { | 
|   | 
|         sysProjServices.setEndTime(DateUtil.getNextNMinute(sysProjServices.getStartTime(), sysProjServices.getTotalTime())); | 
|          | 
|         return sysBedInfoDao.findFreeBedCount(sysProjServices); | 
|     } | 
|     //查询空闲的床位 | 
|     @Override | 
|     public List<SysBedInfo> findFreeBed(SysProjServices sysProjServices) { | 
|         sysProjServices.setEndTime(DateUtil.getNextNMinute(sysProjServices.getStartTime(), sysProjServices.getTotalTime())); | 
|         return sysBedInfoDao.findFreeBed(sysProjServices); | 
|     } | 
|   | 
|         | 
|      | 
|      | 
| } |