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 18d5cd2..136f8b6 100644 --- a/air/src/main/java/com/air/housing/controller/HousingEstatesController.java +++ b/air/src/main/java/com/air/housing/controller/HousingEstatesController.java @@ -1,6 +1,7 @@ package com.air.housing.controller; import com.air.housing.dto.HousingDefine; +import com.air.housing.dto.HousingEstatesQuery; import com.air.housing.entity.HousingEstates; import com.air.housing.service.HousingEstatesService; import com.air.housing.vo.HousingEstatesDetail; @@ -34,14 +35,14 @@ public class HousingEstatesController { /** * 分页查询 * - * @param page 分页对象 - * @param housingEstates 楼盘(小区) + * @param page 分页对象 + * @param query 查询条件 * @return */ @ApiOperation(value = "分页查询", notes = "分页查询") @GetMapping("/page") - public R getHousingEstatesPage(QueryPage page, HousingEstates housingEstates) { - return R.ok(housingEstatesService.page(page.toPage(), Wrappers.query(housingEstates))); + public R getHousingEstatesPage(QueryPage page, HousingEstatesQuery query) { + return R.ok(housingEstatesService.page(page, query)); } @GetMapping("/page/housing_names") @@ -78,7 +79,6 @@ public class HousingEstatesController { */ @ApiOperation(value = "新增楼盘(小区)", notes = "新增楼盘(小区)") @PostMapping -// @PreAuthorize("@pms.hasPermission('generator_housingestates_add')") public R save(@RequestBody HousingEstates housingEstates) { return R.ok(housingEstatesService.save(housingEstates)); } diff --git a/air/src/main/java/com/air/housing/dto/HousingEstatesQuery.java b/air/src/main/java/com/air/housing/dto/HousingEstatesQuery.java new file mode 100644 index 0000000..8a5cef8 --- /dev/null +++ b/air/src/main/java/com/air/housing/dto/HousingEstatesQuery.java @@ -0,0 +1,31 @@ +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. + */ +@Data +@EqualsAndHashCode +@ApiModel +public class HousingEstatesQuery { + @ApiModelProperty(value = "公告id") + private String annoId; + @ApiModelProperty(value = "楼盘名称") + private String name; + @ApiModelProperty(value = "大组团") + private String bigGroup; + @ApiModelProperty(value = "小组团") + private String smallGroup; + @ApiModelProperty(value = "日期,格式yyyy-MM-dd") + private String createDate; +} 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 23626ab..9bcc5d1 100644 --- a/air/src/main/java/com/air/housing/entity/HousingEstates.java +++ b/air/src/main/java/com/air/housing/entity/HousingEstates.java @@ -128,4 +128,7 @@ public class HousingEstates extends Model { @ApiModelProperty(value = "备注") private String remark; + + @ApiModelProperty(value = "其他编号") + private String otherNo; } 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 b3cb72f..70caf5c 100644 --- a/air/src/main/java/com/air/housing/mapper/HousingEstatesMapper.java +++ b/air/src/main/java/com/air/housing/mapper/HousingEstatesMapper.java @@ -1,9 +1,14 @@ 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.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; /** @@ -20,4 +25,13 @@ public interface HousingEstatesMapper extends BaseMapper { * @return */ IPage getHousingEstatesNamePage(IPage page, @Param("name") String name); + + /** + * 分页查询 + * @param page + * @param query + * @return + */ + @InterceptorIgnore + IPage selectIPage(IPage page, @Param("query") HousingEstatesQuery query); } 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 1fb5330..f26f49c 100644 --- a/air/src/main/java/com/air/housing/service/HousingEstatesService.java +++ b/air/src/main/java/com/air/housing/service/HousingEstatesService.java @@ -1,11 +1,14 @@ package com.air.housing.service; 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.vo.HousingEstatesName; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; +import com.cinderella.framework.common.data.mybatis.QueryPage; /** * 楼盘(小区) @@ -40,4 +43,12 @@ public interface HousingEstatesService extends IService { * @return */ HousingEstatesDetail getHousingEstatesDetail(Long housingEstatesId,Long blockId); + + /** + * 分页 + * @param page + * @param query + * @return + */ + IPage page(QueryPage page, HousingEstatesQuery query); } 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 142b37a..581fa7c 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 @@ -3,6 +3,7 @@ package com.air.housing.service.impl; import cn.hutool.core.util.ObjectUtil; import com.air.enums.BlocksOriginStatusEnum; import com.air.housing.dto.HousingDefine; +import com.air.housing.dto.HousingEstatesQuery; import com.air.housing.entity.Blocks; import com.air.housing.entity.Format; import com.air.housing.entity.Houses; @@ -13,6 +14,7 @@ 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; @@ -24,6 +26,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.cinderella.framework.common.core.exception.BusinessException; +import com.cinderella.framework.common.data.mybatis.QueryPage; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -118,6 +121,11 @@ public class HousingEstatesServiceImpl extends ServiceImpl page(QueryPage page, HousingEstatesQuery query) { + return baseMapper.selectIPage(page.toPage(), query); + } + private void copyBlocksOriginToBlocks(BlocksOrigin blocksOrigin, HousingDefine housingDefine) { Blocks blocks = new Blocks(); blocks.setHousingEstatesId(housingDefine.getHousingEstatesId()); diff --git a/air/src/main/java/com/air/housing/vo/HousingEstatesListVO.java b/air/src/main/java/com/air/housing/vo/HousingEstatesListVO.java new file mode 100644 index 0000000..dfe4c3f --- /dev/null +++ b/air/src/main/java/com/air/housing/vo/HousingEstatesListVO.java @@ -0,0 +1,31 @@ +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/java/com/air/origin/entity/BlocksOrigin.java b/air/src/main/java/com/air/origin/entity/BlocksOrigin.java index 2d7567d..1d49cfe 100644 --- a/air/src/main/java/com/air/origin/entity/BlocksOrigin.java +++ b/air/src/main/java/com/air/origin/entity/BlocksOrigin.java @@ -61,7 +61,8 @@ public class BlocksOrigin extends Model { @ApiModelProperty(value = "创建时间") @JsonFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") - private LocalDateTime createDate; + @TableField(condition = "create_date like concat(%s, '%%')") + private String createDate; @ApiModelProperty(value = "修改人") private String updateUserId; @ApiModelProperty(value = "修改时间") @@ -70,6 +71,4 @@ public class BlocksOrigin extends Model { private String remark; @ApiModelProperty(value = "数据id") private String dataId; - @ApiModelProperty(value = "其他编号") - private String otherNo; } diff --git a/air/src/main/resources/mapper/BlocksOriginMapper.xml b/air/src/main/resources/mapper/BlocksOriginMapper.xml index 3a30898..9e35107 100644 --- a/air/src/main/resources/mapper/BlocksOriginMapper.xml +++ b/air/src/main/resources/mapper/BlocksOriginMapper.xml @@ -22,6 +22,5 @@ - diff --git a/air/src/main/resources/mapper/HousingEstatesMapper.xml b/air/src/main/resources/mapper/HousingEstatesMapper.xml index a7e19db..105c74f 100644 --- a/air/src/main/resources/mapper/HousingEstatesMapper.xml +++ b/air/src/main/resources/mapper/HousingEstatesMapper.xml @@ -5,6 +5,66 @@ + +