【尚庭公寓SpringBoot + Vue 项目实战】房间管理(十二)

news2024/11/23 20:29:52

【尚庭公寓SpringBoot + Vue 项目实战】房间管理(十二)


文章目录

      • 【尚庭公寓SpringBoot + Vue 项目实战】房间管理(十二)
        • 1、业务介绍
        • 2、逻辑模型介绍
        • 3、接口开发
          • 3.1、保存或更新房间信息
          • 3.2、根据条件分页查询详细信息
          • 3.3、根据id获取房间详细信息
          • 3.4、根据ID删除房间信息
          • 3.5、根据id修改房间发布状态
          • 3.6、 根据公寓ID查询房间列表

1、业务介绍

房间管理共有六个接口,分别是

  1. 保存或更新房间信息
  2. 根据条件分页查询详细信息
  3. 根据ID获取房间详情信息
  4. 根据ID删除房间信息
  5. 根据ID修改房间发布状态
  6. 根据公寓ID查询房间信息列表
2、逻辑模型介绍

image-20240616180730823

3、接口开发
3.1、保存或更新房间信息

查看接口

image-20240616180844560

代码开发

  • 查看请求的数据结构

    查看web-admin模块中的com.atguigu.lease.web.admin.vo.room.RoomSubmitVo,内容如下

    @Data
    @Schema(description = "房间信息")
    public class RoomSubmitVo extends RoomInfo {
    
        @Schema(description = "图片列表")
        private List<GraphVo> graphVoList;
    
        @Schema(description = "属性信息列表")
        private List<Long> attrValueIds;
    
        @Schema(description = "配套信息列表")
        private List<Long> facilityInfoIds;
    
        @Schema(description = "标签信息列表")
        private List<Long> labelInfoIds;
    
        @Schema(description = "支付方式列表")
        private List<Long> paymentTypeIds;
    
        @Schema(description = "可选租期列表")
        private List<Long> leaseTermIds;
    }
    
  • 编写Controller层逻辑

    RoomController中增加如下内容

    @Operation(summary = "保存或更新房间信息")
    @PostMapping("saveOrUpdate")
    public Result saveOrUpdate(@RequestBody RoomSubmitVo roomSubmitVo) {
        service.saveOrUpdateRoom(roomSubmitVo);
        return Result.ok();
    }
    
  • 编写Service 层逻辑

    RoomInfoService中增加如下内容

    void saveOrUpdateRoom(RoomSubmitVo roomSubmitVo);
    

    RoomInfoServiceImpl中增加如下内容

    @Override
    public void saveOrUpdateRoom(RoomSubmitVo roomSubmitVo) {
        boolean isUpdate = roomSubmitVo.getId() != null;
        super.saveOrUpdate(roomSubmitVo);
    
        //若为更新操作,则先删除与Room相关的各项信息列表
        if (isUpdate) {
            //1.删除原有graphInfoList
            LambdaQueryWrapper<GraphInfo> graphQueryWrapper = new LambdaQueryWrapper<>();
            graphQueryWrapper.eq(GraphInfo::getItemType, ItemType.ROOM);
            graphQueryWrapper.eq(GraphInfo::getItemId, roomSubmitVo.getId());
            graphInfoService.remove(graphQueryWrapper);
    
            //2.删除原有roomAttrValueList
            LambdaQueryWrapper<RoomAttrValue> attrQueryMapper = new LambdaQueryWrapper<>();
            attrQueryMapper.eq(RoomAttrValue::getRoomId, roomSubmitVo.getId());
            roomAttrValueService.remove(attrQueryMapper);
    
            //3.删除原有roomFacilityList
            LambdaQueryWrapper<RoomFacility> facilityQueryWrapper = new LambdaQueryWrapper<>();
            facilityQueryWrapper.eq(RoomFacility::getRoomId, roomSubmitVo.getId());
            roomFacilityService.remove(facilityQueryWrapper);
    
            //4.删除原有roomLabelList
            LambdaQueryWrapper<RoomLabel> labelQueryWrapper = new LambdaQueryWrapper<>();
            labelQueryWrapper.eq(RoomLabel::getRoomId, roomSubmitVo.getId());
            roomLabelService.remove(labelQueryWrapper);
    
            //5.删除原有paymentTypeList
            LambdaQueryWrapper<RoomPaymentType> paymentQueryWrapper = new LambdaQueryWrapper<>();
            paymentQueryWrapper.eq(RoomPaymentType::getRoomId, roomSubmitVo.getId());
            roomPaymentTypeService.remove(paymentQueryWrapper);
    
    
            //6.删除原有leaseTermList
            LambdaQueryWrapper<RoomLeaseTerm> termQueryWrapper = new LambdaQueryWrapper<>();
            termQueryWrapper.eq(RoomLeaseTerm::getRoomId, roomSubmitVo.getId());
            roomLeaseTermService.remove(termQueryWrapper);
        }
    
        //1.保存新的graphInfoList
        List<GraphVo> graphVoList = roomSubmitVo.getGraphVoList();
        if (!CollectionUtils.isEmpty(graphVoList)) {
            ArrayList<GraphInfo> graphInfoList = new ArrayList<>();
            for (GraphVo graphVo : graphVoList) {
                GraphInfo graphInfo = new GraphInfo();
                graphInfo.setItemType(ItemType.ROOM);
                graphInfo.setItemId(roomSubmitVo.getId());
                graphInfo.setName(graphVo.getName());
                graphInfo.setUrl(graphVo.getUrl());
                graphInfoList.add(graphInfo);
            }
            graphInfoService.saveBatch(graphInfoList);
        }
    
        //2.保存新的roomAttrValueList
        List<Long> attrValueIds = roomSubmitVo.getAttrValueIds();
        if (!CollectionUtils.isEmpty(attrValueIds)) {
            List<RoomAttrValue> roomAttrValueList = new ArrayList<>();
            for (Long attrValueId : attrValueIds) {
                RoomAttrValue roomAttrValue = RoomAttrValue.builder().roomId(roomSubmitVo.getId()).attrValueId(attrValueId).build();
                roomAttrValueList.add(roomAttrValue);
            }
            roomAttrValueService.saveBatch(roomAttrValueList);
        }
    
        //3.保存新的facilityInfoList
        List<Long> facilityInfoIds = roomSubmitVo.getFacilityInfoIds();
        if (!CollectionUtils.isEmpty(facilityInfoIds)) {
            List<RoomFacility> roomFacilityList = new ArrayList<>();
            for (Long facilityInfoId : facilityInfoIds) {
                RoomFacility roomFacility = RoomFacility.builder().roomId(roomSubmitVo.getId()).facilityId(facilityInfoId).build();
                roomFacilityList.add(roomFacility);
            }
            roomFacilityService.saveBatch(roomFacilityList);
        }
    
        //4.保存新的labelInfoList
        List<Long> labelInfoIds = roomSubmitVo.getLabelInfoIds();
        if (!CollectionUtils.isEmpty(labelInfoIds)) {
            ArrayList<RoomLabel> roomLabelList = new ArrayList<>();
            for (Long labelInfoId : labelInfoIds) {
                RoomLabel roomLabel = RoomLabel.builder().roomId(roomSubmitVo.getId()).labelId(labelInfoId).build();
                roomLabelList.add(roomLabel);
            }
            roomLabelService.saveBatch(roomLabelList);
        }
    
        //5.保存新的paymentTypeList
        List<Long> paymentTypeIds = roomSubmitVo.getPaymentTypeIds();
        if (!CollectionUtils.isEmpty(paymentTypeIds)) {
            ArrayList<RoomPaymentType> roomPaymentTypeList = new ArrayList<>();
            for (Long paymentTypeId : paymentTypeIds) {
                RoomPaymentType roomPaymentType = RoomPaymentType.builder().roomId(roomSubmitVo.getId()).paymentTypeId(paymentTypeId).build();
                roomPaymentTypeList.add(roomPaymentType);
            }
            roomPaymentTypeService.saveBatch(roomPaymentTypeList);
        }
    
        //6.保存新的leaseTermList
        List<Long> leaseTermIds = roomSubmitVo.getLeaseTermIds();
        if (!CollectionUtils.isEmpty(leaseTermIds)) {
            ArrayList<RoomLeaseTerm> roomLeaseTerms = new ArrayList<>();
            for (Long leaseTermId : leaseTermIds) {
                RoomLeaseTerm roomLeaseTerm = RoomLeaseTerm.builder().roomId(roomSubmitVo.getId()).leaseTermId(leaseTermId).build();
                roomLeaseTerms.add(roomLeaseTerm);
            }
            roomLeaseTermService.saveBatch(roomLeaseTerms);
        }
    }
    
