From 57f5ce64e2b06973362247b67ebd6433a85cf19a Mon Sep 17 00:00:00 2001 From: peihao <1280253838@qq.com> Date: Wed, 14 Jul 2021 15:28:54 +0800 Subject: [PATCH] =?UTF-8?q?1.0.0=20=E4=BF=AE=E6=94=B9=E6=A5=BC=E7=9B=98?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/HousingEstatesController.java | 5 +- .../housing/dto/HousingEstatesListDto.java | 43 +++++++++++++++ .../air/housing/dto/HousingEstatesQuery.java | 29 +++++----- .../com/air/housing/entity/AnnoBlocksRel.java | 54 +++++++++++++++++++ .../java/com/air/housing/entity/Blocks.java | 4 +- .../air/housing/entity/HousingEstates.java | 9 ---- .../housing/mapper/AnnoBlocksRelMapper.java | 13 +++++ .../housing/mapper/HousingEstatesMapper.java | 6 +-- .../housing/service/AnnoBlocksRelService.java | 14 +++++ .../service/HousingEstatesService.java | 7 ++- .../impl/AnnoBlocksRelServiceImpl.java | 18 +++++++ .../impl/HousingEstatesServiceImpl.java | 35 ++++++------ .../air/housing/vo/HousingEstatesListVO.java | 31 ----------- .../main/resources/mapper/BlocksMapper.xml | 15 ++++-- .../resources/mapper/HousingEstatesMapper.xml | 36 +++++++------ 15 files changed, 214 insertions(+), 105 deletions(-) create mode 100644 air/src/main/java/com/air/housing/dto/HousingEstatesListDto.java create mode 100644 air/src/main/java/com/air/housing/entity/AnnoBlocksRel.java create mode 100644 air/src/main/java/com/air/housing/mapper/AnnoBlocksRelMapper.java create mode 100644 air/src/main/java/com/air/housing/service/AnnoBlocksRelService.java create mode 100644 air/src/main/java/com/air/housing/service/impl/AnnoBlocksRelServiceImpl.java delete mode 100644 air/src/main/java/com/air/housing/vo/HousingEstatesListVO.java diff --git a/air/src/main/java/com/air/housing/controller/HousingEstatesController.java b/air/src/main/java/com/air/housing/controller/HousingEstatesController.java index fa441c8..d542f53 100644 --- a/air/src/main/java/com/air/housing/controller/HousingEstatesController.java +++ b/air/src/main/java/com/air/housing/controller/HousingEstatesController.java @@ -30,7 +30,6 @@ public class HousingEstatesController { private final HousingEstatesService housingEstatesService; - /** * 分页查询 * @@ -65,8 +64,8 @@ public class HousingEstatesController { */ @ApiOperation(value = "通过id查询详情", notes = "通过id查询详情") @GetMapping("/{housingEstateId}") - public R getById(@PathVariable("housingEstateId") Long housingEstateId,Long blockId) { - HousingEstatesDetail housingEstates = housingEstatesService.getHousingEstatesDetail(housingEstateId,blockId); + public R getById(@PathVariable("housingEstateId") Long housingEstateId) { + HousingEstatesDetail housingEstates = housingEstatesService.getHousingEstatesDetail(housingEstateId); return R.ok(housingEstates); } diff --git a/air/src/main/java/com/air/housing/dto/HousingEstatesListDto.java b/air/src/main/java/com/air/housing/dto/HousingEstatesListDto.java new file mode 100644 index 0000000..43b9602 --- /dev/null +++ b/air/src/main/java/com/air/housing/dto/HousingEstatesListDto.java @@ -0,0 +1,43 @@ +package com.air.housing.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + + +/** + * 楼盘列表返回参数 + * + * @author peihao + * @date 2021/7/13 + **/ +@Data +@ApiModel +public class HousingEstatesListDto { + @ApiModelProperty(value = "楼盘id") + private Long housingEstateId; + + @ApiModelProperty(value = "楼盘名称") + private String name; + + @ApiModelProperty(value = "公告编号") + private String landCode; + + @ApiModelProperty(value = "行政区") + private String canton; + + @ApiModelProperty(value = "大组团") + private String bigGroup; + + @ApiModelProperty(value = "小组团") + private String smallGroup; + + @ApiModelProperty(value = "操盘企业") + private String tradingEnterprises; + + @ApiModelProperty(value = "合作方") + private String partner; + + @ApiModelProperty(value = "经营企业") + private String conductEnterprise; +} diff --git a/air/src/main/java/com/air/housing/dto/HousingEstatesQuery.java b/air/src/main/java/com/air/housing/dto/HousingEstatesQuery.java index 6d9fe43..4b4afd9 100644 --- a/air/src/main/java/com/air/housing/dto/HousingEstatesQuery.java +++ b/air/src/main/java/com/air/housing/dto/HousingEstatesQuery.java @@ -1,37 +1,36 @@ package com.air.housing.dto; -import com.air.housing.entity.HousingEstates; -import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; -import org.springframework.format.annotation.DateTimeFormat; -import java.time.LocalDateTime; /** - * @author zeb. - * Created by zeb on 2021/6/9. - */ + * 楼盘查询条件 + * @author peihao + * @date 2021/7/13 + **/ @Data @EqualsAndHashCode -@ApiModel +@ApiModel(value = "楼盘查询条件") public class HousingEstatesQuery { + @ApiModelProperty(value = "公告编号") - private String annoId; + private String landCode; + @ApiModelProperty(value = "楼盘名称") private String name; - @ApiModelProperty(value = "业态") - private String format; + @ApiModelProperty(value = "区域") - private String area; + private String canton; + @ApiModelProperty(value = "大组团") private String bigGroup; + @ApiModelProperty(value = "小组团") private String smallGroup; - @ApiModelProperty(value = "日期,格式yyyy-MM-dd") - private String createDate; + @ApiModelProperty(value = "开发企业") - private String program; + private String conductEnterprise; } diff --git a/air/src/main/java/com/air/housing/entity/AnnoBlocksRel.java b/air/src/main/java/com/air/housing/entity/AnnoBlocksRel.java new file mode 100644 index 0000000..b1766e2 --- /dev/null +++ b/air/src/main/java/com/air/housing/entity/AnnoBlocksRel.java @@ -0,0 +1,54 @@ +package com.air.housing.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.activerecord.Model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.time.LocalDateTime; + +/** + * 地块楼盘关联表 + * + * @author peihao + * @date 2021/5/18 + **/ +@Data +@TableName("anno_blocks_rel") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "地块楼盘关联表") +public class AnnoBlocksRel extends Model { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "楼盘id") + private Long housingEstatesId; + + @ApiModelProperty(value = "地块id") + private String landListedId; + + @ApiModelProperty(value = "是否主要地块(0:否,1:是)") + private Integer mainLand; + + @ApiModelProperty(value = "状态") + private String statusCd; + + @ApiModelProperty(value = "状态时间") + private LocalDateTime statusDate; + + @ApiModelProperty(value = "创建人") + private String createUserId; + + @ApiModelProperty(value = "创建时间") + private LocalDateTime createDate; + + @ApiModelProperty(value = "修改人") + private String updateUserId; + + @ApiModelProperty(value = "修改时间") + private LocalDateTime updateDate; + + @ApiModelProperty(value = "备注") + private String remark; +} diff --git a/air/src/main/java/com/air/housing/entity/Blocks.java b/air/src/main/java/com/air/housing/entity/Blocks.java index cf3e60f..cf63bf6 100644 --- a/air/src/main/java/com/air/housing/entity/Blocks.java +++ b/air/src/main/java/com/air/housing/entity/Blocks.java @@ -43,10 +43,10 @@ public class Blocks extends Model { @ApiModelProperty(value = "物业类型") private String propertyType; - @ApiModelProperty(value = "物业类型") + @ApiModelProperty(value = "大业态") private String largeFormat; - @ApiModelProperty(value = "物业类型") + @ApiModelProperty(value = "小业态") @TableField(value = "`format`") private String format; diff --git a/air/src/main/java/com/air/housing/entity/HousingEstates.java b/air/src/main/java/com/air/housing/entity/HousingEstates.java index 80c95fa..5742817 100644 --- a/air/src/main/java/com/air/housing/entity/HousingEstates.java +++ b/air/src/main/java/com/air/housing/entity/HousingEstates.java @@ -28,12 +28,6 @@ public class HousingEstates extends Model { @ApiModelProperty(value = "楼盘id") private Long housingEstateId; - @ApiModelProperty(value = "公告id") - private String annoId; - - @ApiModelProperty(value = "公告id") - private String otherAnnoIds; - @ApiModelProperty(value = "楼盘名称") private String name; @@ -55,9 +49,6 @@ public class HousingEstates extends Model { @ApiModelProperty(value = "修改时间") private LocalDateTime updateDate; -// @ApiModelProperty(value = "已挂牌地块id") -// private Long landListedId; - @ApiModelProperty(value = "备注") private String remark; diff --git a/air/src/main/java/com/air/housing/mapper/AnnoBlocksRelMapper.java b/air/src/main/java/com/air/housing/mapper/AnnoBlocksRelMapper.java new file mode 100644 index 0000000..9f0fe28 --- /dev/null +++ b/air/src/main/java/com/air/housing/mapper/AnnoBlocksRelMapper.java @@ -0,0 +1,13 @@ +package com.air.housing.mapper; + +import com.air.housing.entity.AnnoBlocksRel; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * 地块楼盘关联表 + * + * @author peihao + * @date 2021-05-18 09:39:45 + */ +public interface AnnoBlocksRelMapper extends BaseMapper { +} diff --git a/air/src/main/java/com/air/housing/mapper/HousingEstatesMapper.java b/air/src/main/java/com/air/housing/mapper/HousingEstatesMapper.java index 70caf5c..296f61f 100644 --- a/air/src/main/java/com/air/housing/mapper/HousingEstatesMapper.java +++ b/air/src/main/java/com/air/housing/mapper/HousingEstatesMapper.java @@ -2,13 +2,11 @@ package com.air.housing.mapper; import com.air.housing.dto.HousingEstatesQuery; import com.air.housing.entity.HousingEstates; -import com.air.housing.vo.HousingEstatesListVO; +import com.air.housing.dto.HousingEstatesListDto; import com.air.housing.vo.HousingEstatesName; import com.baomidou.mybatisplus.annotation.InterceptorIgnore; -import com.baomidou.mybatisplus.annotation.SqlParser; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.cinderella.framework.common.data.mybatis.QueryPage; import org.apache.ibatis.annotations.Param; /** @@ -33,5 +31,5 @@ public interface HousingEstatesMapper extends BaseMapper { * @return */ @InterceptorIgnore - IPage selectIPage(IPage page, @Param("query") HousingEstatesQuery query); + IPage selectIPage(IPage page, @Param("query") HousingEstatesQuery query); } diff --git a/air/src/main/java/com/air/housing/service/AnnoBlocksRelService.java b/air/src/main/java/com/air/housing/service/AnnoBlocksRelService.java new file mode 100644 index 0000000..518ca42 --- /dev/null +++ b/air/src/main/java/com/air/housing/service/AnnoBlocksRelService.java @@ -0,0 +1,14 @@ +package com.air.housing.service; + +import com.air.housing.entity.AnnoBlocksRel; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 地块楼盘关联表 + * + * @author peihao + * @date 2021-05-18 09:39:45 + */ +public interface AnnoBlocksRelService extends IService { + +} diff --git a/air/src/main/java/com/air/housing/service/HousingEstatesService.java b/air/src/main/java/com/air/housing/service/HousingEstatesService.java index a570686..b55a9d8 100644 --- a/air/src/main/java/com/air/housing/service/HousingEstatesService.java +++ b/air/src/main/java/com/air/housing/service/HousingEstatesService.java @@ -4,7 +4,7 @@ import com.air.housing.dto.HousingDefine; import com.air.housing.dto.HousingEstatesQuery; import com.air.housing.entity.HousingEstates; import com.air.housing.vo.HousingEstatesDetail; -import com.air.housing.vo.HousingEstatesListVO; +import com.air.housing.dto.HousingEstatesListDto; import com.air.housing.vo.HousingEstatesName; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; @@ -39,10 +39,9 @@ public interface HousingEstatesService extends IService { /** * 根据楼盘id查询楼盘信息和相关的地块信息,如果楼栋个id不为空,再查询业态信息 * @param housingEstateId - * @param blockId * @return */ - HousingEstatesDetail getHousingEstatesDetail(Long housingEstateId,Long blockId); + HousingEstatesDetail getHousingEstatesDetail(Long housingEstateId); /** * 分页 @@ -50,5 +49,5 @@ public interface HousingEstatesService extends IService { * @param query * @return */ - IPage page(QueryPage page, HousingEstatesQuery query); + IPage page(QueryPage page, HousingEstatesQuery query); } diff --git a/air/src/main/java/com/air/housing/service/impl/AnnoBlocksRelServiceImpl.java b/air/src/main/java/com/air/housing/service/impl/AnnoBlocksRelServiceImpl.java new file mode 100644 index 0000000..f00c0c3 --- /dev/null +++ b/air/src/main/java/com/air/housing/service/impl/AnnoBlocksRelServiceImpl.java @@ -0,0 +1,18 @@ +package com.air.housing.service.impl; + +import com.air.housing.entity.AnnoBlocksRel; +import com.air.housing.mapper.AnnoBlocksRelMapper; +import com.air.housing.service.AnnoBlocksRelService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * 地块楼盘关联表 + * + * @author peihao + * @date 2021-05-18 09:39:45 + */ +@Service +public class AnnoBlocksRelServiceImpl extends ServiceImpl implements AnnoBlocksRelService { + +} diff --git a/air/src/main/java/com/air/housing/service/impl/HousingEstatesServiceImpl.java b/air/src/main/java/com/air/housing/service/impl/HousingEstatesServiceImpl.java index a5a066b..650f14d 100644 --- a/air/src/main/java/com/air/housing/service/impl/HousingEstatesServiceImpl.java +++ b/air/src/main/java/com/air/housing/service/impl/HousingEstatesServiceImpl.java @@ -4,18 +4,16 @@ import cn.hutool.core.util.ObjectUtil; import com.air.common.Constant; import com.air.enums.BlocksOriginStatusEnum; import com.air.housing.dto.HousingDefine; +import com.air.housing.dto.HousingEstatesListDto; import com.air.housing.dto.HousingEstatesQuery; -import com.air.housing.entity.Blocks; -import com.air.housing.entity.Format; -import com.air.housing.entity.Houses; -import com.air.housing.entity.HousingEstates; +import com.air.housing.entity.*; +import com.air.housing.mapper.AnnoBlocksRelMapper; import com.air.housing.mapper.HousingEstatesMapper; import com.air.housing.service.BlocksService; import com.air.housing.service.FormatService; import com.air.housing.service.HousesService; import com.air.housing.service.HousingEstatesService; import com.air.housing.vo.HousingEstatesDetail; -import com.air.housing.vo.HousingEstatesListVO; import com.air.housing.vo.HousingEstatesName; import com.air.land.entity.LandListed; import com.air.land.mapper.LandListedMapper; @@ -57,13 +55,14 @@ public class HousingEstatesServiceImpl extends ServiceImpl getHousingEstatesNamePage(IPage page, String name) { - return housingEstatesMapper.getHousingEstatesNamePage(page, name); } @@ -73,7 +72,7 @@ public class HousingEstatesServiceImpl extends ServiceImpllambdaQuery().eq(LandListed::getAnnoId,housingEstates.getAnnoId())); + public HousingEstatesDetail getHousingEstatesDetail(Long housingEstateId) { HousingEstatesDetail detail = new HousingEstatesDetail(); + HousingEstates housingEstates = baseMapper.selectById(housingEstateId); + if (null == housingEstates) { + return detail; + } detail.setHousingEstates(housingEstates); - detail.setLandListed(landListed); - if(ObjectUtil.isNotNull(blockId)){ - Format format = formatService.getOne(Wrappers.lambdaQuery().eq(Format::getHousingEstateId,housingEstateId)); - detail.setFormat(format); + AnnoBlocksRel annoBlocksRel = annoBlocksRelMapper.selectOne(Wrappers.query().lambda() + .eq(AnnoBlocksRel::getHousingEstatesId, housingEstateId).eq(AnnoBlocksRel::getMainLand, 1)); + if (null != annoBlocksRel) { + LandListed landListed = landListedMapper.selectOne(Wrappers.lambdaQuery() + .eq(LandListed::getLandListedId, annoBlocksRel.getLandListedId())); + detail.setLandListed(landListed); } + Format format = formatService.getOne(Wrappers.lambdaQuery().eq(Format::getHousingEstateId, housingEstateId)); + detail.setFormat(format); return detail; } @Override - public IPage page(QueryPage page, HousingEstatesQuery query) { + public IPage page(QueryPage page, HousingEstatesQuery query) { return baseMapper.selectIPage(page.toPage(), query); } diff --git a/air/src/main/java/com/air/housing/vo/HousingEstatesListVO.java b/air/src/main/java/com/air/housing/vo/HousingEstatesListVO.java deleted file mode 100644 index dfe4c3f..0000000 --- a/air/src/main/java/com/air/housing/vo/HousingEstatesListVO.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.air.housing.vo; - -import com.air.housing.entity.HousingEstates; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import org.springframework.format.annotation.DateTimeFormat; - -import java.time.LocalDateTime; - -/** - * @author zeb. - * Created by zeb on 2021/6/9. - */ -@Data -@EqualsAndHashCode(callSuper = true) -@ApiModel -public class HousingEstatesListVO extends HousingEstates { - @ApiModelProperty(value = "其他编号") - private String otherNo; - @ApiModelProperty(value = "大组团") - private String bigGroup; - @ApiModelProperty(value = "小组团") - private String smallGroup; - @ApiModelProperty(value = "日期,格式yyyy-MM-dd") - @JsonFormat(pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern = "yyyy-MM-dd") - private LocalDateTime createDate; -} diff --git a/air/src/main/resources/mapper/BlocksMapper.xml b/air/src/main/resources/mapper/BlocksMapper.xml index d6fe0a7..507bb13 100644 --- a/air/src/main/resources/mapper/BlocksMapper.xml +++ b/air/src/main/resources/mapper/BlocksMapper.xml @@ -3,12 +3,17 @@ - - b.block_id,b.housing_estate_id,b.pre_sale_permit_no,b.block_name,b.status_cd,b.status_date,b.create_user_id,b.create_date,b.update_user_id,b.update_date,b.remark - - - select h.housing_estate_id, - h.anno_id, - h.other_anno_ids, + l.land_code, h.`name`, - h.status_cd, - h.status_date, - h.create_user_id, - h.create_date, - h.update_user_id, - h.update_date, - h.remark, + l.canton, + l.trading_enterprises, + l.partner, + l.conduct_enterprise, l.big_group, l.small_group - from housing_estates h - join land_listed l on h.anno_id = l.anno_id + FROM + housing_estates h + JOIN anno_blocks_rel an ON h.housing_estate_id = an.housing_estates_id and an.main_land = 1 + JOIN land_listed l on l.land_listed_id = an.land_listed_id and h.name like concat('%', #{query.name}, '%') - - and h.anno_id like concat('%', #{query.annoId}, '%') + + and l.land_code like concat('%', #{query.landCode}, '%') + + + and l.canton = #{query.canton} + + + and l.conductEnterprise like concat('%', #{query.conductEnterprise}, '%') and l.big_group = #{query.bigGroup} @@ -43,9 +47,7 @@ and l.small_group = #{query.smallGroup} - - and h.create_date like concat(#{query.createDate}, '%') - + order by h.housing_estate_id desc