Browse Source

housing_estate_id

release/v1.0.0
zeb 4 years ago
parent
commit
5c3895add0
  1. 16
      air/src/main/java/com/air/controller/AnnoBlocksSecondRelController.java
  2. 2
      air/src/main/java/com/air/entity/AnnoBlocksSecondRel.java
  3. 4
      air/src/main/java/com/air/housing/controller/BlocksController.java
  4. 16
      air/src/main/java/com/air/housing/controller/HousingEstatesController.java
  5. 2
      air/src/main/java/com/air/housing/mapper/BlocksMapper.java
  6. 2
      air/src/main/java/com/air/housing/service/BlocksService.java
  7. 4
      air/src/main/java/com/air/housing/service/HousingEstatesService.java
  8. 4
      air/src/main/java/com/air/housing/service/impl/BlocksServiceImpl.java
  9. 8
      air/src/main/java/com/air/housing/service/impl/HousingEstatesServiceImpl.java
  10. 2
      air/src/main/java/com/air/housing/vo/HousingEstatesName.java
  11. 2
      air/src/main/resources/mapper/BlocksMapper.xml
  12. 6
      air/src/main/resources/mapper/HousingEstatesMapper.xml

16
air/src/main/java/com/air/controller/AnnoBlocksSecondRelController.java

@ -43,13 +43,13 @@ public class AnnoBlocksSecondRelController {
/** /**
* 通过id查询地块公告-楼盘副关联关系主关联键已经写入楼盘业务表了只有出现一对多的情况即一个楼盘跨越多个地块修建才用这个 * 通过id查询地块公告-楼盘副关联关系主关联键已经写入楼盘业务表了只有出现一对多的情况即一个楼盘跨越多个地块修建才用这个
* *
* @param housingEstatesId id * @param housingEstateId id
* @return R * @return R
*/ */
@ApiOperation(value = "通过id查询", notes = "通过id查询") @ApiOperation(value = "通过id查询", notes = "通过id查询")
@GetMapping("/{housingEstatesId}") @GetMapping("/{housingEstateId}")
public R getById(@PathVariable("housingEstatesId") Long housingEstatesId) { public R getById(@PathVariable("housingEstateId") Long housingEstateId) {
return R.ok(annoBlocksSecondRelService.getById(housingEstatesId)); return R.ok(annoBlocksSecondRelService.getById(housingEstateId));
} }
/** /**
@ -81,13 +81,13 @@ public class AnnoBlocksSecondRelController {
/** /**
* 通过id删除地块公告-楼盘副关联关系主关联键已经写入楼盘业务表了只有出现一对多的情况即一个楼盘跨越多个地块修建才用这个 * 通过id删除地块公告-楼盘副关联关系主关联键已经写入楼盘业务表了只有出现一对多的情况即一个楼盘跨越多个地块修建才用这个
* *
* @param housingEstatesId id * @param housingEstateId id
* @return R * @return R
*/ */
@ApiOperation(value = "通过id删除地块(公告)-楼盘副关联关系,主关联键已经写入楼盘业务表了,只有出现一对多的情况,即一个楼盘,跨越多个地块修建,才用这个", notes = "通过id删除地块(公告)-楼盘副关联关系,主关联键已经写入楼盘业务表了,只有出现一对多的情况,即一个楼盘,跨越多个地块修建,才用这个") @ApiOperation(value = "通过id删除地块(公告)-楼盘副关联关系,主关联键已经写入楼盘业务表了,只有出现一对多的情况,即一个楼盘,跨越多个地块修建,才用这个", notes = "通过id删除地块(公告)-楼盘副关联关系,主关联键已经写入楼盘业务表了,只有出现一对多的情况,即一个楼盘,跨越多个地块修建,才用这个")
@DeleteMapping("/{housingEstatesId}") @DeleteMapping("/{housingEstateId}")
@PreAuthorize("@pms.hasPermission('generator_annoblockssecondrel_del')") @PreAuthorize("@pms.hasPermission('generator_annoblockssecondrel_del')")
public R removeById(@PathVariable Long housingEstatesId) { public R removeById(@PathVariable Long housingEstateId) {
return R.ok(annoBlocksSecondRelService.removeById(housingEstatesId)); return R.ok(annoBlocksSecondRelService.removeById(housingEstateId));
} }
} }

