| | |
| | | |
| | | @Override |
| | | public YwProject findById(Integer id) { |
| | | return ywProjectMapper.selectById(id); |
| | | YwProject ywProject = ywProjectMapper.selectById(id); |
| | | if(Objects.isNull(ywProject)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(Objects.nonNull(ywProject.getAreaId())){ |
| | | Areas a = areasService.findById(ywProject.getAreaId(),Constants.TWO); |
| | | if(a != null){ |
| | | ywProject.setAreaName(a.getName()); |
| | | ywProject.setCityId(a.getCityId()); |
| | | ywProject.setCityName(a.getCityName()); |
| | | ywProject.setProvinceId(a.getProvinceId()); |
| | | ywProject.setProvinceName(a.getProvinceName()); |
| | | } |
| | | } |
| | | return ywProject; |
| | | } |
| | | |
| | | @Override |
| | |
| | | List<YwRoom> ywRoomList = ywRoomMapper.selectList(new QueryWrapper<YwRoom>().lambda() |
| | | .eq(YwRoom::getIsdeleted,Constants.ZERO) |
| | | .eq(YwRoom::getStatus,Constants.ZERO) |
| | | .eq(YwRoom::getIsInvestment,Constants.ONE) |
| | | .eq(Objects.nonNull(dataDTO.getProjectId()),YwRoom::getProjectId,dataDTO.getProjectId()) |
| | | .apply(Objects.nonNull(dataDTO)&&Objects.nonNull(dataDTO.getStartDate())&&Objects.nonNull(dataDTO.getEndDate())," id not in (" + |
| | | " SELECT y2.room_id FROM yw_contract y1 left join yw_contract_room y2 on y1.id = y2.contract_id where 1 = 1 and y1.`STATUS` in( 0,1,2) " + |
| | |
| | | " SELECT y2.room_id FROM yw_contract y1 left join yw_contract_room y2 on y1.id = y2.contract_id where 1 = 1 and y1.`STATUS` = 3 " + |
| | | " and y1.START_DATE < '"+dataDTO.getEndDate()+" 00:00:00' and y1.BT_DATE > '"+ dataDTO.getStartDate() +" 00:00:00' " + |
| | | " ) ") |
| | | .orderByAsc(YwRoom::getSortnum) |
| | | .orderByAsc(YwRoom::getRoomNum) |
| | | ); |
| | | |
| | | for (YwRoom data:ywRoomList) { |
| | |
| | | ProjectTree treeBuild = new ProjectTree(projectDataVOList); |
| | | projectDataVOList = treeBuild.buildTree(); |
| | | return projectDataVOList; |
| | | |
| | | } |
| | | |
| | | |