3.2、根据条件分页查询详细信息

查看接口

image-20240616181117766

代码开发

  • 查看请求和响应的数据结构

    • 请求数据结构

      • currentsize为分页相关参数,分别表示当前所处页面每个页面的记录数

      • RoomQueryVo为房间的查询条件,详细结构如下:

        @Schema(description = "房间查询实体")
        @Data
        public class RoomQueryVo {
        
            @Schema(description = "省份Id")
            private Long provinceId;
        
            @Schema(description = "城市Id")
            private Long cityId;
        
            @Schema(description = "区域Id")
            private Long districtId;
        
            @Schema(description = "公寓Id")
            private Long apartmentId;
        }
        
    • 响应数据结构

      单个房间信息记录可查看com.atguigu.lease.web.admin.vo.room.RoomItemVo,内容如下:

      @Data
      @Schema(description = "房间信息")
      public class RoomItemVo extends RoomInfo {
      
          @Schema(description = "租约结束日期")
          private Date leaseEndDate;
      
          @Schema(description = "当前入住状态")
          private Boolean isCheckIn;
      
          @Schema(description = "所属公寓信息")
          private ApartmentInfo apartmentInfo;
      }
      
  • 编写Controller层逻辑

    RoomController中增加如下内容

    @Operation(summary = "根据条件分页查询房间列表")
    @GetMapping("pageItem")
    public Result<IPage<RoomItemVo>> pageItem(@RequestParam long current, @RequestParam long size, RoomQueryVo queryVo) {
        IPage<RoomItemVo> page = new Page<>(current, size);
        IPage<RoomItemVo> result = service.pageRoomItemByQuery(page, queryVo);
        return Result.ok(result);
    }
    
  • 编写Service 层逻辑

    • RoomInfoService中增加如下内容

      IPage<RoomItemVo> pageRoomItemByQuery(IPage<RoomItemVo> page, RoomQueryVo queryVo);
      
    • RoomInfoServiceImpl中增加如下内容

      @Override
      public IPage<RoomItemVo> pageRoomItemByQuery(IPage<RoomItemVo> page, RoomQueryVo queryVo) {
          return roomInfoMapper.pageRoomItemByQuery(page, queryVo);
      }
      
  • 编写Mapper层逻辑

    • RoomInfoMapper中增加如下内容

      IPage<RoomItemVo> pageRoomItemByQuery(IPage<RoomItemVo> page, RoomQueryVo queryVo);
      
    • RoomInfoMapper.xml中增加如下内容

      <resultMap id="RoomItemVoMap" type="com.atguigu.lease.web.admin.vo.room.RoomItemVo" autoMapping="true">
          <id property="id" column="id"/>
          <association property="apartmentInfo" javaType="com.atguigu.lease.model.entity.ApartmentInfo" autoMapping="true">
              <id property="id" column="apart_id"/>
              <result property="isRelease" column="apart_is_release"/>
          </association>
      </resultMap>
      
      <select id="pageRoomItemByQuery" resultMap="RoomItemVoMap">
          select ri.id,
                 ri.room_number,
                 ri.rent,
                 ri.apartment_id,
                 ri.is_release,
                 la.room_id is not null is_check_in,
                 la.lease_end_date,
                 ai.id                  apart_id,
                 ai.name,
                 ai.introduction,
                 ai.district_id,
                 ai.district_name,
                 ai.city_id,
                 ai.city_name,
                 ai.province_id,
                 ai.province_name,
                 ai.address_detail,
                 ai.latitude,
                 ai.longitude,
                 ai.phone,
                 ai.is_release          apart_is_release
          from room_info ri
                   left join lease_agreement la
                             on ri.id = la.room_id
                                 and la.is_deleted = 0
                                 and la.status in (2,5)
                   left join apartment_info ai
                             on ri.apartment_id = ai.id
                                 and ai.is_deleted = 0
          <where>
              ri.is_deleted = 0
              <if test="queryVo.provinceId != null">
                  apart.province_id = #{queryVo.provinceId}
              </if>
              <if test="queryVo.cityId != null">
                  and apart.city_id = #{queryVo.cityId}
              </if>
              <if test="queryVo.districtId != null">
                  and apart.district_id = #{queryVo.districtId}
              </if>
              <if test="queryVo.apartmentId != null">
                  and apartment_id = #{queryVo.apartmentId}
              </if>
          </where>
      </select>
      
