Browse Source

no message

release/v1.0.0
zeb 4 years ago
parent
commit
20789c5082
  1. 10
      air/src/main/java/com/air/housing/controller/HousingEstatesController.java
  2. 31
      air/src/main/java/com/air/housing/dto/HousingEstatesQuery.java
  3. 3
      air/src/main/java/com/air/housing/entity/HousingEstates.java
  4. 14
      air/src/main/java/com/air/housing/mapper/HousingEstatesMapper.java
  5. 11
      air/src/main/java/com/air/housing/service/HousingEstatesService.java
  6. 8
      air/src/main/java/com/air/housing/service/impl/HousingEstatesServiceImpl.java
  7. 31
      air/src/main/java/com/air/housing/vo/HousingEstatesListVO.java
  8. 5
      air/src/main/java/com/air/origin/entity/BlocksOrigin.java
  9. 1
      air/src/main/resources/mapper/BlocksOriginMapper.xml
  10. 62
      air/src/main/resources/mapper/HousingEstatesMapper.xml

10
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));
}

31
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;
}

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

@ -128,4 +128,7 @@ public class HousingEstates extends Model<HousingEstates> {
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "其他编号")
private String otherNo;
}

14
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<HousingEstates> {
* @return
*/
IPage<HousingEstatesName> getHousingEstatesNamePage(IPage<HousingEstatesName> page, @Param("name") String name);
/**
* 分页查询
* @param page
* @param query
* @return
*/
@InterceptorIgnore
IPage<HousingEstatesListVO> selectIPage(IPage<HousingEstatesListVO> page, @Param("query") HousingEstatesQuery query);
}

11
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<HousingEstates> {
* @return
*/
HousingEstatesDetail getHousingEstatesDetail(Long housingEstatesId,Long blockId);
/**
* 分页
* @param page
* @param query
* @return
*/
IPage<HousingEstatesListVO> page(QueryPage page, HousingEstatesQuery query);
}

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

@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
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;
@ -14,6 +15,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;
@ -27,6 +29,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
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;
@ -121,6 +124,11 @@ public class HousingEstatesServiceImpl extends ServiceImpl<HousingEstatesMapper,
return detail;
}
@Override
public IPage<HousingEstatesListVO> 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());

31
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;
}

5
air/src/main/java/com/air/origin/entity/BlocksOrigin.java

@ -61,7 +61,8 @@ public class BlocksOrigin extends Model<BlocksOrigin> {
@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<BlocksOrigin> {
private String remark;
@ApiModelProperty(value = "数据id")
private String dataId;
@ApiModelProperty(value = "其他编号")
private String otherNo;
}

1
air/src/main/resources/mapper/BlocksOriginMapper.xml

@ -22,6 +22,5 @@
<result property="updateDate" column="update_date"/>
<result property="remark" column="remark"/>
<result property="dataId" column="data_id"/>
<result property="otherNo" column="other_no"/>
</resultMap>
</mapper>

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

@ -5,6 +5,66 @@
<mapper namespace="com.air.housing.mapper.HousingEstatesMapper">
<select id="getHousingEstatesNamePage" resultType="com.air.housing.vo.HousingEstatesName">
select housing_estates_id, name from housing_estates where name like concat("%", #{name},"%")
select housing_estates_id, name
from housing_estates
where name like concat('%', #{name}, '%')
</select>
<select id="selectIPage" resultType="com.air.housing.vo.HousingEstatesListVO">
select h.housing_estates_id,
h.anno_id,
h.net_name,
h.`name`,
h.short_name,
h.lon_lat_bd,
h.property_type,
h.large_format,
h.`format`,
h.total_proposed_price,
h.trading_enterprises,
h.dev_company,
h.partner,
h.sales_status,
h.decorate_standards,
h.volume,
h.first_push_time,
h.supply_kits,
h.supply_area,
h.deal_kits,
h.deal_area,
h.narrow_stock,
h.unpushed_stock,
h.general_stock,
h.half_year_deal_volume,
h.narrow_cycle,
h.general_cycle,
h.status_cd,
h.status_date,
h.create_user_id,
h.create_date,
h.update_user_id,
h.update_date,
h.remark,
l.big_group,
l.small_group
from housing_estates h
join land_listed l on h.anno_id = l.anno_id
<where>
<if test="query.name != null and query.name != ''">
and h.name like concat('%', #{query.name}, '%')
</if>
<if test="query.annoId != null and query.annoId != ''">
and h.anno_id like concat('%', #{query.annoId}, '%')
</if>
<if test="query.bigGroup != null and query.bigGroup != ''">
and l.big_group = #{query.bigGroup}
</if>
<if test="query.smallGroup != null and query.smallGroup != ''">
and l.small_group = #{query.smallGroup}
</if>
<if test="query.createDate != null and query.createDate != ''">
and h.create_date like concat(#{query.createDate}, '%')
</if>
</where>
</select>
</mapper>

Loading…
Cancel
Save