2
air/src/main/java/com/air/entity/AnnoBlocksSecondRel.java

@ -27,7 +27,7 @@ public class AnnoBlocksSecondRel extends Model<AnnoBlocksSecondRel> {
@TableId @TableId
@ApiModelProperty(value = "楼盘id") @ApiModelProperty(value = "楼盘id")
private Long housingEstatesId; private Long housingEstateId;
@ApiModelProperty(value = "楼栋id") @ApiModelProperty(value = "楼栋id")
private Long blockId; private Long blockId;

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

@ -42,8 +42,8 @@ public class BlocksController {
@ApiOperation(value = "根据楼盘id分页查询", notes = "根据楼盘id分页查询") @ApiOperation(value = "根据楼盘id分页查询", notes = "根据楼盘id分页查询")
@GetMapping("/page") @GetMapping("/page")
public R getBlocksPageByHousingEstatesId(Page page, BlockListDto blocks) { public R getBlocksPageByhousingEstateId(Page page, BlockListDto blocks) {
return R.ok(blocksService.getBlocksPageByHousingEstatesId(page,blocks)); return R.ok(blocksService.getBlocksPageByhousingEstateId(page,blocks));
} }
/** /**
* 通过id查询楼栋信息 * 通过id查询楼栋信息

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

@ -60,13 +60,13 @@ public class HousingEstatesController {
/** /**
* 通过id查询楼盘小区 * 通过id查询楼盘小区
* *
* @param housingEstatesId id * @param housingEstateId id
* @return R * @return R
*/ */
@ApiOperation(value = "通过id查询详情", notes = "通过id查询详情") @ApiOperation(value = "通过id查询详情", notes = "通过id查询详情")
@GetMapping("/{housingEstatesId}") @GetMapping("/{housingEstateId}")
public R getById(@PathVariable("housingEstatesId") Long housingEstatesId,Long blockId) { public R getById(@PathVariable("housingEstateId") Long housingEstateId,Long blockId) {
HousingEstatesDetail housingEstates = housingEstatesService.getHousingEstatesDetail(housingEstatesId,blockId); HousingEstatesDetail housingEstates = housingEstatesService.getHousingEstatesDetail(housingEstateId,blockId);
return R.ok(housingEstates); return R.ok(housingEstates);
} }
@ -98,12 +98,12 @@ public class HousingEstatesController {
/** /**
* 通过id删除楼盘小区 * 通过id删除楼盘小区
* *
* @param housingEstatesId id * @param housingEstateId id
* @return R * @return R
*/ */
@ApiOperation(value = "通过id删除楼盘(小区)", notes = "通过id删除楼盘(小区)") @ApiOperation(value = "通过id删除楼盘(小区)", notes = "通过id删除楼盘(小区)")
@DeleteMapping("/{housingEstatesId}") @DeleteMapping("/{housingEstateId}")
public R removeById(@PathVariable Long housingEstatesId) { public R removeById(@PathVariable Long housingEstateId) {
return R.ok(housingEstatesService.removeById(housingEstatesId)); return R.ok(housingEstatesService.removeById(housingEstateId));
} }
} }

2
air/src/main/java/com/air/housing/mapper/BlocksMapper.java

@ -26,5 +26,5 @@ public interface BlocksMapper extends BaseMapper<Blocks> {
* @param blockListDto * @param blockListDto
* @return * @return
*/ */
Page<Blocks> getBlocksPageByHousingEstatesId(Page page, @Param("Blocks")BlockListDto blockListDto); Page<Blocks> getBlocksPageByhousingEstateId(Page page, @Param("Blocks")BlockListDto blockListDto);
} }

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

@ -18,6 +18,6 @@ public interface BlocksService extends IService<Blocks> {
* @param blockListDto * @param blockListDto
* @return * @return
*/ */
Page<Blocks> getBlocksPageByHousingEstatesId(Page page,BlockListDto blockListDto); Page<Blocks> getBlocksPageByhousingEstateId(Page page,BlockListDto blockListDto);
} }

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

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

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

