Browse Source

分页接口

master
HAHA 3 years ago
parent
commit
6860ef2fd8
  1. 20
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaLoudongFormDTO.java
  2. 144
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaLoudongResultDTO.java
  3. 9
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaLoudongController.java
  4. 5
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaLoudongDao.java
  5. 4
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaLoudongService.java
  6. 12
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaLoudongServiceImpl.java
  7. 38
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaLoudongDao.xml

20
epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/CaLoudongFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.opendata.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import java.io.Serializable;
@Data
public class CaLoudongFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = -5277855973512833181L;
/**
* 小区名称
*/
private String communityName;
}

144
epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/CaLoudongResultDTO.java

@ -0,0 +1,144 @@
package com.epmet.opendata.dto.result;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class CaLoudongResultDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = 2835612060476537433L;
/**
* 楼栋ID
*/
private Long buildingId;
/**
* 楼宇类型
*/
private String buildingType;
/**
* 网格ID
*/
private Long gridId;
/**
* 楼宇名称
*/
private String buildingName;
/**
* 用途分类
*/
private String buildingUse;
/**
* 楼宇状态
*/
private String buildingStatus;
/**
* 楼宇结构
*/
private String buildingStructure;
/**
* 使用现状
*/
private String buildingUseage;
/**
* 建筑时间
*/
private Date constructionTime;
/**
* 所处位置
*/
private String buildingAddr;
/**
* 小区单位名称
*/
private String communityName;
/**
* 楼栋长
*/
private String buildingLeader;
/**
* 楼层数
*/
private Integer layerCount;
/**
* 地下楼层数
*/
private Integer basementLayerCount;
/**
* 住宅开始层数
*/
private Integer houseBeginLayer;
/**
* 单元数
*/
private Integer unitCount;
/**
* 每层每单元户数
*/
private Integer layerRoomCount;
/**
* 总房屋数
*/
private Integer roomCount;
/**
* 电梯数量
*/
private String elevatorCount;
/**
* 建筑面积
*/
private String buildingArea;
/**
* 物业公司
*/
private String buildingPmc;
/**
* 介绍
*/
private String buildingDesc;
/**
* 标绘状态
*/
private String pointStatus;
/**
* 经度
*/
private BigDecimal longitude;
/**
* 纬度
*/
private BigDecimal latitude;
/**
* 小区主键
*/
private String communityId;
}

9
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/CaLoudongController.java

@ -1,7 +1,9 @@
package com.epmet.opendata.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
@ -10,6 +12,7 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.opendata.dto.CaLoudongDTO;
import com.epmet.opendata.dto.form.CaLoudongFormDTO;
import com.epmet.opendata.excel.CaLoudongExcel;
import com.epmet.opendata.service.CaLoudongService;
import org.springframework.beans.factory.annotation.Autowired;
@ -77,6 +80,10 @@ public class CaLoudongController {
ExcelUtils.exportExcelToTarget(response, null, list, CaLoudongExcel.class);
}
@PostMapping("getPage")
public Result<PageData> getPage(@RequestBody CaLoudongFormDTO dto, @LoginUser TokenDto tokenDto){
PageData data = caLoudongService.getPage(dto);
return new Result<PageData>().ok(data);
}
}

5
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/CaLoudongDao.java

@ -2,9 +2,12 @@ package com.epmet.opendata.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.VolunteerPolyListResultDTO;
import com.epmet.opendata.dto.CaLoudongDTO;
import com.epmet.opendata.dto.result.CaLoudongResultDTO;
import com.epmet.opendata.entity.CaLoudongEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -18,4 +21,6 @@ import java.util.List;
public interface CaLoudongDao extends BaseDao<CaLoudongEntity> {
List<CaLoudongDTO> getList();
List<CaLoudongResultDTO> getPage(@Param("communityName") String communityName);
}

4
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/CaLoudongService.java

@ -4,6 +4,7 @@ package com.epmet.opendata.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.opendata.dto.CaLoudongDTO;
import com.epmet.opendata.dto.form.CaLoudongFormDTO;
import com.epmet.opendata.entity.CaLoudongEntity;
@ -77,4 +78,7 @@ public interface CaLoudongService extends BaseService<CaLoudongEntity> {
* @date 2022-05-31
*/
void delete(String[] ids);
PageData getPage(CaLoudongFormDTO dto);
}

12
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/CaLoudongServiceImpl.java

@ -1,13 +1,14 @@
package com.epmet.opendata.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.opendata.dao.CaLoudongDao;
import com.epmet.opendata.dto.CaLoudongDTO;
import com.epmet.opendata.dto.form.CaLoudongFormDTO;
import com.epmet.opendata.dto.result.CaLoudongResultDTO;
import com.epmet.opendata.entity.CaLoudongEntity;
import com.epmet.opendata.redis.CaLoudongRedis;
import com.epmet.opendata.service.CaLoudongService;
@ -94,4 +95,13 @@ public class CaLoudongServiceImpl extends BaseServiceImpl<CaLoudongDao, CaLoudon
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public PageData getPage(CaLoudongFormDTO dto) {
PageHelper.startPage(dto.getPageNo(), dto.getPageSize());
List<CaLoudongResultDTO> result = baseDao.getPage(dto.getCommunityName());
PageInfo<CaLoudongResultDTO> info = new PageInfo<>(result);
return new PageData<>(result, info.getTotal());
}
}

38
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/CaLoudongDao.xml

@ -51,6 +51,44 @@
<select id="getList" resultType="com.epmet.opendata.dto.CaLoudongDTO">
select * from ca_loudong where delete_flag = 'normal'
</select>
<select id="getPage" resultType="com.epmet.opendata.dto.result.CaLoudongResultDTO">
SELECT
building_id,
building_type,
grid_id,
building_name,
building_use,
building_status,
building_structure,
building_useage,
construction_time,
building_addr,
community_name,
building_leader,
layer_count,
basement_layer_count,
house_begin_layer,
unit_count,
layer_room_count,
room_count,
elevator_count,
building_area,
building_pmc,
building_desc,
point_status,
longitude,
latitude,
plat_code,
community_id
FROM
ca_loudong
<where>
delete_flag = 'normal'
<if test="communityName != null and communityName != ''">
AND community_name = #{communityName}
</if>
</where>
</select>
</mapper>
Loading…
Cancel
Save