物资储备点

This commit is contained in:
wzy-warehouse
2026-04-18 22:36:05 +08:00
parent eb8ed414dc
commit d448dcf284
10 changed files with 838 additions and 1 deletions
@@ -0,0 +1,28 @@
package com.gis.xian.controller;
import com.gis.xian.domain.ApiResponse;
import com.gis.xian.vo.XianStorePointsBasePointVo;
import com.gis.xian.vo.XianStorePointsPointDetailVo;
import com.gis.xian.service.XianStorePointsService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/store-points")
public class XianStorePointsController extends BaseController{
@Resource
private XianStorePointsService xianStorePointsService;
@GetMapping("/base-points")
public ApiResponse<List<XianStorePointsBasePointVo>> getBasePoints() {
return ApiResponse.ok(xianStorePointsService.getBasePoints());
}
@GetMapping("/point-detail/{id}")
public ApiResponse<XianStorePointsPointDetailVo> getPointDetailById(@PathVariable String id) {
return ApiResponse.ok(xianStorePointsService.getPointDetailById(Long.parseLong(id)));
}
}
@@ -0,0 +1,441 @@
package com.gis.xian.entity;
import lombok.Data;
/**
* 物资储备点
* @TableName xian_store_points
*/
@Data
public class XianStorePoints {
/**
* id
*/
private Long id;
/**
* 储备库名称
*/
private String name;
/**
* 详细地址
*/
private String address;
/**
* 所属部门
*/
private String department;
/**
* 分级
*/
private String level;
/**
* 类型
*/
private String type;
/**
* 建立时间
*/
private String standTime;
/**
* 有效库容
*/
private String volume;
/**
* 维护人员
*/
private String maintenance;
/**
* 救灾帐篷
*/
private Long tent;
/**
* 棉被
*/
private Long quilt;
/**
* 棉衣
*/
private Long clothes;
/**
* 毛巾被
*/
private Long towelBlanket;
/**
* 毛毯
*/
private Long blanket;
/**
* 睡袋
*/
private Long sleepingBed;
/**
* 折叠床
*/
private Long foldingBed;
/**
* 简易厕所
*/
private Long wc;
/**
* 生活类物资折合金额
*/
private Double shlwzzhje;
/**
* 橡皮船
*/
private Long rubberBoat;
/**
* 冲锋舟
*/
private Long rescueBoat;
/**
* 救生船
*/
private Long saveBoat;
/**
* 救生衣
*/
private Long saveClothes;
/**
* 救生圈
*/
private Long jsq;
/**
* 编织袋
*/
private Long bzd;
/**
* 麻袋
*/
private Long md;
/**
* 抽水泵
*/
private Long waterPump;
/**
* 救援类物资折和金额
*/
private Double jylwzzhje;
/**
* 发电机
*/
private Long generator;
/**
* 应急灯
*/
private Long emergencyLight;
/**
* 其他物资折合金额
*/
private Double qtwzzhje;
/**
* 救灾衣被
*/
private Long saveClo;
/**
* 救援工具
*/
private Long saveTool;
/**
* 折合金额
*/
private String zhje;
/**
* 市
*/
private String city;
/**
* 省
*/
private String province;
/**
* 村
*/
private String village;
/**
* 上报日期
*/
private String reportTime;
/**
* 乡
*/
private String country;
/**
* 创建人名称
*/
private String creatName;
/**
* 县
*/
private String county;
/**
* 单位负责人
*/
private String unitHead;
/**
* 填表人
*/
private String fillName;
/**
* 联系电话
*/
private String telephone;
/**
* 创建时间
*/
private String createTime;
/**
* 更新时间
*/
private String updateTime;
/**
* 写入时间
*/
private String overwriteTime;
/**
* 经度
*/
private Float lon;
/**
* 纬度
*/
private Float lat;
/**
*
*/
private Object point;
/**
*
*/
private Integer isDelete;
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
XianStorePoints other = (XianStorePoints) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
&& (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress()))
&& (this.getDepartment() == null ? other.getDepartment() == null : this.getDepartment().equals(other.getDepartment()))
&& (this.getLevel() == null ? other.getLevel() == null : this.getLevel().equals(other.getLevel()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getStandTime() == null ? other.getStandTime() == null : this.getStandTime().equals(other.getStandTime()))
&& (this.getVolume() == null ? other.getVolume() == null : this.getVolume().equals(other.getVolume()))
&& (this.getMaintenance() == null ? other.getMaintenance() == null : this.getMaintenance().equals(other.getMaintenance()))
&& (this.getTent() == null ? other.getTent() == null : this.getTent().equals(other.getTent()))
&& (this.getQuilt() == null ? other.getQuilt() == null : this.getQuilt().equals(other.getQuilt()))
&& (this.getClothes() == null ? other.getClothes() == null : this.getClothes().equals(other.getClothes()))
&& (this.getTowelBlanket() == null ? other.getTowelBlanket() == null : this.getTowelBlanket().equals(other.getTowelBlanket()))
&& (this.getBlanket() == null ? other.getBlanket() == null : this.getBlanket().equals(other.getBlanket()))
&& (this.getSleepingBed() == null ? other.getSleepingBed() == null : this.getSleepingBed().equals(other.getSleepingBed()))
&& (this.getFoldingBed() == null ? other.getFoldingBed() == null : this.getFoldingBed().equals(other.getFoldingBed()))
&& (this.getWc() == null ? other.getWc() == null : this.getWc().equals(other.getWc()))
&& (this.getShlwzzhje() == null ? other.getShlwzzhje() == null : this.getShlwzzhje().equals(other.getShlwzzhje()))
&& (this.getRubberBoat() == null ? other.getRubberBoat() == null : this.getRubberBoat().equals(other.getRubberBoat()))
&& (this.getRescueBoat() == null ? other.getRescueBoat() == null : this.getRescueBoat().equals(other.getRescueBoat()))
&& (this.getSaveBoat() == null ? other.getSaveBoat() == null : this.getSaveBoat().equals(other.getSaveBoat()))
&& (this.getSaveClothes() == null ? other.getSaveClothes() == null : this.getSaveClothes().equals(other.getSaveClothes()))
&& (this.getJsq() == null ? other.getJsq() == null : this.getJsq().equals(other.getJsq()))
&& (this.getBzd() == null ? other.getBzd() == null : this.getBzd().equals(other.getBzd()))
&& (this.getMd() == null ? other.getMd() == null : this.getMd().equals(other.getMd()))
&& (this.getWaterPump() == null ? other.getWaterPump() == null : this.getWaterPump().equals(other.getWaterPump()))
&& (this.getJylwzzhje() == null ? other.getJylwzzhje() == null : this.getJylwzzhje().equals(other.getJylwzzhje()))
&& (this.getGenerator() == null ? other.getGenerator() == null : this.getGenerator().equals(other.getGenerator()))
&& (this.getEmergencyLight() == null ? other.getEmergencyLight() == null : this.getEmergencyLight().equals(other.getEmergencyLight()))
&& (this.getQtwzzhje() == null ? other.getQtwzzhje() == null : this.getQtwzzhje().equals(other.getQtwzzhje()))
&& (this.getSaveClo() == null ? other.getSaveClo() == null : this.getSaveClo().equals(other.getSaveClo()))
&& (this.getSaveTool() == null ? other.getSaveTool() == null : this.getSaveTool().equals(other.getSaveTool()))
&& (this.getZhje() == null ? other.getZhje() == null : this.getZhje().equals(other.getZhje()))
&& (this.getCity() == null ? other.getCity() == null : this.getCity().equals(other.getCity()))
&& (this.getProvince() == null ? other.getProvince() == null : this.getProvince().equals(other.getProvince()))
&& (this.getVillage() == null ? other.getVillage() == null : this.getVillage().equals(other.getVillage()))
&& (this.getReportTime() == null ? other.getReportTime() == null : this.getReportTime().equals(other.getReportTime()))
&& (this.getCountry() == null ? other.getCountry() == null : this.getCountry().equals(other.getCountry()))
&& (this.getCreatName() == null ? other.getCreatName() == null : this.getCreatName().equals(other.getCreatName()))
&& (this.getCounty() == null ? other.getCounty() == null : this.getCounty().equals(other.getCounty()))
&& (this.getUnitHead() == null ? other.getUnitHead() == null : this.getUnitHead().equals(other.getUnitHead()))
&& (this.getFillName() == null ? other.getFillName() == null : this.getFillName().equals(other.getFillName()))
&& (this.getTelephone() == null ? other.getTelephone() == null : this.getTelephone().equals(other.getTelephone()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getOverwriteTime() == null ? other.getOverwriteTime() == null : this.getOverwriteTime().equals(other.getOverwriteTime()))
&& (this.getLon() == null ? other.getLon() == null : this.getLon().equals(other.getLon()))
&& (this.getLat() == null ? other.getLat() == null : this.getLat().equals(other.getLat()))
&& (this.getPoint() == null ? other.getPoint() == null : this.getPoint().equals(other.getPoint()))
&& (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
result = prime * result + ((getAddress() == null) ? 0 : getAddress().hashCode());
result = prime * result + ((getDepartment() == null) ? 0 : getDepartment().hashCode());
result = prime * result + ((getLevel() == null) ? 0 : getLevel().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getStandTime() == null) ? 0 : getStandTime().hashCode());
result = prime * result + ((getVolume() == null) ? 0 : getVolume().hashCode());
result = prime * result + ((getMaintenance() == null) ? 0 : getMaintenance().hashCode());
result = prime * result + ((getTent() == null) ? 0 : getTent().hashCode());
result = prime * result + ((getQuilt() == null) ? 0 : getQuilt().hashCode());
result = prime * result + ((getClothes() == null) ? 0 : getClothes().hashCode());
result = prime * result + ((getTowelBlanket() == null) ? 0 : getTowelBlanket().hashCode());
result = prime * result + ((getBlanket() == null) ? 0 : getBlanket().hashCode());
result = prime * result + ((getSleepingBed() == null) ? 0 : getSleepingBed().hashCode());
result = prime * result + ((getFoldingBed() == null) ? 0 : getFoldingBed().hashCode());
result = prime * result + ((getWc() == null) ? 0 : getWc().hashCode());
result = prime * result + ((getShlwzzhje() == null) ? 0 : getShlwzzhje().hashCode());
result = prime * result + ((getRubberBoat() == null) ? 0 : getRubberBoat().hashCode());
result = prime * result + ((getRescueBoat() == null) ? 0 : getRescueBoat().hashCode());
result = prime * result + ((getSaveBoat() == null) ? 0 : getSaveBoat().hashCode());
result = prime * result + ((getSaveClothes() == null) ? 0 : getSaveClothes().hashCode());
result = prime * result + ((getJsq() == null) ? 0 : getJsq().hashCode());
result = prime * result + ((getBzd() == null) ? 0 : getBzd().hashCode());
result = prime * result + ((getMd() == null) ? 0 : getMd().hashCode());
result = prime * result + ((getWaterPump() == null) ? 0 : getWaterPump().hashCode());
result = prime * result + ((getJylwzzhje() == null) ? 0 : getJylwzzhje().hashCode());
result = prime * result + ((getGenerator() == null) ? 0 : getGenerator().hashCode());
result = prime * result + ((getEmergencyLight() == null) ? 0 : getEmergencyLight().hashCode());
result = prime * result + ((getQtwzzhje() == null) ? 0 : getQtwzzhje().hashCode());
result = prime * result + ((getSaveClo() == null) ? 0 : getSaveClo().hashCode());
result = prime * result + ((getSaveTool() == null) ? 0 : getSaveTool().hashCode());
result = prime * result + ((getZhje() == null) ? 0 : getZhje().hashCode());
result = prime * result + ((getCity() == null) ? 0 : getCity().hashCode());
result = prime * result + ((getProvince() == null) ? 0 : getProvince().hashCode());
result = prime * result + ((getVillage() == null) ? 0 : getVillage().hashCode());
result = prime * result + ((getReportTime() == null) ? 0 : getReportTime().hashCode());
result = prime * result + ((getCountry() == null) ? 0 : getCountry().hashCode());
result = prime * result + ((getCreatName() == null) ? 0 : getCreatName().hashCode());
result = prime * result + ((getCounty() == null) ? 0 : getCounty().hashCode());
result = prime * result + ((getUnitHead() == null) ? 0 : getUnitHead().hashCode());
result = prime * result + ((getFillName() == null) ? 0 : getFillName().hashCode());
result = prime * result + ((getTelephone() == null) ? 0 : getTelephone().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getOverwriteTime() == null) ? 0 : getOverwriteTime().hashCode());
result = prime * result + ((getLon() == null) ? 0 : getLon().hashCode());
result = prime * result + ((getLat() == null) ? 0 : getLat().hashCode());
result = prime * result + ((getPoint() == null) ? 0 : getPoint().hashCode());
result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", name=").append(name);
sb.append(", address=").append(address);
sb.append(", department=").append(department);
sb.append(", level=").append(level);
sb.append(", type=").append(type);
sb.append(", standTime=").append(standTime);
sb.append(", volume=").append(volume);
sb.append(", maintenance=").append(maintenance);
sb.append(", tent=").append(tent);
sb.append(", quilt=").append(quilt);
sb.append(", clothes=").append(clothes);
sb.append(", towelBlanket=").append(towelBlanket);
sb.append(", blanket=").append(blanket);
sb.append(", sleepingBed=").append(sleepingBed);
sb.append(", foldingBed=").append(foldingBed);
sb.append(", wc=").append(wc);
sb.append(", shlwzzhje=").append(shlwzzhje);
sb.append(", rubberBoat=").append(rubberBoat);
sb.append(", rescueBoat=").append(rescueBoat);
sb.append(", saveBoat=").append(saveBoat);
sb.append(", saveClothes=").append(saveClothes);
sb.append(", jsq=").append(jsq);
sb.append(", bzd=").append(bzd);
sb.append(", md=").append(md);
sb.append(", waterPump=").append(waterPump);
sb.append(", jylwzzhje=").append(jylwzzhje);
sb.append(", generator=").append(generator);
sb.append(", emergencyLight=").append(emergencyLight);
sb.append(", qtwzzhje=").append(qtwzzhje);
sb.append(", saveClo=").append(saveClo);
sb.append(", saveTool=").append(saveTool);
sb.append(", zhje=").append(zhje);
sb.append(", city=").append(city);
sb.append(", province=").append(province);
sb.append(", village=").append(village);
sb.append(", reportTime=").append(reportTime);
sb.append(", country=").append(country);
sb.append(", creatName=").append(creatName);
sb.append(", county=").append(county);
sb.append(", unitHead=").append(unitHead);
sb.append(", fillName=").append(fillName);
sb.append(", telephone=").append(telephone);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", overwriteTime=").append(overwriteTime);
sb.append(", lon=").append(lon);
sb.append(", lat=").append(lat);
sb.append(", point=").append(point);
sb.append(", isDelete=").append(isDelete);
sb.append("]");
return sb.toString();
}
}
@@ -0,0 +1,30 @@
package com.gis.xian.mapper;
import com.gis.xian.entity.XianStorePoints;
import java.util.List;
/**
* @author wzy
* @description 针对表【xian_store_points(物资储备点)】的数据库操作Mapper
* @createDate 2026-04-18 20:51:10
* @Entity com.gis.xian.entity.XianStorePoints
*/
public interface XianStorePointsMapper {
/**
* 获取所有物资储备点基础点
* @return 基础点列表
*/
List<XianStorePoints> getBasePoints();
/**
* 根据id获取物资储备点详情
* @param id 物资储备点id
* @return 物资储备点详情
*/
XianStorePoints getPointDetailById(Long id);
}
@@ -0,0 +1,22 @@
package com.gis.xian.service;
import com.gis.xian.vo.XianStorePointsBasePointVo;
import com.gis.xian.vo.XianStorePointsPointDetailVo;
import java.util.List;
public interface XianStorePointsService {
/**
* 获取所有物资储备点基础点
* @return 基础点列表
*/
List<XianStorePointsBasePointVo> getBasePoints();
/**
* 根据id获取物资储备点详情
* @param id 物资储备点id
* @return 物资储备点详情
*/
XianStorePointsPointDetailVo getPointDetailById(Long id);
}
@@ -0,0 +1,46 @@
package com.gis.xian.service.impl;
import com.alibaba.fastjson2.JSON;
import com.gis.xian.entity.XianStorePoints;
import com.gis.xian.vo.XianStorePointsBasePointVo;
import com.gis.xian.vo.XianStorePointsPointDetailVo;
import com.gis.xian.mapper.XianStorePointsMapper;
import com.gis.xian.service.XianStorePointsService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class IXianStorePointsServiceImpl implements XianStorePointsService {
@Resource
private RedisTemplate<String, Object> redisTemplate;
@Resource
private XianStorePointsMapper xianStorePointsMapper;
@Value("${init.data.base-points.store-points}")
private String storePointsBasePointsKey;
@Override
public List<XianStorePointsBasePointVo> getBasePoints() {
// 从redis中读取基础点信息
Object data = redisTemplate.opsForValue().get(storePointsBasePointsKey);
if (data == null) {
List<XianStorePointsBasePointVo> basePoints = XianStorePointsBasePointVo.entity2Vo(xianStorePointsMapper.getBasePoints());
redisTemplate.opsForValue().set(storePointsBasePointsKey, JSON.toJSONString(basePoints));
return basePoints;
}
return JSON.parseArray(data.toString(), XianStorePointsBasePointVo.class);
}
@Override
public XianStorePointsPointDetailVo getPointDetailById(Long id) {
return XianStorePointsPointDetailVo.entity2Vo(xianStorePointsMapper.getPointDetailById(id));
}
}
@@ -8,12 +8,14 @@ import com.gis.xian.mapper.XianFirefighterMapper;
import com.gis.xian.mapper.XianHiddenDangerSpotsMapper;
import com.gis.xian.mapper.XianHospitalsMapper;
import com.gis.xian.mapper.XianRiskSpotsMapper;
import com.gis.xian.mapper.XianStorePointsMapper;
import com.gis.xian.vo.XianDangerousSourceBasePointVo;
import com.gis.xian.vo.XianEmergencyShelterBasePointVo;
import com.gis.xian.vo.XianFirefighterBasePointVo;
import com.gis.xian.vo.XianHiddenDangerSpotsBasePointVo;
import com.gis.xian.vo.XianHospitalsBasePointVo;
import com.gis.xian.vo.XianRiskSpotsBasePointVo;
import com.gis.xian.vo.XianStorePointsBasePointVo;
import jakarta.annotation.PostConstruct;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
@@ -47,6 +49,9 @@ public class InitializeData {
@Resource
private XianFirefighterMapper xianFirefighterMapper;
@Resource
private XianStorePointsMapper xianStorePointsMapper;
@Resource
RedisTemplate<String, Object> redisTemplate;
@@ -71,6 +76,9 @@ public class InitializeData {
@Value("${init.data.base-points.firefighter}")
private String firefighterBasePointsKey;
@Value("${init.data.base-points.store-points}")
private String storePointsBasePointsKey;
@PostConstruct
@Async("xianPool")
public void init() {
@@ -122,6 +130,13 @@ public class InitializeData {
xianFirefighterMapper.getBasePoints())
)
);
// 加载物资储备点基本信息写入redis
redisTemplate.opsForValue().set(storePointsBasePointsKey, JSON.toJSONString(
XianStorePointsBasePointVo.entity2Vo(
xianStorePointsMapper.getBasePoints())
)
);
log.info("初始化数据完成");
}
}
@@ -0,0 +1,59 @@
package com.gis.xian.vo;
import com.gis.xian.entity.XianStorePoints;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* 物资储备点-基本点信息
* @TableName xian_store_points
*/
@Data
public class XianStorePointsBasePointVo {
/**
* id
*/
private Long id;
/**
* 经度
*/
private Double lon;
/**
* 纬度
*/
private Double lat;
public static XianStorePointsBasePointVo entity2Vo(XianStorePoints entity) {
XianStorePointsBasePointVo vo = new XianStorePointsBasePointVo();
vo.setId(entity.getId());
vo.setLon(entity.getLon() != null ? entity.getLon().doubleValue() : null);
vo.setLat(entity.getLat() != null ? entity.getLat().doubleValue() : null);
return vo;
}
public static List<XianStorePointsBasePointVo> entity2Vo(List<XianStorePoints> entityList) {
List<XianStorePointsBasePointVo> voList = new ArrayList<>();
for (XianStorePoints entity : entityList) {
voList.add(entity2Vo(entity));
}
return voList;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
XianStorePointsBasePointVo that = (XianStorePointsBasePointVo) o;
return Objects.equals(id, that.id) && Objects.equals(lon, that.lon) && Objects.equals(lat, that.lat);
}
@Override
public int hashCode() {
return Objects.hash(id, lon, lat);
}
}
@@ -0,0 +1,118 @@
package com.gis.xian.vo;
import com.gis.xian.entity.XianStorePoints;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* 物资储备点-详细信息
* @TableName xian_store_points
*/
@Data
public class XianStorePointsPointDetailVo {
/**
* id
*/
private Long id;
/**
* 储备库名称
*/
private String name;
/**
* 分级
*/
private String level;
/**
* 类型
*/
private String type;
/**
* 详细位置
*/
private String address;
/**
* 经度
*/
private Double lon;
/**
* 纬度
*/
private Double lat;
/**
* 有效库容
*/
private String volume;
/**
* 救援帐篷
*/
private Long tent;
/**
* 发电机
*/
private Long generator;
/**
* 单位负责人
*/
private String unitHead;
/**
* 联系方式
*/
private String telephone;
public static XianStorePointsPointDetailVo entity2Vo(XianStorePoints entity) {
XianStorePointsPointDetailVo vo = new XianStorePointsPointDetailVo();
vo.setId(entity.getId());
vo.setName(entity.getName());
vo.setLevel(entity.getLevel());
vo.setType(entity.getType());
vo.setAddress(entity.getAddress());
vo.setLon(entity.getLon() != null ? entity.getLon().doubleValue() : null);
vo.setLat(entity.getLat() != null ? entity.getLat().doubleValue() : null);
vo.setVolume(entity.getVolume());
vo.setTent(entity.getTent());
vo.setGenerator(entity.getGenerator());
vo.setUnitHead(entity.getUnitHead());
vo.setTelephone(entity.getTelephone());
return vo;
}
public static List<XianStorePointsPointDetailVo> entity2Vo(List<XianStorePoints> entityList) {
List<XianStorePointsPointDetailVo> voList = new ArrayList<>();
for (XianStorePoints entity : entityList) {
voList.add(entity2Vo(entity));
}
return voList;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
XianStorePointsPointDetailVo that = (XianStorePointsPointDetailVo) o;
return Objects.equals(id, that.id) && Objects.equals(name, that.name)
&& Objects.equals(level, that.level) && Objects.equals(type, that.type)
&& Objects.equals(address, that.address) && Objects.equals(lon, that.lon)
&& Objects.equals(lat, that.lat) && Objects.equals(volume, that.volume)
&& Objects.equals(tent, that.tent) && Objects.equals(generator, that.generator)
&& Objects.equals(unitHead, that.unitHead) && Objects.equals(telephone, that.telephone);
}
@Override
public int hashCode() {
return Objects.hash(id, name, level, type, address, lon, lat, volume, tent, generator, unitHead, telephone);
}
}
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gis.xian.mapper.XianStorePointsMapper">
<resultMap id="BaseResultMap" type="com.gis.xian.entity.XianStorePoints">
<id property="id" column="id" />
<result property="name" column="name" />
<result property="address" column="address" />
<result property="department" column="department" />
<result property="level" column="level" />
<result property="type" column="type" />
<result property="standTime" column="stand_time" />
<result property="volume" column="volume" />
<result property="maintenance" column="maintenance" />
<result property="tent" column="tent" />
<result property="quilt" column="quilt" />
<result property="clothes" column="clothes" />
<result property="towelBlanket" column="towel_blanket" />
<result property="blanket" column="blanket" />
<result property="sleepingBed" column="sleeping_bed" />
<result property="foldingBed" column="folding_bed" />
<result property="wc" column="wc" />
<result property="shlwzzhje" column="shlwzzhje" />
<result property="rubberBoat" column="rubber_boat" />
<result property="rescueBoat" column="rescue_boat" />
<result property="saveBoat" column="save_boat" />
<result property="saveClothes" column="save_clothes" />
<result property="jsq" column="jsq" />
<result property="bzd" column="bzd" />
<result property="md" column="md" />
<result property="waterPump" column="water_pump" />
<result property="jylwzzhje" column="jylwzzhje" />
<result property="generator" column="generator" />
<result property="emergencyLight" column="emergency_light" />
<result property="qtwzzhje" column="qtwzzhje" />
<result property="saveClo" column="save_clo" />
<result property="saveTool" column="save_tool" />
<result property="zhje" column="zhje" />
<result property="city" column="city" />
<result property="province" column="province" />
<result property="village" column="village" />
<result property="reportTime" column="report_time" />
<result property="country" column="country" />
<result property="creatName" column="creat_name" />
<result property="county" column="county" />
<result property="unitHead" column="unit_head" />
<result property="fillName" column="fill_name" />
<result property="telephone" column="telephone" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="overwriteTime" column="overwrite_time" />
<result property="lon" column="lon" />
<result property="lat" column="lat" />
<result property="point" column="point" />
<result property="isDelete" column="is_delete" />
</resultMap>
<!-- 获取所有物资储备点基础点 -->
<select id="getBasePoints" resultMap="BaseResultMap">
SELECT id, lon, lat FROM xian_store_points
<where>
is_delete = 0
<!-- 确定落在西安境内 -->
AND ST_Within(point, (SELECT geom FROM xian_district WHERE id = 1))
</where>
</select>
<!-- 根据id获取物资储备点详情 -->
<select id="getPointDetailById" resultMap="BaseResultMap">
SELECT id, name, level, type, address, lon, lat, volume, tent, generator, unit_head, telephone FROM xian_store_points
<where>
id = #{id} AND is_delete = 0
</where>
</select>
</mapper>
@@ -18,3 +18,4 @@ init:
dangerous-source: 'xian:init:data:base-points:dangerous-source'
emergency-shelter: 'xian:init:data:base-points:emergency-shelter'
firefighter: 'xian:init:data:base-points:firefighter'
store-points: 'xian:init:data:base-points:store-points'