@ -22,8 +22,8 @@ public class BlocksServiceImpl extends ServiceImpl<BlocksMapper, Blocks> impleme
@Resource @Resource
private BlocksMapper blocksMapper; private BlocksMapper blocksMapper;
@Override @Override
public Page<Blocks> getBlocksPageByHousingEstatesId(Page page,BlockListDto blockListDto) { public Page<Blocks> getBlocksPageByhousingEstateId(Page page,BlockListDto blockListDto) {
return blocksMapper.getBlocksPageByHousingEstatesId(page,blockListDto); return blocksMapper.getBlocksPageByhousingEstateId(page,blockListDto);
} }
} }

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

@ -64,7 +64,7 @@ public class HousingEstatesServiceImpl extends ServiceImpl<HousingEstatesMapper,
@Override @Override
public IPage<HousingEstatesName> getHousingEstatesNamePage(IPage<HousingEstatesName> page, String name) { public IPage<HousingEstatesName> getHousingEstatesNamePage(IPage<HousingEstatesName> page, String name) {
return null; return housingEstatesMapper.getHousingEstatesNamePage(page, name);
} }
@Override @Override
@ -110,14 +110,14 @@ public class HousingEstatesServiceImpl extends ServiceImpl<HousingEstatesMapper,
} }
@Override @Override
public HousingEstatesDetail getHousingEstatesDetail(Long housingEstatesId, Long blockId) { public HousingEstatesDetail getHousingEstatesDetail(Long housingEstateId, Long blockId) {
HousingEstates housingEstates = baseMapper.selectById(housingEstatesId); HousingEstates housingEstates = baseMapper.selectById(housingEstateId);
LandListed landListed = landListedMapper.selectOne(Wrappers.<LandListed>lambdaQuery().eq(LandListed::getAnnoId,housingEstates.getAnnoId())); LandListed landListed = landListedMapper.selectOne(Wrappers.<LandListed>lambdaQuery().eq(LandListed::getAnnoId,housingEstates.getAnnoId()));
HousingEstatesDetail detail = new HousingEstatesDetail(); HousingEstatesDetail detail = new HousingEstatesDetail();
detail.setHousingEstates(housingEstates); detail.setHousingEstates(housingEstates);
detail.setLandListed(landListed); detail.setLandListed(landListed);
if(ObjectUtil.isNotNull(blockId)){ if(ObjectUtil.isNotNull(blockId)){
Format format = formatService.getOne(Wrappers.<Format>lambdaQuery().eq(Format::getHousingEstateId,housingEstatesId)); Format format = formatService.getOne(Wrappers.<Format>lambdaQuery().eq(Format::getHousingEstateId,housingEstateId));
detail.setFormat(format); detail.setFormat(format);
} }
return detail; return detail;

2
air/src/main/java/com/air/housing/vo/HousingEstatesName.java

@ -12,7 +12,7 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode @EqualsAndHashCode
public class HousingEstatesName { public class HousingEstatesName {
@ApiModelProperty(value = "楼盘id") @ApiModelProperty(value = "楼盘id")
private Long housingEstatesId; private Long housingEstateId;
@ApiModelProperty(value = "楼盘名称") @ApiModelProperty(value = "楼盘名称")
private String name; private String name;
} }

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

@ -7,7 +7,7 @@
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 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> </sql>
<select id="getBlocksPageByHousingEstatesId" parameterType="com.air.housing.dto.BlockListDto" resultType="com.air.housing.entity.Blocks"> <select id="getBlocksPageByhousingEstateId" parameterType="com.air.housing.dto.BlockListDto" resultType="com.air.housing.entity.Blocks">
select <include refid="base_block_column"/> select <include refid="base_block_column"/>
from blocks b from blocks b
<choose> <choose>

6
air/src/main/resources/mapper/HousingEstatesMapper.xml

@ -7,7 +7,11 @@
<select id="getHousingEstatesNamePage" resultType="com.air.housing.vo.HousingEstatesName"> <select id="getHousingEstatesNamePage" resultType="com.air.housing.vo.HousingEstatesName">
select housing_estate_id, name select housing_estate_id, name
from housing_estates from housing_estates
where name like concat('%', #{name}, '%') <where>
<if test="name != null and name != ''">
name like concat('%', #{name}, '%')
</if>
</where>
</select> </select>
<select id="selectIPage" resultType="com.air.housing.vo.HousingEstatesListVO"> <select id="selectIPage" resultType="com.air.housing.vo.HousingEstatesListVO">

Loading…
Cancel
Save