feat(kangzai): 重构尾矿库基本信息相关代码并添加新功能
- 重构了尾矿库基本信息实体类、DAO、服务层和控制器的代码结构- 添加了新的字段和方法,以支持更详细的尾矿库信息管理 - 新增了批量查询功能和坐标转换工具类 - 优化了代码格式和命名规范master
parent
c69084691e
commit
4bb5abbfd9
6
pom.xml
6
pom.xml
|
@ -224,12 +224,6 @@
|
||||||
<version>${lombok.version}</version>
|
<version>${lombok.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring-test</artifactId>
|
|
||||||
<version>5.2.9.RELEASE</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- OSS -->
|
<!-- OSS -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.aliyun.oss</groupId>
|
<groupId>com.aliyun.oss</groupId>
|
||||||
|
|
|
@ -2,6 +2,11 @@ package com.zcloud.common.utils;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 百度地图工具类
|
* 百度地图工具类
|
||||||
*/
|
*/
|
||||||
|
@ -11,22 +16,23 @@ public class BaiduMapUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据经纬度获取详细地址
|
* 根据经纬度获取详细地址
|
||||||
* @param lng 经度
|
*
|
||||||
* @param lat 纬度
|
* @param lng 经度
|
||||||
|
* @param lat 纬度
|
||||||
* @param coordtype 坐标系类型(wgs84ll/gcj02等)
|
* @param coordtype 坐标系类型(wgs84ll/gcj02等)
|
||||||
* @return 格式化地址
|
* @return 格式化地址
|
||||||
*/
|
*/
|
||||||
public static String getAddressByLocation(double lng, double lat, String coordtype) throws Exception {
|
public static String getAddressByLocation(double lng, double lat, String coordtype) throws Exception {
|
||||||
String url = String.format(
|
String url = String.format(
|
||||||
"http://api.map.baidu.com/reverse_geocoding/v3/?ak=%s&output=json&coordtype=%s&location=%s,%s",
|
"http://api.map.baidu.com/reverse_geocoding/v3/?ak=%s&output=json&coordtype=%s&location=%s,%s",
|
||||||
BAIDU_AK, coordtype, lat, lng); // 注意百度坐标系是纬度在前
|
BAIDU_AK, coordtype, lat, lng); // 注意百度坐标系是纬度在前
|
||||||
|
|
||||||
String response = HttpRequestUtil.doGet(url);
|
String response = HttpRequestUtil.doGet(url);
|
||||||
JSONObject result = JSONObject.parseObject(response);
|
JSONObject result = JSONObject.parseObject(response);
|
||||||
|
|
||||||
if (result.getInteger("status") == 0) {
|
if (result.getInteger("status") == 0) {
|
||||||
return result.getJSONObject("result")
|
return result.getJSONObject("result")
|
||||||
.getString("formatted_address");
|
.getString("formatted_address");
|
||||||
}
|
}
|
||||||
throw new RuntimeException("地址解析失败:" + result.getString("message"));
|
throw new RuntimeException("地址解析失败:" + result.getString("message"));
|
||||||
}
|
}
|
||||||
|
@ -35,4 +41,79 @@ public class BaiduMapUtil {
|
||||||
public static String getAddressByLocation(double lng, double lat) throws Exception {
|
public static String getAddressByLocation(double lng, double lat) throws Exception {
|
||||||
return getAddressByLocation(lng, lat, "wgs84ll");
|
return getAddressByLocation(lng, lat, "wgs84ll");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将WGS84坐标转换为BD09坐标
|
||||||
|
*
|
||||||
|
* @param lng 经度(WGS84)
|
||||||
|
* @param lat 纬度(WGS84)
|
||||||
|
* @return 转换后的BD09坐标数组 [经度, 纬度]
|
||||||
|
*/
|
||||||
|
public static double[] convertWGS84ToBD09(double lng, double lat) throws Exception {
|
||||||
|
String url = String.format("%s?coords=%f,%f&from=1&to=5&ak=%s", "http://api.map.baidu.com/geoconv/v1/", lng, lat, BAIDU_AK);
|
||||||
|
String response = HttpRequestUtil.doGet(url);
|
||||||
|
|
||||||
|
if (response == null) {
|
||||||
|
throw new RuntimeException("调用百度坐标转换API失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject result = JSONObject.parseObject(response);
|
||||||
|
int status = result.getIntValue("status");
|
||||||
|
|
||||||
|
if (status != 0) {
|
||||||
|
throw new RuntimeException("坐标转换失败:" + result.getString("message"));
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Map<String, Object>> list = result.getObject("result", List.class);
|
||||||
|
Map<String, Object> point = list.get(0);
|
||||||
|
|
||||||
|
return new double[]{
|
||||||
|
((Double) point.get("x")),
|
||||||
|
((Double) point.get("y"))
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量转换WGS84坐标为BD09坐标
|
||||||
|
*
|
||||||
|
* @param coordinates 多个坐标对,格式:List<double[]{lng, lat}>
|
||||||
|
* @return 转换后的坐标列表,顺序与输入一致
|
||||||
|
*/
|
||||||
|
public static List<double[]> batchConvertWGS84ToBD09(List<double[]> coordinates) throws Exception {
|
||||||
|
if (coordinates == null || coordinates.isEmpty()) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder coordsBuilder = new StringBuilder();
|
||||||
|
for (double[] coord : coordinates) {
|
||||||
|
coordsBuilder.append(coord[0]).append(",").append(coord[1]).append(";");
|
||||||
|
}
|
||||||
|
String coords = coordsBuilder.substring(0, coordsBuilder.length() - 1); // 去掉最后一个分号
|
||||||
|
|
||||||
|
String url = String.format("%s?coords=%s&from=1&to=5&ak=%s", "http://api.map.baidu.com/geoconv/v1/", coords, BAIDU_AK);
|
||||||
|
String response = HttpRequestUtil.doGet(url);
|
||||||
|
|
||||||
|
if (response == null) {
|
||||||
|
throw new RuntimeException("调用百度坐标转换API失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject result = JSONObject.parseObject(response);
|
||||||
|
int status = result.getIntValue("status");
|
||||||
|
|
||||||
|
if (status != 0) {
|
||||||
|
throw new RuntimeException("坐标转换失败:" + result.getString("message"));
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Map<String, Object>> points = result.getObject("result", List.class);
|
||||||
|
List<double[]> converted = new ArrayList<>();
|
||||||
|
|
||||||
|
for (Map<String, Object> point : points) {
|
||||||
|
converted.add(new double[]{
|
||||||
|
((Double) point.get("x")),
|
||||||
|
((Double) point.get("y"))
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return converted;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,4 +76,9 @@ public class BusEmergencyStorageController extends AbstractController {
|
||||||
return R.ok().put("busEmergencyStorage", busEmergencyStorage);
|
return R.ok().put("busEmergencyStorage", busEmergencyStorage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/list")
|
||||||
|
public R list() {
|
||||||
|
return R.ok().put("list", busEmergencyStorageService.queryByFlexibleParams("is_delete", "0"));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,4 +76,9 @@ public class BusGeologicalDisasterController extends AbstractController {
|
||||||
return R.ok().put("busGeologicalDisaster", busGeologicalDisaster);
|
return R.ok().put("busGeologicalDisaster", busGeologicalDisaster);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/list")
|
||||||
|
public R list() {
|
||||||
|
return R.ok().put("list", busGeologicalDisasterService.queryByFlexibleParams("is_delete", "0"));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,4 +76,8 @@ public class BusMountainFloodVillageController extends AbstractController {
|
||||||
return R.ok().put("busMountainFloodVillage", busMountainFloodVillage);
|
return R.ok().put("busMountainFloodVillage", busMountainFloodVillage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/list")
|
||||||
|
public R list() {
|
||||||
|
return R.ok().put("list", busMountainFloodVillageService.queryByFlexibleParams("is_delete", "0"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,4 +76,9 @@ public class BusReservoirBasicController extends AbstractController {
|
||||||
return R.ok().put("busReservoirBasic", busReservoirBasic);
|
return R.ok().put("busReservoirBasic", busReservoirBasic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/list")
|
||||||
|
public R list() {
|
||||||
|
return R.ok().put("list", busReservoirBasicService.queryByFlexibleParams("is_delete", "0"));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,4 +76,8 @@ public class BusRiverController extends AbstractController {
|
||||||
return R.ok().put("busRiver", busRiver);
|
return R.ok().put("busRiver", busRiver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/list")
|
||||||
|
public R list() {
|
||||||
|
return R.ok().put("list", busRiverService.queryByFlexibleParams("is_delete", "0"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,4 +71,8 @@ public class BusRiverPointController extends AbstractController {
|
||||||
return R.ok().put("busRiverPoint", busRiverPoint);
|
return R.ok().put("busRiverPoint", busRiverPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/list")
|
||||||
|
public R list() {
|
||||||
|
return R.ok().put("list", busRiverPointService.queryByFlexibleParams("is_delete", "0"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,4 +73,8 @@ public class BusRiverRiskVillagesController extends AbstractController {
|
||||||
return R.ok().put("busRiverRiskVillages", busRiverRiskVillages);
|
return R.ok().put("busRiverRiskVillages", busRiverRiskVillages);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/list")
|
||||||
|
public R list() {
|
||||||
|
return R.ok().put("list", busRiverRiskVillagesService.queryByFlexibleParams("is_delete", "0"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,4 +73,8 @@ public class BusRiverSectionsController extends AbstractController {
|
||||||
return R.ok().put("busRiverSections", busRiverSections);
|
return R.ok().put("busRiverSections", busRiverSections);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/list")
|
||||||
|
public R list() {
|
||||||
|
return R.ok().put("list", busRiverSectionsService.queryByFlexibleParams("is_delete", "0"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,4 +72,9 @@ public class BusRiverStructuresController extends AbstractController {
|
||||||
return R.ok().put("busRiverStructures", busRiverStructures);
|
return R.ok().put("busRiverStructures", busRiverStructures);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/list")
|
||||||
|
public R list() {
|
||||||
|
return R.ok().put("list", busRiverStructuresService.queryByFlexibleParams("is_delete", "0"));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,4 +72,8 @@ public class BusRiverStructuresPointController extends AbstractController {
|
||||||
return R.ok().put("busRiverStructuresPoint", busRiverStructuresPoint);
|
return R.ok().put("busRiverStructuresPoint", busRiverStructuresPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/list")
|
||||||
|
public R list() {
|
||||||
|
return R.ok().put("list", busRiverStructuresPointService.queryByFlexibleParams("is_delete", "0"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,15 +11,14 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author fangjiakai
|
* @Author fangjiakai
|
||||||
* @Desc 尾矿库基本信息表(BusTailingsReservoir)表控制层
|
* @Desc (BusTailingsReservoir)表控制层
|
||||||
* @Date 2025-06-09 10:14:59
|
* @Date 2025-06-10 18:47:46
|
||||||
*/
|
*/
|
||||||
@Api(tags = "尾矿库基本信息表")
|
@Api(tags = "")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("busTailingsReservoir")
|
@RequestMapping("busTailingsReservoir")
|
||||||
public class BusTailingsReservoirController extends AbstractController {
|
public class BusTailingsReservoirController extends AbstractController {
|
||||||
|
@ -27,19 +26,19 @@ public class BusTailingsReservoirController extends AbstractController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private BusTailingsReservoirService busTailingsReservoirService;
|
private BusTailingsReservoirService busTailingsReservoirService;
|
||||||
|
|
||||||
@ApiOperation("尾矿库基本信息表-新增数据")
|
@ApiOperation("-新增数据")
|
||||||
@SysLog("尾矿库基本信息表-新增数据")
|
@SysLog("-新增数据")
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
public R insert(@RequestBody BusTailingsReservoirEntity param) {
|
public R insert(@RequestBody BusTailingsReservoirEntity param) {
|
||||||
param.setCreator(getUserId());
|
param.setCreator(getUserId());
|
||||||
param.setOperator(getUserId());
|
param.setOperator(getUserId());
|
||||||
busTailingsReservoirService.save(param);
|
busTailingsReservoirService.save(param);
|
||||||
|
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("尾矿库基本信息表-编辑数据")
|
@ApiOperation("-编辑数据")
|
||||||
@SysLog("尾矿库基本信息表-编辑数据")
|
@SysLog("-编辑数据")
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public R update(@RequestBody BusTailingsReservoirEntity param) {
|
public R update(@RequestBody BusTailingsReservoirEntity param) {
|
||||||
param.setOperator(getUserId());
|
param.setOperator(getUserId());
|
||||||
|
@ -49,30 +48,34 @@ public class BusTailingsReservoirController extends AbstractController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation("尾矿库基本信息表-删除数据")
|
@ApiOperation("-删除数据")
|
||||||
@SysLog("尾矿库基本信息表-删除数据")
|
@SysLog("-删除数据")
|
||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
public R delete(@RequestBody BusTailingsReservoirEntity param) {
|
public R delete(@RequestBody BusTailingsReservoirEntity param) {
|
||||||
busTailingsReservoirService.delete(param.getTailingsReservoirId(), getUserId());
|
busTailingsReservoirService.delete(param.getTailingsReservoirId(),getUserId());
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("尾矿库基本信息表-分页查询")
|
@ApiOperation("-分页查询")
|
||||||
@SysLog("尾矿库基本信息表-分页查询")
|
@SysLog("-分页查询")
|
||||||
@PostMapping("/listPage")
|
@PostMapping("/listPage")
|
||||||
public R listPage(@RequestBody Map<String, Object> params) {
|
public R listPage(@RequestBody Map<String, Object> params) {
|
||||||
PageUtils page = busTailingsReservoirService.listPage(params);
|
PageUtils page = busTailingsReservoirService.listPage(params);
|
||||||
|
|
||||||
return R.ok().put("page", page);
|
return R.ok().put("page", page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation("尾矿库基本信息表-根据ID查详情")
|
@ApiOperation("-根据ID查详情")
|
||||||
@SysLog("尾矿库基本信息表-根据ID查详情")
|
@SysLog("-根据ID查详情")
|
||||||
@PostMapping("/info")
|
@PostMapping("/info")
|
||||||
public R info(@RequestBody BusTailingsReservoirEntity param) {
|
public R info(@RequestBody BusTailingsReservoirEntity param) {
|
||||||
BusTailingsReservoirEntity busTailingsReservoir = busTailingsReservoirService.getById(param.getTailingsReservoirId());
|
BusTailingsReservoirEntity busTailingsReservoir = busTailingsReservoirService.getById(param.getTailingsReservoirId());
|
||||||
return R.ok().put("busTailingsReservoir", busTailingsReservoir);
|
return R.ok().put("busTailingsReservoir", busTailingsReservoir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/list")
|
||||||
|
public R list() {
|
||||||
|
return R.ok().put("list", busTailingsReservoirService.queryByFlexibleParams("is_delete", "0"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,4 +76,8 @@ public class BusUrbanFloodPointController extends AbstractController {
|
||||||
return R.ok().put("busUrbanFloodPoint", busUrbanFloodPoint);
|
return R.ok().put("busUrbanFloodPoint", busUrbanFloodPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/list")
|
||||||
|
public R list() {
|
||||||
|
return R.ok().put("list", busUrbanFloodPointService.queryByFlexibleParams("is_delete", "0"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,13 +6,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author fangjiakai
|
* @Author fangjiakai
|
||||||
* @Desc 尾矿库基本信息表(BusTailingsReservoir)表数据库访问层
|
* @Desc (BusTailingsReservoir)表数据库访问层
|
||||||
* @Date 2025-06-09 10:15:00
|
* @Date 2025-06-10 18:47:48
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface BusTailingsReservoirDao extends BaseMapper<BusTailingsReservoirEntity> {
|
public interface BusTailingsReservoirDao extends BaseMapper<BusTailingsReservoirEntity> {
|
||||||
|
@ -20,5 +18,5 @@ public interface BusTailingsReservoirDao extends BaseMapper<BusTailingsReservoir
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*/
|
*/
|
||||||
IPage<BusTailingsReservoirEntity> listPage(@Param("page") Page<Map<String, Object>> page, @Param("params") Map<String, Object> params);
|
IPage<BusTailingsReservoirEntity> listPage(@Param("page") Page<Map<String,Object>> page,@Param("params") Map<String, Object> params);
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,12 @@ public class BusEmergencyStorageEntity implements Serializable {
|
||||||
//地区
|
//地区
|
||||||
@ApiModelProperty(value = "地区")
|
@ApiModelProperty(value = "地区")
|
||||||
private String areaName;
|
private String areaName;
|
||||||
|
//级别
|
||||||
|
@ApiModelProperty(value = "级别")
|
||||||
|
private String emergencyLevel;
|
||||||
|
//地址
|
||||||
|
@ApiModelProperty(value = "地址")
|
||||||
|
private String address;
|
||||||
//管理单位
|
//管理单位
|
||||||
@ApiModelProperty(value = "管理单位")
|
@ApiModelProperty(value = "管理单位")
|
||||||
private String managementUnit;
|
private String managementUnit;
|
||||||
|
|
|
@ -11,62 +11,92 @@ import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author fangjiakai
|
* @Author fangjiakai
|
||||||
* @Desc 尾矿库基本信息表(BusTailingsReservoir)实体
|
* @Desc (BusTailingsReservoir)实体
|
||||||
* @Date 2025-06-09 10:14:59
|
* @Date 2025-06-10 18:47:45
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("bus_tailings_reservoir")
|
@TableName("bus_tailings_reservoir")
|
||||||
public class BusTailingsReservoirEntity implements Serializable {
|
public class BusTailingsReservoirEntity implements Serializable {
|
||||||
private static final long serialVersionUID = -81902974361413735L;
|
private static final long serialVersionUID = 956061069869617279L;
|
||||||
//尾矿库唯一ID
|
//尾矿库唯一ID
|
||||||
@ApiModelProperty(value = "尾矿库唯一ID")
|
@ApiModelProperty(value = "尾矿库唯一ID")
|
||||||
@TableId
|
@TableId
|
||||||
private String tailingsReservoirId;
|
private String tailingsReservoirId;
|
||||||
//归属单位
|
//名称
|
||||||
@ApiModelProperty(value = "归属单位")
|
@ApiModelProperty(value = "名称")
|
||||||
private String ownerUnit;
|
private String name;
|
||||||
//地址
|
//地址
|
||||||
@ApiModelProperty(value = "地址")
|
@ApiModelProperty(value = "地址")
|
||||||
private String address;
|
private String address;
|
||||||
//尾矿库名称
|
//省(字典)
|
||||||
@ApiModelProperty(value = "尾矿库名称")
|
@ApiModelProperty(value = "省(字典)")
|
||||||
private String reservoirName;
|
private String province;
|
||||||
//类型(字典)
|
//市(字典)
|
||||||
@ApiModelProperty(value = "类型(字典)")
|
@ApiModelProperty(value = "市(字典)")
|
||||||
private String reservoirType;
|
private String city;
|
||||||
//是否备案(字典:是/否)
|
//县(字典)
|
||||||
@ApiModelProperty(value = "是否备案(字典:是/否)")
|
@ApiModelProperty(value = "县(字典)")
|
||||||
private String isRecorded;
|
private String county;
|
||||||
//备案日期
|
//乡(字典)
|
||||||
@ApiModelProperty(value = "备案日期")
|
@ApiModelProperty(value = "乡(字典)")
|
||||||
private String recordDate;
|
private String village;
|
||||||
//坝高(m)
|
//街(字典)
|
||||||
@ApiModelProperty(value = "坝高(m)")
|
@ApiModelProperty(value = "街(字典)")
|
||||||
private Double damHeight;
|
private String street;
|
||||||
//库容(万m³)
|
//地区
|
||||||
@ApiModelProperty(value = "库容(万m³)")
|
@ApiModelProperty(value = "地区")
|
||||||
private Double capacity;
|
private String areaName;
|
||||||
//等级(字典)
|
//运行状态
|
||||||
@ApiModelProperty(value = "等级(字典)")
|
@ApiModelProperty(value = "运行状态")
|
||||||
private String reservoirGrade;
|
private String runningStatus;
|
||||||
//最小安全超高(m)
|
//是否有生产经营主体
|
||||||
@ApiModelProperty(value = "最小安全超高(m)")
|
@ApiModelProperty(value = "是否有生产经营主体")
|
||||||
private Double minSafetyHeight;
|
private String hasProductionEntity;
|
||||||
//最小滩长(m)
|
//是否为头顶库
|
||||||
@ApiModelProperty(value = "最小滩长(m)")
|
@ApiModelProperty(value = "是否为头顶库")
|
||||||
private Double minBeachLength;
|
private String isOverheadVault;
|
||||||
//坝的级别(字典)
|
//矿种
|
||||||
@ApiModelProperty(value = "坝的级别(字典)")
|
@ApiModelProperty(value = "矿种")
|
||||||
private String damGrade;
|
private String mineralSpecies;
|
||||||
//联系人
|
//设计等别
|
||||||
@ApiModelProperty(value = "联系人")
|
@ApiModelProperty(value = "设计等别")
|
||||||
private String contactPerson;
|
private String designGrade;
|
||||||
//联系电话
|
//现状等别
|
||||||
@ApiModelProperty(value = "联系电话")
|
@ApiModelProperty(value = "现状等别")
|
||||||
private String contactPhone;
|
private String currentGrade;
|
||||||
//备注
|
//设计坝高
|
||||||
@ApiModelProperty(value = "备注")
|
@ApiModelProperty(value = "设计坝高")
|
||||||
private String remarks;
|
private Double designDamHeight;
|
||||||
|
//现状坝高
|
||||||
|
@ApiModelProperty(value = "现状坝高")
|
||||||
|
private Double currentDamHeight;
|
||||||
|
//设计库容
|
||||||
|
@ApiModelProperty(value = "设计库容")
|
||||||
|
private Double designStorageCapacity;
|
||||||
|
//现状库容
|
||||||
|
@ApiModelProperty(value = "现状库容")
|
||||||
|
private Double currentStorageCapacity;
|
||||||
|
//是否在长江、黄河及其主要支流、其他重要河流岸线3公里范围内
|
||||||
|
@ApiModelProperty(value = "是否在长江、黄河及其主要支流、其他重要河流岸线3公里范围内")
|
||||||
|
private String isCloseToImportantRivers;
|
||||||
|
//安全生产许可证或安全设施设计批复编号
|
||||||
|
@ApiModelProperty(value = "安全生产许可证或安全设施设计批复编号")
|
||||||
|
private String safetyProductionLicense;
|
||||||
|
//生效日期
|
||||||
|
@ApiModelProperty(value = "生效日期")
|
||||||
|
private String effectiveDate;
|
||||||
|
//失效日期
|
||||||
|
@ApiModelProperty(value = "失效日期")
|
||||||
|
private String expiryDate;
|
||||||
|
//企业或管理单位主要负责人姓名
|
||||||
|
@ApiModelProperty(value = "企业或管理单位主要负责人姓名")
|
||||||
|
private String corpPrincipalName;
|
||||||
|
//企业或管理单位主要负责人职务
|
||||||
|
@ApiModelProperty(value = "企业或管理单位主要负责人职务")
|
||||||
|
private String corpPrincipalPost;
|
||||||
|
//企业或管理单位主要负责人手机
|
||||||
|
@ApiModelProperty(value = "企业或管理单位主要负责人手机")
|
||||||
|
private String corpPrincipalPhone;
|
||||||
//经度
|
//经度
|
||||||
@ApiModelProperty(value = "经度")
|
@ApiModelProperty(value = "经度")
|
||||||
private Double longitude;
|
private Double longitude;
|
||||||
|
|
|
@ -10,15 +10,14 @@ import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author fangjiakai
|
* @Author fangjiakai
|
||||||
* @Desc 尾矿库基本信息表(BusTailingsReservoir)表服务接口
|
* @Desc (BusTailingsReservoir)表服务接口
|
||||||
* @Date 2025-06-09 10:15:00
|
* @Date 2025-06-10 18:47:47
|
||||||
*/
|
*/
|
||||||
public interface BusTailingsReservoirService extends IService<BusTailingsReservoirEntity> {
|
public interface BusTailingsReservoirService extends IService<BusTailingsReservoirEntity> {
|
||||||
|
|
||||||
BusTailingsReservoirEntity queryByFlexibleParams(String paramName, Object paramValue);
|
BusTailingsReservoirEntity queryByFlexibleParams(String paramName, Object paramValue);
|
||||||
|
|
||||||
List<BusTailingsReservoirEntity> queryListByFlexibleParams(String paramName, Object paramValue);
|
List<BusTailingsReservoirEntity> queryListByFlexibleParams(String paramName, Object paramValue);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*/
|
*/
|
||||||
|
@ -27,6 +26,6 @@ public interface BusTailingsReservoirService extends IService<BusTailingsReservo
|
||||||
/**
|
/**
|
||||||
* 通过主键删除数据
|
* 通过主键删除数据
|
||||||
*/
|
*/
|
||||||
void delete(String tailingsReservoirId, String userId);
|
void delete(String tailingsReservoirId,String userId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,62 +1,61 @@
|
||||||
package com.zcloud.modules.kangzai.service.impl;
|
package com.zcloud.modules.kangzai.service.impl;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.zcloud.common.utils.PageUtils;
|
||||||
import com.zcloud.common.utils.PageUtils;
|
import com.zcloud.modules.kangzai.dao.BusTailingsReservoirDao;
|
||||||
import com.zcloud.modules.kangzai.dao.BusTailingsReservoirDao;
|
import com.zcloud.modules.kangzai.entity.BusTailingsReservoirEntity;
|
||||||
import com.zcloud.modules.kangzai.entity.BusTailingsReservoirEntity;
|
import com.zcloud.modules.kangzai.service.BusTailingsReservoirService;
|
||||||
import com.zcloud.modules.kangzai.service.BusTailingsReservoirService;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author fangjiakai
|
* @Author fangjiakai
|
||||||
* @Desc 尾矿库基本信息表(BusTailingsReservoir)表服务实现类
|
* @Desc (BusTailingsReservoir)表服务实现类
|
||||||
* @Date 2025-06-09 10:15:00
|
* @Date 2025-06-10 18:47:47
|
||||||
*/
|
*/
|
||||||
@Service("busTailingsReservoirService")
|
@Service("busTailingsReservoirService")
|
||||||
public class BusTailingsReservoirServiceImpl extends ServiceImpl<BusTailingsReservoirDao, BusTailingsReservoirEntity> implements BusTailingsReservoirService {
|
public class BusTailingsReservoirServiceImpl extends ServiceImpl<BusTailingsReservoirDao, BusTailingsReservoirEntity> implements BusTailingsReservoirService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BusTailingsReservoirEntity queryByFlexibleParams(String paramName, Object paramValue) {
|
public BusTailingsReservoirEntity queryByFlexibleParams(String paramName, Object paramValue) {
|
||||||
QueryWrapper<BusTailingsReservoirEntity> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<BusTailingsReservoirEntity> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq(paramName, paramValue); // 根据传入的参数名和参数值动态构建查询条件
|
queryWrapper.eq(paramName, paramValue); // 根据传入的参数名和参数值动态构建查询条件
|
||||||
|
|
||||||
return baseMapper.selectOne(queryWrapper);
|
return baseMapper.selectOne(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BusTailingsReservoirEntity> queryListByFlexibleParams(String paramName, Object paramValue) {
|
public List<BusTailingsReservoirEntity> queryListByFlexibleParams(String paramName, Object paramValue) {
|
||||||
QueryWrapper<BusTailingsReservoirEntity> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<BusTailingsReservoirEntity> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq(paramName, paramValue); // 根据传入的参数名和参数值动态构建查询条件
|
queryWrapper.eq(paramName, paramValue); // 根据传入的参数名和参数值动态构建查询条件
|
||||||
|
|
||||||
return baseMapper.selectList(queryWrapper);
|
return baseMapper.selectList(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageUtils listPage(Map<String, Object> params) {
|
public PageUtils listPage(Map<String, Object> params) {
|
||||||
Page<Map<String, Object>> page = new Page<>(Integer.parseInt(params.get("curPage").toString()), Integer.parseInt(params.get("limit").toString()));
|
Page<Map<String,Object>> page = new Page<>(Integer.parseInt(params.get("curPage").toString()),Integer.parseInt(params.get("limit").toString()));
|
||||||
params.put("isDelete", 0);
|
params.put("isDelete",0);
|
||||||
IPage<BusTailingsReservoirEntity> ipage = baseMapper.listPage(page, params);
|
IPage<BusTailingsReservoirEntity> ipage = baseMapper.listPage(page,params);
|
||||||
return new PageUtils(ipage);
|
return new PageUtils(ipage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void delete(String tailingsReservoirId, String userId) {
|
public void delete(String tailingsReservoirId,String userId){
|
||||||
UpdateWrapper<BusTailingsReservoirEntity> updateWrapper = new UpdateWrapper<>();
|
UpdateWrapper<BusTailingsReservoirEntity> updateWrapper = new UpdateWrapper<>();
|
||||||
updateWrapper.eq("tailings_reservoir_id", tailingsReservoirId);
|
updateWrapper.eq("tailings_reservoir_id",tailingsReservoirId);
|
||||||
|
|
||||||
BusTailingsReservoirEntity busTailingsReservoir = new BusTailingsReservoirEntity();
|
BusTailingsReservoirEntity busTailingsReservoir = new BusTailingsReservoirEntity();
|
||||||
busTailingsReservoir.setOperator(userId);
|
busTailingsReservoir.setOperator(userId);
|
||||||
busTailingsReservoir.setIsDelete(1);
|
busTailingsReservoir.setIsDelete(1);
|
||||||
|
|
||||||
this.update(busTailingsReservoir, updateWrapper);
|
this.update(busTailingsReservoir, updateWrapper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,77 +5,101 @@
|
||||||
<!--分页查询-->
|
<!--分页查询-->
|
||||||
<select id="listPage" resultType="com.zcloud.modules.kangzai.entity.BusTailingsReservoirEntity">
|
<select id="listPage" resultType="com.zcloud.modules.kangzai.entity.BusTailingsReservoirEntity">
|
||||||
SELECT
|
SELECT
|
||||||
t.*
|
t.*
|
||||||
FROM bus_tailings_reservoir t
|
FROM bus_tailings_reservoir t
|
||||||
<where>
|
<where>
|
||||||
<if test="params.tailingsReservoirId != null and params.tailingsReservoirId != ''">
|
<if test="params.tailingsReservoirId != null and params.tailingsReservoirId != ''">
|
||||||
AND t.tailings_reservoir_id = #{params.tailingsReservoirId}
|
AND t.tailings_reservoir_id = #{params.tailingsReservoirId}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.ownerUnit != null and params.ownerUnit != ''">
|
<if test="params.name != null and params.name != ''">
|
||||||
AND t.owner_unit = #{params.ownerUnit}
|
AND t.name = #{params.name}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.address != null and params.address != ''">
|
<if test="params.address != null and params.address != ''">
|
||||||
AND t.address = #{params.address}
|
AND t.address = #{params.address}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.reservoirName != null and params.reservoirName != ''">
|
<if test="params.province != null and params.province != ''">
|
||||||
AND t.reservoir_name like '%${params.reservoirName}%'
|
AND t.province = #{params.province}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.reservoirType != null and params.reservoirType != ''">
|
<if test="params.city != null and params.city != ''">
|
||||||
AND t.reservoir_type = #{params.reservoirType}
|
AND t.city = #{params.city}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.isRecorded != null and params.isRecorded != ''">
|
<if test="params.county != null and params.county != ''">
|
||||||
AND t.is_recorded = #{params.isRecorded}
|
AND t.county = #{params.county}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.recordDate != null and params.recordDate != ''">
|
<if test="params.village != null and params.village != ''">
|
||||||
AND t.record_date = #{params.recordDate}
|
AND t.village = #{params.village}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.damHeight != null and params.damHeight != ''">
|
<if test="params.street != null and params.street != ''">
|
||||||
AND t.dam_height = #{params.damHeight}
|
AND t.street = #{params.street}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.capacity != null and params.capacity != ''">
|
<if test="params.areaName != null and params.areaName != ''">
|
||||||
AND t.capacity = #{params.capacity}
|
AND t.area_name = #{params.areaName}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.reservoirGrade != null and params.reservoirGrade != ''">
|
<if test="params.runningStatus != null and params.runningStatus != ''">
|
||||||
AND t.reservoir_grade = #{params.reservoirGrade}
|
AND t.running_status = #{params.runningStatus}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.minSafetyHeight != null and params.minSafetyHeight != ''">
|
<if test="params.hasProductionEntity != null and params.hasProductionEntity != ''">
|
||||||
AND t.min_safety_height = #{params.minSafetyHeight}
|
AND t.has_production_entity = #{params.hasProductionEntity}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.minBeachLength != null and params.minBeachLength != ''">
|
<if test="params.isOverheadVault != null and params.isOverheadVault != ''">
|
||||||
AND t.min_beach_length = #{params.minBeachLength}
|
AND t.is_overhead_vault = #{params.isOverheadVault}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.damGrade != null and params.damGrade != ''">
|
<if test="params.mineralSpecies != null and params.mineralSpecies != ''">
|
||||||
AND t.dam_grade = #{params.damGrade}
|
AND t.mineral_species = #{params.mineralSpecies}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.contactPerson != null and params.contactPerson != ''">
|
<if test="params.designGrade != null and params.designGrade != ''">
|
||||||
AND t.contact_person = #{params.contactPerson}
|
AND t.design_grade = #{params.designGrade}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.contactPhone != null and params.contactPhone != ''">
|
<if test="params.currentGrade != null and params.currentGrade != ''">
|
||||||
AND t.contact_phone = #{params.contactPhone}
|
AND t.current_grade = #{params.currentGrade}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.remarks != null and params.remarks != ''">
|
<if test="params.designDamHeight != null and params.designDamHeight != ''">
|
||||||
AND t.remarks = #{params.remarks}
|
AND t.design_dam_height = #{params.designDamHeight}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.longitude != null and params.longitude != ''">
|
<if test="params.currentDamHeight != null and params.currentDamHeight != ''">
|
||||||
AND t.longitude = #{params.longitude}
|
AND t.current_dam_height = #{params.currentDamHeight}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.latitude != null and params.latitude != ''">
|
<if test="params.designStorageCapacity != null and params.designStorageCapacity != ''">
|
||||||
AND t.latitude = #{params.latitude}
|
AND t.design_storage_capacity = #{params.designStorageCapacity}
|
||||||
|
</if>
|
||||||
|
<if test="params.currentStorageCapacity != null and params.currentStorageCapacity != ''">
|
||||||
|
AND t.current_storage_capacity = #{params.currentStorageCapacity}
|
||||||
|
</if>
|
||||||
|
<if test="params.isCloseToImportantRivers != null and params.isCloseToImportantRivers != ''">
|
||||||
|
AND t.is_close_to_important_rivers = #{params.isCloseToImportantRivers}
|
||||||
|
</if>
|
||||||
|
<if test="params.safetyProductionLicense != null and params.safetyProductionLicense != ''">
|
||||||
|
AND t.safety_production_license = #{params.safetyProductionLicense}
|
||||||
|
</if>
|
||||||
|
<if test="params.effectiveDate != null and params.effectiveDate != ''">
|
||||||
|
AND t.effective_date = #{params.effectiveDate}
|
||||||
|
</if>
|
||||||
|
<if test="params.expiryDate != null and params.expiryDate != ''">
|
||||||
|
AND t.expiry_date = #{params.expiryDate}
|
||||||
|
</if>
|
||||||
|
<if test="params.corpPrincipalName != null and params.corpPrincipalName != ''">
|
||||||
|
AND t.corp_principal_name = #{params.corpPrincipalName}
|
||||||
|
</if>
|
||||||
|
<if test="params.corpPrincipalPost != null and params.corpPrincipalPost != ''">
|
||||||
|
AND t.corp_principal_post = #{params.corpPrincipalPost}
|
||||||
|
</if>
|
||||||
|
<if test="params.corpPrincipalPhone != null and params.corpPrincipalPhone != ''">
|
||||||
|
AND t.corp_principal_phone = #{params.corpPrincipalPhone}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.creator != null and params.creator != ''">
|
<if test="params.creator != null and params.creator != ''">
|
||||||
AND t.creator = #{params.creator}
|
AND t.creator = #{params.creator}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.createTime != null and params.createTime != ''">
|
<if test="params.createTime != null and params.createTime != ''">
|
||||||
AND t.create_time = #{params.createTime}
|
AND t.create_time = #{params.createTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.operator != null and params.operator != ''">
|
<if test="params.operator != null and params.operator != ''">
|
||||||
AND t.operator = #{params.operator}
|
AND t.operator = #{params.operator}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.operatTime != null and params.operatTime != ''">
|
<if test="params.operatTime != null and params.operatTime != ''">
|
||||||
AND t.operat_time = #{params.operatTime}
|
AND t.operat_time = #{params.operatTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.isDelete != null">
|
<if test="params.isDelete != null">
|
||||||
AND t.is_delete = #{params.isDelete}
|
AND t.is_delete = #{params.isDelete}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
ORDER BY t.create_time DESC
|
ORDER BY t.create_time DESC
|
||||||
|
|
Loading…
Reference in New Issue