3.3、根据id获取房间详细信息

查看接口

image-20240616181322669

代码开发

  • 查看响应数据结构

    查看web-admin下的com.atguigu.lease.web.admin.vo.room.RoomDetailVo,内容如下

    @Schema(description = "房间信息")
    @Data
    public class RoomDetailVo extends RoomInfo {
    
        @Schema(description = "所属公寓信息")
        private ApartmentInfo apartmentInfo;
    
        @Schema(description = "图片列表")
        private List<GraphVo> graphVoList;
    
        @Schema(description = "属性信息列表")
        private List<AttrValueVo> attrValueVoList;
    
        @Schema(description = "配套信息列表")
        private List<FacilityInfo> facilityInfoList;
    
        @Schema(description = "标签信息列表")
        private List<LabelInfo> labelInfoList;
    
        @Schema(description = "支付方式列表")
        private List<PaymentType> paymentTypeList;
    
        @Schema(description = "可选租期列表")
        private List<LeaseTerm> leaseTermList;
    }
    
  • 编写Controller层逻辑

    RoomController中增加如下内容

    @Operation(summary = "根据id获取房间详细信息")
    @GetMapping("getDetailById")
    public Result<RoomDetailVo> getDetailById(@RequestParam Long id) {
        RoomDetailVo roomInfo = service.getRoomDetailById(id);
        return Result.ok(roomInfo);
    }
    
  • 编写Service 层逻辑

    • RoomInfoService中增加如下内容

      RoomDetailVo getRoomDetailById(Long id);
      
    • RoomInfoServiceImpl中增加如下内容

      @Override
      public RoomDetailVo getRoomDetailById(Long id) {
      
          //1.查询RoomInfo
          RoomInfo roomInfo = roomInfoMapper.selectById(id);
      
          //2.查询所属公寓信息
          ApartmentInfo apartmentInfo = apartmentInfoMapper.selectById(roomInfo.getApartmentId());
      
          //3.查询graphInfoList
          List<GraphVo> graphVoList = graphInfoMapper.selectListByItemTypeAndId(ItemType.ROOM, id);
      
          //4.查询attrValueList
          List<AttrValueVo> attrvalueVoList = attrValueMapper.selectListByRoomId(id);
      
          //5.查询facilityInfoList
          List<FacilityInfo> facilityInfoList = facilityInfoMapper.selectListByRoomId(id);
      
          //6.查询labelInfoList
          List<LabelInfo> labelInfoList = labelInfoMapper.selectListByRoomId(id);
      
          //7.查询paymentTypeList
          List<PaymentType> paymentTypeList = paymentTypeMapper.selectListByRoomId(id);
      
          //8.查询leaseTermList
          List<LeaseTerm> leaseTermList = leaseTermMapper.selectListByRoomId(id);
      
      
          RoomDetailVo adminRoomDetailVo = new RoomDetailVo();
          BeanUtils.copyProperties(roomInfo, adminRoomDetailVo);
      
          adminRoomDetailVo.setApartmentInfo(apartmentInfo);
          adminRoomDetailVo.setGraphVoList(graphVoList);
          adminRoomDetailVo.setAttrValueVoList(attrvalueVoList);
          adminRoomDetailVo.setFacilityInfoList(facilityInfoList);
          adminRoomDetailVo.setLabelInfoList(labelInfoList);
          adminRoomDetailVo.setPaymentTypeList(paymentTypeList);
          adminRoomDetailVo.setLeaseTermList(leaseTermList);
      
          return adminRoomDetailVo;
      }
      
    • 编写Mapper层逻辑

      • 编写房间属性查询逻辑

        • AttrValueMapper中增加如下内容

          List<AttrValueVo> selectListByRoomId(Long id);
          
        • AttrValueMapper.xml中增加如下内容

          <select id="selectListByRoomId" resultType="com.atguigu.lease.web.admin.vo.attr.AttrValueVo">
              select v.id,
                     v.name,
                     v.attr_key_id,
                     k.name attr_key_name
              from attr_value v
                       join attr_key k on v.attr_key_id = k.id
              where v.is_deleted = 0
                and k.is_deleted = 0
                and v.id in (select attr_value_id
                             from room_attr_value
                             where is_deleted = 0
                               and room_id = #{id})
          </select>
          
      • 编写房间配套查询逻辑

        • FacilityInfoMapper中增加如下内容

          List<FacilityInfo> selectListByRoomId(Long id);
          
        • FacilityInfoMapper.xml中增加如下内容

          <select id="selectListByRoomId" resultType="com.atguigu.lease.model.entity.FacilityInfo">
              select id,
                     type,
                     name,
                     icon
              from facility_info
              where is_deleted = 0
                and id in
                    (select facility_id
                     from room_facility
                     where is_deleted = 0
                       and room_id = #{id})
          </select>
          
      • 编写房间标签查询逻辑

        • LabelInfoMapper中增加如下内容

          List<LabelInfo> selectListByRoomId(Long id);
          
        • LabelInfoMapper.xml中增加如下内容

          <select id="selectListByRoomId" resultType="com.atguigu.lease.model.entity.LabelInfo">
              select id,
                     type,
                     name
              from label_info
              where is_deleted = 0
                and id in
                    (select label_id
                     from room_label
                     where is_deleted = 0
                       and room_id = #{id})
          </select>
          
      • 编写房间可选支付方式查询逻辑

        • PaymentTypeMapper中增加如下内容

          List<PaymentType> selectListByRoomId(Long id);
          
        • PaymentTypeMapper.xml中增加如下内容

          <select id="selectListByRoomId" resultType="com.atguigu.lease.model.entity.PaymentType">
              select id,
                     name,
                     pay_month_count,
                     additional_info
              from payment_type
              where is_deleted = 0
                and id in
                    (select payment_type_id
                     from room_payment_type
                     where is_deleted = 0
                       and room_id = #{id})
          </select> 
          
      • 编写房间可选租期查询逻辑

        • Mapper中增加如下内容

          List<LeaseTerm> selectListByRoomId(Long id);
          
        • Mapper.xml中增加如下内容

          <select id="selectListByRoomId" resultType="com.atguigu.lease.model.entity.LeaseTerm">
              select id,
                     month_count,
                     unit
              from lease_term
              where is_deleted = 0
                and id in (select lease_term_id
                           from room_lease_term
                           where is_deleted = 0
                             and room_id = #{id})
          </select>
          
  • 编写Mapper层逻辑

    • 编写房间属性查询逻辑

      • AttrValueMapper中增加如下内容

        List<AttrValueVo> selectListByRoomId(Long id);
        
      • AttrValueMapper.xml中增加如下内容

        <select id="selectListByRoomId" resultType="com.atguigu.lease.web.admin.vo.attr.AttrValueVo">
            select v.id,
                   v.name,
                   v.attr_key_id,
                   k.name attr_key_name
            from attr_value v
                     join attr_key k on v.attr_key_id = k.id
            where v.is_deleted = 0
              and k.is_deleted = 0
              and v.id in (select attr_value_id
                           from room_attr_value
                           where is_deleted = 0
                             and room_id = #{id})
        </select>
        
    • 编写房间配套查询逻辑

      • FacilityInfoMapper中增加如下内容

        List<FacilityInfo> selectListByRoomId(Long id);
        
      • FacilityInfoMapper.xml中增加如下内容

        <select id="selectListByRoomId" resultType="com.atguigu.lease.model.entity.FacilityInfo">
            select id,
                   type,
                   name,
                   icon
            from facility_info
            where is_deleted = 0
              and id in
                  (select facility_id
                   from room_facility
                   where is_deleted = 0
                     and room_id = #{id})
        </select>
        
    • 编写房间标签查询逻辑

      • LabelInfoMapper中增加如下内容

        List<LabelInfo> selectListByRoomId(Long id);
        
      • LabelInfoMapper.xml中增加如下内容

        <select id="selectListByRoomId" resultType="com.atguigu.lease.model.entity.LabelInfo">
            select id,
                   type,
                   name
            from label_info
            where is_deleted = 0
              and id in
                  (select label_id
                   from room_label
                   where is_deleted = 0
                     and room_id = #{id})
        </select>
        
    • 编写房间可选支付方式查询逻辑

      • PaymentTypeMapper中增加如下内容

        List<PaymentType> selectListByRoomId(Long id);
        
      • PaymentTypeMapper.xml中增加如下内容

        <select id="selectListByRoomId" resultType="com.atguigu.lease.model.entity.PaymentType">
            select id,
                   name,
                   pay_month_count,
                   additional_info
            from payment_type
            where is_deleted = 0
              and id in
                  (select payment_type_id
                   from room_payment_type
                   where is_deleted = 0
                     and room_id = #{id})
        </select> 
        
    • 编写房间可选租期查询逻辑

      • Mapper中增加如下内容

        List<LeaseTerm> selectListByRoomId(Long id);
        
      • Mapper.xml中增加如下内容

        <select id="selectListByRoomId" resultType="com.atguigu.lease.model.entity.LeaseTerm">
            select id,
                   month_count,
                   unit
            from lease_term
            where is_deleted = 0
              and id in (select lease_term_id
                         from room_lease_term
                         where is_deleted = 0
                           and room_id = #{id})
        </select>
        
3.4、根据ID删除房间信息

查看接口

image-20240616181722644

代码开发

  • 编写Controller层逻辑

    RoomController中增加如下内容

    @Operation(summary = "根据id删除房间信息")
    @DeleteMapping("removeById")
    public Result removeById(@RequestParam Long id) {
        service.removeRoomById(id);
        return Result.ok();
    }
    
  • 编写Service 层逻辑

    • RoomInfoService中增加如下内容

      void removeRoomById(Long id);
      
    • RoomInfoServiceImpl中增加如下内容

      @Override
      public void removeRoomById(Long id) {
          //1.删除RoomInfo
          super.removeById(id);
      
          //2.删除graphInfoList
          LambdaQueryWrapper<GraphInfo> graphQueryWrapper = new LambdaQueryWrapper<>();
          graphQueryWrapper.eq(GraphInfo::getItemType, ItemType.ROOM);
          graphQueryWrapper.eq(GraphInfo::getItemId, id);
          graphInfoService.remove(graphQueryWrapper);
      
          //3.删除attrValueList
          LambdaQueryWrapper<RoomAttrValue> attrQueryWrapper = new LambdaQueryWrapper<>();
          attrQueryWrapper.eq(RoomAttrValue::getRoomId, id);
          roomAttrValueService.remove(attrQueryWrapper);
      
          //4.删除facilityInfoList
          LambdaQueryWrapper<RoomFacility> facilityQueryWrapper = new LambdaQueryWrapper<>();
          facilityQueryWrapper.eq(RoomFacility::getRoomId, id);
          roomFacilityService.remove(facilityQueryWrapper);
      
          //5.删除labelInfoList
          LambdaQueryWrapper<RoomLabel> labelQueryWrapper = new LambdaQueryWrapper<>();
          labelQueryWrapper.eq(RoomLabel::getRoomId, id);
          roomLabelService.remove(labelQueryWrapper);
      
          //6.删除paymentTypeList
          LambdaQueryWrapper<RoomPaymentType> paymentQueryWrapper = new LambdaQueryWrapper<>();
          paymentQueryWrapper.eq(RoomPaymentType::getRoomId, id);
          roomPaymentTypeService.remove(paymentQueryWrapper);
      
          //7.删除leaseTermList
          LambdaQueryWrapper<RoomLeaseTerm> termQueryWrapper = new LambdaQueryWrapper<>();
          termQueryWrapper.eq(RoomLeaseTerm::getRoomId, id);
          roomLeaseTermService.remove(termQueryWrapper);
      }
      
3.5、根据id修改房间发布状态

查看接口

image-20240616183331120

代码开发

RoomController中增加如下内容

@Operation(summary = "根据id修改房间发布状态")
@PostMapping("updateReleaseStatusById")
public Result updateReleaseStatusById(Long id, ReleaseStatus status) {
    LambdaUpdateWrapper<RoomInfo> updateWrapper = new LambdaUpdateWrapper<>();
    updateWrapper.eq(RoomInfo::getId, id);
    updateWrapper.set(RoomInfo::getIsRelease, status);
    service.update(updateWrapper);
    return Result.ok();
}
3.6、 根据公寓ID查询房间列表

查看接口

image-20240616183410735

代码开发

RoomController中增加如下内容

@GetMapping("listBasicByApartmentId")
@Operation(summary = "根据公寓id查询房间列表")
public Result<List<RoomInfo>> listBasicByApartmentId(Long id) {
    LambdaQueryWrapper<RoomInfo> queryWrapper = new LambdaQueryWrapper<>();
    queryWrapper.eq(RoomInfo::getApartmentId, id);
    queryWrapper.eq(RoomInfo::getIsRelease, ReleaseStatus.RELEASED);
    List<RoomInfo> roomInfoList = service.list(queryWrapper);
    return Result.ok(roomInfoList);
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1829109.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

缠论再研究1-顶底分型

由于现在不是全职写程序了&#xff0c;看起来不是那么辛苦&#xff0c;终于有点精力重新研究缠论了。 之前做过几个月期货&#xff0c;发现真是太难了&#xff0c;布鲁克斯的书写的好是好&#xff0c;终归还是太过复杂&#xff0c;一时半会吸收不了&#xff0c;加之我们程序员…

【招联消费金融股份】有限公司2024年5月19日【算法开发岗暑期实习】二面试经验分享

招联消费金融股份有限公司2024年5月18日面试经验分享 面试流程&#xff1a;30分钟 面试流程&#xff1a;30分钟 先自我介绍3分钟然后介绍论文和实习&#xff0c;细细问。问对招联了解多少&#xff1f;对实习地点怎么样&#xff1f;反问&#xff0c;正常聊天。 创作不易&#x…

110.平衡二叉树

给定一个二叉树&#xff0c;判断它是否是 平衡二叉树 题解&#xff1a;平衡二叉树 是指该树所有节点的左右子树的深度相差不超过 1。可以采用递归遍历每一个节点&#xff0c;得到其高度&#xff0c;在判断高度时不可避免的要用到其左右子树的高度&#xff0c;所以可以顺便判断出…

ElasticSearch地理空间数据了解

ElasticSearch地理空间数据了解 使用场景 Elasticsearch 的地理空间数据处理功能在现代社会中有着广泛的应用&#xff0c;以下是一些常见的使用场景和方向&#xff1a; 1. 位置搜索和导航 本地服务发现&#xff1a;应用程序可以使用 Elasticsearch 查找用户附近的餐馆、商店…

大数据入门实践一:mac安装Hadoop,Hbase,FLume

一、安装Hadoop 安装hadoop参考此文&#xff0c;关键点是安装JDK和Hadoop的配置&#xff0c;为避免引用文章变收费&#xff0c;我把关键信息摘录如下&#xff1a; jdk安装和配置就不说了(我本机安装了1.8/15/17/21&#xff0c;以17为主&#xff09;&#xff0c;hadoop安装过程…

基于 SSM 框架的二手书交易系统

基于 SSM 框架的二手书交易系统 一、项目介绍二、项目技术栈三、项目运行四、项目演示总结 大家好&#xff0c;这里是程序猿代码之路。在当今环保意识日益增强和资源节约型社会建设的背景下&#xff0c;二手交易作为一种节省资源和降低成本的消费方式越来越受到人们的欢迎。特别…

自定义MyBatis插件

插件原理回顾 在前面&#xff0c;我们通过 MyBatis插件机制介绍与原理 分析了 MyBatis 插件的基本原理&#xff0c;但是可能还只是理论上的分析&#xff0c;没有实战的锻炼可能理解的还是不够透彻。接下来&#xff0c;我们通过自定义插件实例来进一步深度理解 MyBatis 插件的插…

【gitcode】idea 在本地拉取和push本地代码到gitcode仓库

【首次使用】 1、idea 拉取代码&#xff0c;很容易这里就不记录了。 2、push代码时&#xff0c;总是弹窗登录输入在gitcode.com登录能成功。但是在idea 怎么都不成功。控制台提示 remote: HTTP Basic: Access denied fatal: Authentication failed for ******* 认证失败 3…

如何解决javadoc一直找不到路径的问题?

目录 一、什么是javadoc二、javadoc为什么会找不到路径三、如何解决javadoc一直找不到路径的问题 一、什么是javadoc Javadoc是一种用于生成Java源代码文档的工具&#xff0c;它可以帮助开发者生成易于阅读和理解的文档。Javadoc通过解析Java源代码中的注释&#xff0c;提取其…

Docker:在DockerHub上创建私有仓库

文章目录 Busybox创建仓库推送镜像到仓库 本篇开始要学习在DockerHub上搭建一个自己的私有仓库 Busybox Busybox是一个集成了三百多个最常用Linux命令和工具的软件&#xff0c;BusyBox包含了很多工具&#xff0c;这里拉取该镜像推送到仓库中&#xff1a; 安装 apt install …

Javaweb06-Jsp技术

Jsp技术 一.Jsp的运行原理 **概述&#xff1a;**JSP是Java服务器页面&#xff0c;既可以写静态页面代码&#xff0c;也可以写动态页面代码 **特点&#xff1a;**跨平台性&#xff0c;业务代码相分离&#xff0c;组件重用&#xff0c;预编译 运行原理&#xff1a; 客户端发生…

页面置换算法的模拟实现

一. 实验内容 1. 假设某一个进程&#xff0c;在运行过程中需要访问的内容依次在320个地址中。为了模拟产生320个地址的值。首先实现在main函数中调用下面的函数随机产生320个地址的地址序列。 #include<unistd.h> void randarray(int a[],int k) { int i; float s;…

使用自定义注解进行权限校验

一&#xff0c;前言 对于一些重复性的操作我们可以用提取为util的方式进行处理&#xff0c;但也可以更简便一些&#xff0c;比如自定义个注解进行。选择看这篇文章的小伙伴想必都对注解不陌生&#xff0c;但是可能对它的工作原理不太清楚。这里我们用注解实现对接口的权限校验…

长亭网络通信基础2

DNAT 默认路由配置方式 VRRP 买两个路由器 拥有两个虚拟网关地址 当一个路由器坏了还能进行正常上网 相当于三层闭合 提供功能 长亭笔试考题解析 三层交换机结合了路由器和交换机的特点 交换机没有路由表 不在同一网段 不能直接通信 可以给交换机VLANif 给接口配置ip地址 先…

【云岚到家】-day03-1-门户等缓存方案选择

【云岚到家】-day03-1-门户-缓存方案选择 1 门户1.1 门户简介1.2 常见的技术方案1.2.1 需求1.2.2 常见门户1.2.2.1 Web门户1.2.2.2 移动应用门户1.2.2.3 总结 2 缓存技术方案2.1 需求分析2.1.1 界面原型2.2.2 缓存需求 3 SpringCache入门3.1 基础概念3.1.1 Redis客户端3.1.2 Sp…

循环队列

循环队列是一种线性数据结构&#xff0c;其操作表现基于 FIFO&#xff08;First In First Out&#xff0c;先进先出&#xff09;原则并且队尾被连接在队首以形成一个循环。 这种结构克服了普通队列在元素入队和出队时需要移动大量元素的缺点。 在循环队列中&#xff0c;当元素…

轻松上手MYSQL:探索MySQL索引数据结构的奥秘-让数据库飞起来

​&#x1f308; 个人主页&#xff1a;danci_&#x1f525; 系列专栏&#xff1a;《设计模式》《MYSQL》&#x1f4aa;&#x1f3fb; 制定明确可量化的目标&#xff0c;坚持默默的做事。 ✨欢迎加入探索MYSQL索引数据结构之旅✨ &#x1f44b; 大家好&#xff01;文本学习研…

Hadoop的读写流程

Hadoop分布式文件系统(HDFS)是Apache Hadoop项目的核心组件,它为大数据存储提供了一个可靠、可扩展的存储解决方案。本文将详细介绍HDFS的读写数据流程,包括数据的存储原理、读写过程以及优化策略。 一、HDFS简介 HDFS是一个高度容错的分布式文件系统,它设计用于运行在通…

python包管理器--- pip、conda、mamba的比较

1 pip 1.1 简介 pip是一个 Python 的包&#xff08;Package&#xff09;管理工具&#xff0c;用于从 PyPI 安装和管理 Python 标准库之外的其他包&#xff08;第三方包&#xff09;。从 Python 3.4 起&#xff0c;pip 已经成为 Python 安装程序的一部分&#xff0c;也是官方标准…

【chatbot-api开源项目】开发文档

chatbot-api 1. 需求分析1-1. 需求分析1-2. 系统流程图 2. 技术选型3. 项目开发3-1. 项目初始化3-2. 爬取接口获取问题接口回答问题接口创建对应对象 3-3. 调用AI3-4. 定时自动化回答 4. Docker部署5. 扩展5-1. 如果cookie失效了怎么处理5-2. 如何更好的对接多个回答系统 Gitee…