/**
  * 房间发布功能
  *
  * @param roomCode
  */
 public void pubRoom(Room r) {
   // 房间编号查询房间
   Room room = houseAndRoomMapper.selectRoomByCode(r.getSysRoomId());
   // 房间发布状态变更
   if (room != null) {
     if (room.getIsShow().equals("Y")) {
       room.setIsShow("N");
       room.setIsPromotions("N");
       room.setIsTop("N");
       room.setCkd("1");
       room.setCheckInTime(null);
     } else if (room.getIsShow().equals("N")) {
       room.setIsShow("Y");
       room.setCkd("1");
       if (r.getCheckInTime() != null) {
         room.setCheckInTime(r.getCheckInTime());
       }
     }
   }
   houseAndRoomMapper.updateRoom(room);
   // 获得房屋房间数量及发布房间数量
   int countRoom = houseAndRoomMapper.countRoom(room.getSysHouseId());
   int countPubRoom = houseAndRoomMapper.countPubRoom(room);
   if (countRoom == countPubRoom) {
     House h = new House();
     h.setSysHouseId(room.getSysHouseId());
     h.setIsShow(room.getIsShow());
     houseAndRoomMapper.updateHouse(h);
   }
 }
 /**
  * 房屋发布业务处理方法
  *
  * @param houseCode
  */
 public void pubHouse(House house) {
   House h = houseAndRoomMapper.selectHouseByCode(house.getSysHouseId());
   if (h != null) {
     Room r = new Room();
     r.setSysHouseId(h.getSysHouseId());
     // 根据房屋状态设置房屋发布情况
     if (h.getIsShow().equals("N")) {
       h.setIsShow("Y");
       h.setCkd("1");
       h.setCheckInTime(house.getCheckInTime());
       // 房屋设置"发布"状态,房间中除了已出租的房间外都更新为发布状态。
       r.setIsShow("Y");
       r.setCkd("1");
       r.setCheckInTime(house.getCheckInTime());
     } else if (h.getIsShow().equals("Y")) {
       h.setIsShow("N");
       h.setCkd("1");
       h.setCheckInTime(null);
       // 如果房屋"取消发布"状态,房间状态全部更改为"不发布"。
       r.setIsShow("N");
       r.setIsPromotions("N");
       r.setIsTop("N");
       r.setCkd("1");
       r.setCheckInTime(null);
     }
     houseAndRoomMapper.updateRoomByHouseCode(r);
     houseAndRoomMapper.updateHouse(h);
   }
 }
 /**
  * 保存房屋
  *
  * @param house
  */
 public void saveHouse(House house) {
   houseAndRoomMapper.updateHouse(house);
 }