Browse Source

merge

release/v1.0.0
yueminglinxia 4 years ago
parent
commit
2f53597fc8
  1. 6
      air/src/main/java/com/air/housing/controller/BlocksController.java
  2. 14
      air/src/main/java/com/air/housing/controller/HousingEstatesController.java
  3. 1
      air/src/main/java/com/air/housing/entity/HousingEstates.java
  4. 3
      air/src/main/java/com/air/housing/service/BlocksService.java
  5. 4
      air/src/main/java/com/air/housing/service/HousingEstatesService.java
  6. 2
      air/src/main/java/com/air/housing/service/impl/BlocksServiceImpl.java
  7. 6
      air/src/main/java/com/air/housing/service/impl/HousingEstatesServiceImpl.java
  8. 20
      air/src/main/resources/mapper/BlocksMapper.xml

6
air/src/main/java/com/air/housing/controller/BlocksController.java

@ -40,9 +40,9 @@ public class BlocksController {
return R.ok(blocksService.page(page, Wrappers.query(blocks)));
}
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
public R getBlocksPageByHousingEstatesId(Page page, BlockListDto blocks) {
@ApiOperation(value = "根据楼盘id分页查询", notes = "根据楼盘id分页查询")
@PostMapping("/getPageByHousingEstatesId")
public R getBlocksPageByHousingEstatesId(Page page, @RequestBody BlockListDto blocks) {
return R.ok(blocksService.getBlocksPageByHousingEstatesId(page,blocks));
}
/**

14
air/src/main/java/com/air/housing/controller/HousingEstatesController.java

@ -1,17 +1,11 @@
package com.air.housing.controller;
import cn.hutool.core.util.StrUtil;
import com.air.housing.dto.HousingDefine;
import com.air.housing.entity.Format;
import com.air.housing.entity.HousingEstates;
import com.air.housing.service.FormatService;
import com.air.housing.service.HousingEstatesService;
import com.air.housing.vo.HousingEstatesDetail;
import com.air.housing.vo.HousingEstatesName;
import com.air.land.entity.LandListed;
import com.air.land.service.LandListedService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.cinderella.framework.common.core.util.R;
import com.cinderella.framework.common.data.mybatis.QueryPage;
@ -36,10 +30,6 @@ public class HousingEstatesController {
private final HousingEstatesService housingEstatesService;
private final FormatService formatService;
private final LandListedService landListedService;
/**
* 分页查询
@ -73,7 +63,7 @@ public class HousingEstatesController {
* @param housingEstatesId id
* @return R
*/
@ApiOperation(value = "通过id查询", notes = "通过id查询")
@ApiOperation(value = "通过id查询详情", notes = "通过id查询详情")
@GetMapping("/{housingEstatesId}")
public R getById(@PathVariable("housingEstatesId") Long housingEstatesId,Long blockId) {
HousingEstatesDetail housingEstates = housingEstatesService.getHousingEstatesDetail(housingEstatesId,blockId);
@ -88,7 +78,7 @@ public class HousingEstatesController {
*/
@ApiOperation(value = "新增楼盘(小区)", notes = "新增楼盘(小区)")
@PostMapping
@PreAuthorize("@pms.hasPermission('generator_housingestates_add')")
// @PreAuthorize("@pms.hasPermission('generator_housingestates_add')")
public R save(@RequestBody HousingEstates housingEstates) {
return R.ok(housingEstatesService.save(housingEstates));
}

1
air/src/main/java/com/air/housing/entity/HousingEstates.java

@ -1,5 +1,6 @@
package com.air.housing.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

3
air/src/main/java/com/air/housing/service/BlocksService.java

@ -13,7 +13,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface BlocksService extends IService<Blocks> {
/**
* 根据楼盘id,大业态小业态查询楼栋分页信息
* query by housing_estates_id and largeFormat,format
* @param page
* @param blockListDto
* @return
*/

4
air/src/main/java/com/air/housing/service/HousingEstatesService.java

@ -35,9 +35,9 @@ public interface HousingEstatesService extends IService<HousingEstates> {
/**
* 根据楼盘id查询楼盘信息和相关的地块信息如果楼栋个id不为空再查询业态信息
* @param estateId
* @param housingEstatesId
* @param blockId
* @return
*/
HousingEstatesDetail getHousingEstatesDetail(Long estateId,Long blockId);
HousingEstatesDetail getHousingEstatesDetail(Long housingEstatesId,Long blockId);
}

2
air/src/main/java/com/air/housing/service/impl/BlocksServiceImpl.java

@ -24,6 +24,6 @@ public class BlocksServiceImpl extends ServiceImpl<BlocksMapper, Blocks> impleme
@Override
public Page<Blocks> getBlocksPageByHousingEstatesId(Page page,BlockListDto blockListDto) {
return null;
return blocksMapper.getBlocksPageByHousingEstatesId(page,blockListDto);
}
}

6
air/src/main/java/com/air/housing/service/impl/HousingEstatesServiceImpl.java

@ -100,14 +100,14 @@ public class HousingEstatesServiceImpl extends ServiceImpl<HousingEstatesMapper,
}
@Override
public HousingEstatesDetail getHousingEstatesDetail(Long HousingEstateId, Long blockId) {
HousingEstates housingEstates = housingEstatesMapper.selectById(HousingEstateId);
public HousingEstatesDetail getHousingEstatesDetail(Long housingEstatesId, Long blockId) {
HousingEstates housingEstates = baseMapper.selectById(housingEstatesId);
LandListed landListed = landListedService.getOne(Wrappers.<LandListed>lambdaQuery().eq(LandListed::getAnnoId,housingEstates.getAnnoId()));
HousingEstatesDetail detail = new HousingEstatesDetail();
detail.setHousingEstates(housingEstates);
detail.setLandListed(landListed);
if(ObjectUtil.isNotNull(blockId)){
Format format = formatService.getOne(Wrappers.<Format>lambdaQuery().eq(Format::getHousingEstateId,HousingEstateId));
Format format = formatService.getOne(Wrappers.<Format>lambdaQuery().eq(Format::getHousingEstateId,housingEstatesId));
detail.setFormat(format);
}
return detail;

20
air/src/main/resources/mapper/BlocksMapper.xml

@ -3,7 +3,25 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.air.housing.mapper.BlocksMapper">
<sql id="base_block_column">
b.block_id,b.housing_estates_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
</sql>
<select id="getBlocksPageByHousingEstatesId" parameterType="com.air.housing.dto.BlockListDto" resultType="com.air.housing.entity.Blocks">
select
select <include refid="base_block_column"/>
from BLOCKS b where b.status_cd = 1000
<choose>
<when test="Blocks.largeFormat !=null and Blocks.format == null">
join FORMAT f ON b.housing_estates_id = f.housing_estates_id and f.large_format = #{Blocks.largeFormat}
</when>
<when test="Blocks.largeFormat ==null and Blocks.format != null">
join FORMAT f ON b.housing_estates_id = f.housing_estates_id and f.format = #{format}
</when>
<when test="Blocks.largeFormat !=null and Blocks.format != null">
join FORMAT f ON b.housing_estates_id = f.housing_estates_id and f.format = #{format} and f.large_format = #{Blocks.largeFormat}
</when>
</choose>
and b.housing_estates_id = #{Blocks.housingEstatesId}
</select>
</mapper>

Loading…
Cancel
Save