| | |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.yw.excel.EmergencySuppliesExcel; |
| | | import org.springblade.modules.yw.excel.FacilityExcel; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | String data = facilityService.importFacility(ExcelUtil.read(file, FacilityExcel.class),isCovered == 1); |
| | | return R.data(200, data, data); |
| | | } |
| | | |
| | | /** |
| | | * 三道防线信息查询 |
| | | * @param facility |
| | | * @return |
| | | */ |
| | | @GetMapping("/getFacilityList") |
| | | @ApiOperationSupport(order = 9) |
| | | @ApiOperation(value = "三道防线信息查询", notes = "传入facility") |
| | | public R getFacilityList(FacilityVO facility) { |
| | | return R.data(facilityService.getFacilityList(facility)); |
| | | } |
| | | } |
| | |
| | | @ApiModelProperty(value = "所属企业id") |
| | | private Long firmId; |
| | | /** |
| | | * 图片 |
| | | */ |
| | | @ApiModelProperty(value = "图片") |
| | | private String imageUrl; |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | @ApiModelProperty(value = "创建人", example = "") |
| | |
| | | package org.springblade.modules.yw.mapper; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.yw.entity.FacilityEntity; |
| | | import org.springblade.modules.yw.vo.FacilityVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | |
| | | */ |
| | | List<FacilityVO> selectFacilityPage(IPage page, FacilityVO facility); |
| | | |
| | | /** |
| | | * 三道防线信息查询 |
| | | * @param facility |
| | | * @return |
| | | */ |
| | | List<FacilityVO> getFacilityList(@Param("facility") FacilityVO facility); |
| | | |
| | | /** |
| | | * 第三道防线查询应急空间表的应急池和雨水池信息 |
| | | * @return |
| | | */ |
| | | List<FacilityVO> getTreeFacilityList(@Param("facility") FacilityVO facility); |
| | | } |
| | |
| | | select * from yw_facility where is_deleted = 0 |
| | | </select> |
| | | |
| | | <!--三道防线信息查询--> |
| | | <select id="getFacilityList" resultType="org.springblade.modules.yw.vo.FacilityVO"> |
| | | select |
| | | yf.*, |
| | | yfi.name as firmName |
| | | from yw_facility yf |
| | | left join yw_firm_info yfi on yfi.id = yf.firm_id and yfi.is_deleted = 0 |
| | | where yf.is_deleted = 0 |
| | | <if test="facility.facLevel!=null"> |
| | | and yf.fac_level = #{facility.facLevel} |
| | | </if> |
| | | <if test="facility.firmId!=null"> |
| | | and yf.firm_id = #{facility.firmId} |
| | | </if> |
| | | </select> |
| | | |
| | | <!--三道防线信息查询--> |
| | | <select id="getTreeFacilityList" resultType="org.springblade.modules.yw.vo.FacilityVO"> |
| | | select |
| | | yes.id,yes.name,yes.lng,yes.lat,yes.image_url,yes.capacity,yfi.id as firm_id, |
| | | yfi.name as firmName |
| | | from yw_emergency_space yes |
| | | left join yw_firm_info yfi on yfi.id = yes.firm_id and yfi.is_deleted = 0 |
| | | where yes.is_deleted = 0 |
| | | and yes.type = 1 |
| | | <if test="facility.firmId!=null"> |
| | | and yes.firm_id = #{facility.firmId} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | * @return |
| | | */ |
| | | String importFacility(List<FacilityExcel> data, boolean isCovered); |
| | | |
| | | /** |
| | | * 三道防线信息查询 |
| | | * @param facility |
| | | * @return |
| | | */ |
| | | List<FacilityVO> getFacilityList(FacilityVO facility); |
| | | } |
| | |
| | | facilityEntity.setFirmId(firmInfo.getId()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 三道防线信息查询 |
| | | * @param facility |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<FacilityVO> getFacilityList(FacilityVO facility) { |
| | | // 设置默认查询一道防线 |
| | | if (null==facility.getFacLevel()){ |
| | | facility.setFacLevel(1); |
| | | } |
| | | // 三道防线信息查询 |
| | | if (facility.getFacLevel()==1 || facility.getFacLevel()==2){ |
| | | // 查询并返回 |
| | | return baseMapper.getFacilityList(facility); |
| | | } |
| | | // 第三道防线查询应急空间表的应急池和雨水池信息 |
| | | if (facility.getFacLevel()==3){ |
| | | return baseMapper.getTreeFacilityList(facility); |
| | | } |
| | | // 返回空 |
| | | return null; |
| | | } |
| | | } |
| | |
| | | package org.springblade.modules.yw.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.springblade.modules.yw.entity.FacilityEntity; |
| | | import lombok.Data; |
| | | |
| | |
| | | public class FacilityVO extends FacilityEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 企业名称 |
| | | */ |
| | | @ApiModelProperty(value = "企业名称") |
| | | private String firmName; |
| | | |
| | | /** |
| | | * 可用容量(立方米)或转输(处置)能力(立方米/小时) |
| | | */ |
| | | @ApiModelProperty(value = "可用容量(立方米)或转输(处置)能力(立方米/小时)") |
| | | private Double capacity; |
| | | |
| | | } |