parent
34c871d91a
commit
1d06202dc7
@ -0,0 +1,70 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
|
||||
import com.ruoyi.system.domain.BasePlaceInfo;
|
||||
import com.ruoyi.system.service.BasePlaceInfoService;
|
||||
import com.ruoyi.system.service.ISysDictTypeService;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/BasePlace")
|
||||
public class BasePlaceController extends BaseController {
|
||||
|
||||
private final BasePlaceInfoService basePlaceInfoService;
|
||||
|
||||
private final ISysDictTypeService iSysDictTypeService;
|
||||
|
||||
@PostMapping
|
||||
public AjaxResult insertPlace(@RequestBody BasePlaceInfo basePlaceInfo) {
|
||||
LambdaQueryChainWrapper<BasePlaceInfo> wrapper = basePlaceInfoService.lambdaQuery()
|
||||
.eq(BasePlaceInfo::getPlaceName, basePlaceInfo.getPlaceName());
|
||||
boolean empty = wrapper.isEmptyOfEntity();
|
||||
return (empty) ? AjaxResult.success(basePlaceInfoService.save(basePlaceInfo)): AjaxResult.error("场所已添加!不用再加了!");
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public AjaxResult updatePlace(@RequestBody BasePlaceInfo basePlaceInfo){
|
||||
return toAjax(basePlaceInfoService.updateById(basePlaceInfo));
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
public AjaxResult deletePlace(@RequestBody List<BasePlaceInfo> basePlaceInfoList){
|
||||
List<Long> ids = basePlaceInfoList.stream().map(BasePlaceInfo::getId).collect(Collectors.toList());
|
||||
return toAjax(basePlaceInfoService.removeByIds(ids));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
public Page<BasePlaceInfo> selectPlaces(BasePlaceInfo basePlaceInfo){
|
||||
Page<BasePlaceInfo> page = new Page<>(basePlaceInfo.getPageNum(), basePlaceInfo.getPageSize());
|
||||
page = basePlaceInfoService.page(page, new QueryWrapper<>(basePlaceInfo));
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/type/{dictType}")
|
||||
public AjaxResult selectPlaceType(@PathVariable String dictType){
|
||||
List<SysDictData> sysDictData = iSysDictTypeService.selectDictDataByType(dictType);
|
||||
Map<String, String> map = sysDictData.stream().collect(
|
||||
Collectors.toMap
|
||||
(SysDictData::getDictValue, SysDictData::getDictLabel, (V1, V2) -> V2));
|
||||
|
||||
return AjaxResult.success(map);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,273 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
/**
|
||||
* 场所信息表
|
||||
* @TableName base_place_info
|
||||
*/
|
||||
@TableName(value ="base_place_info")
|
||||
@Data
|
||||
public class BasePlaceInfo {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 场所编码
|
||||
*/
|
||||
private String placeCode;
|
||||
|
||||
/**
|
||||
* 场所名称
|
||||
*/
|
||||
private String placeName;
|
||||
|
||||
/**
|
||||
* 场所平面图
|
||||
*/
|
||||
private String placePic;
|
||||
|
||||
/**
|
||||
* 场所类别
|
||||
*/
|
||||
private Integer placeCategory;
|
||||
|
||||
/**
|
||||
* 场所类型
|
||||
*/
|
||||
private Integer placeType;
|
||||
|
||||
/**
|
||||
* 场所性质
|
||||
*/
|
||||
private Integer placeNature;
|
||||
|
||||
/**
|
||||
* 占地面积
|
||||
*/
|
||||
private String coversAcreage;
|
||||
|
||||
/**
|
||||
* 建筑面积
|
||||
*/
|
||||
private String structureAcreage;
|
||||
|
||||
/**
|
||||
* 建成时间
|
||||
*/
|
||||
private String neighBulitTime;
|
||||
|
||||
/**
|
||||
* 启用时间
|
||||
*/
|
||||
private String activeuseTime;
|
||||
|
||||
/**
|
||||
* 接入状态
|
||||
*/
|
||||
private Integer accessType;
|
||||
|
||||
/**
|
||||
* 绿化率
|
||||
*/
|
||||
private String afforestationRate;
|
||||
|
||||
/**
|
||||
* 容积率
|
||||
*/
|
||||
private String plotRate;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private BigDecimal longitude;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private BigDecimal latitude;
|
||||
|
||||
/**
|
||||
* 场所标准地址
|
||||
*/
|
||||
private String placeAddress;
|
||||
|
||||
/**
|
||||
* 省编码
|
||||
*/
|
||||
private String provinceCode;
|
||||
|
||||
/**
|
||||
* 省名称
|
||||
*/
|
||||
private String provinceName;
|
||||
|
||||
/**
|
||||
* 城市编码
|
||||
*/
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 城市名称
|
||||
*/
|
||||
private String cityName;
|
||||
|
||||
/**
|
||||
* 区域编码
|
||||
*/
|
||||
private String areaCode;
|
||||
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 街道/乡镇编码
|
||||
*/
|
||||
private String streetCode;
|
||||
|
||||
/**
|
||||
* 街道/乡镇名称
|
||||
*/
|
||||
private String streetName;
|
||||
|
||||
/**
|
||||
* 社区/村编码
|
||||
*/
|
||||
private String blockCode;
|
||||
|
||||
/**
|
||||
* 社区/村名称
|
||||
*/
|
||||
private String blockName;
|
||||
|
||||
/**
|
||||
* 开发商名称
|
||||
*/
|
||||
private String estateDeveloper;
|
||||
|
||||
/**
|
||||
* 开发商联系人照片
|
||||
*/
|
||||
private String developerPic;
|
||||
|
||||
/**
|
||||
* 开发商联系人姓名
|
||||
*/
|
||||
private String developerName;
|
||||
|
||||
/**
|
||||
* 开发商联系电话
|
||||
*/
|
||||
private String developerPhone;
|
||||
|
||||
/**
|
||||
* 物业公司名称
|
||||
*/
|
||||
private String propertyCompany;
|
||||
|
||||
/**
|
||||
* 物业联系人姓名
|
||||
*/
|
||||
private String propertyName;
|
||||
|
||||
/**
|
||||
* 物业联系人电话
|
||||
*/
|
||||
private String propertyPhone;
|
||||
|
||||
/**
|
||||
* 物业联系人照片
|
||||
*/
|
||||
private String propertyPic;
|
||||
|
||||
/**
|
||||
* 警务区名称
|
||||
*/
|
||||
private String policeDistrict;
|
||||
|
||||
/**
|
||||
* 警务区编码
|
||||
*/
|
||||
private String policeDistrictCode;
|
||||
|
||||
/**
|
||||
* 责任民警姓名
|
||||
*/
|
||||
private String policeName;
|
||||
|
||||
/**
|
||||
* 警员编号
|
||||
*/
|
||||
private String policeNo;
|
||||
|
||||
/**
|
||||
* 责任民警电话
|
||||
*/
|
||||
private String policePhone;
|
||||
|
||||
/**
|
||||
* 责任民警照片
|
||||
*/
|
||||
private String policePic;
|
||||
|
||||
/**
|
||||
* 维数场所编码
|
||||
*/
|
||||
private String dimensoftVillageCode;
|
||||
|
||||
/**
|
||||
* 20位目录编码
|
||||
*/
|
||||
private String policeVillageCode;
|
||||
|
||||
/**
|
||||
* 管辖单位编码
|
||||
*/
|
||||
private String jurisdictionalUnitCode;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private Integer createBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
private Integer updateBy;
|
||||
|
||||
/**
|
||||
* 0:不活跃,1:活跃
|
||||
*/
|
||||
private Integer isActive;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Long pageNum;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Long pageSize;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.system.domain.BasePlaceInfo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author 28758
|
||||
* @description 针对表【base_place_info(场所信息表)】的数据库操作Mapper
|
||||
* @createDate 2023-10-24 10:20:11
|
||||
* @Entity com.watu.place.domain.BasePlaceInfo
|
||||
*/
|
||||
public interface BasePlaceInfoMapper extends BaseMapper<BasePlaceInfo> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.ruoyi.system.domain.BasePlaceInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author 28758
|
||||
* @description 针对表【base_place_info(场所信息表)】的数据库操作Service
|
||||
* @createDate 2023-10-24 10:20:11
|
||||
*/
|
||||
public interface BasePlaceInfoService extends IService<BasePlaceInfo> {
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.system.mapper.BasePlaceInfoMapper;
|
||||
import com.ruoyi.system.service.BasePlaceInfoService;
|
||||
import com.ruoyi.system.domain.BasePlaceInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author 28758
|
||||
* @description 针对表【base_place_info(场所信息表)】的数据库操作Service实现
|
||||
* @createDate 2023-10-24 10:20:11
|
||||
*/
|
||||
@Service
|
||||
public class BasePlaceInfoServiceImpl extends ServiceImpl<BasePlaceInfoMapper, BasePlaceInfo> implements BasePlaceInfoService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in new issue