feat(kangzai): 重构尾矿库基本信息相关代码并添加新功能
- 重构了尾矿库基本信息实体类、DAO、服务层和控制器的代码结构- 添加了新的字段和方法,以支持更详细的尾矿库信息管理 - 新增了批量查询功能和坐标转换工具类 - 优化了代码格式和命名规范master
parent
c69084691e
commit
4bb5abbfd9
6
pom.xml
6
pom.xml
|
@ -224,12 +224,6 @@
|
|||
<version>${lombok.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<version>5.2.9.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
<!-- OSS -->
|
||||
<dependency>
|
||||
<groupId>com.aliyun.oss</groupId>
|
||||
|
|
|
@ -2,6 +2,11 @@ package com.zcloud.common.utils;
|
|||
|
||||
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等)
|
||||
* @return 格式化地址
|
||||
*/
|
||||
public static String getAddressByLocation(double lng, double lat, String coordtype) throws Exception {
|
||||
String url = String.format(
|
||||
"http://api.map.baidu.com/reverse_geocoding/v3/?ak=%s&output=json&coordtype=%s&location=%s,%s",
|
||||
BAIDU_AK, coordtype, lat, lng); // 注意百度坐标系是纬度在前
|
||||
"http://api.map.baidu.com/reverse_geocoding/v3/?ak=%s&output=json&coordtype=%s&location=%s,%s",
|
||||
BAIDU_AK, coordtype, lat, lng); // 注意百度坐标系是纬度在前
|
||||
|
||||
String response = HttpRequestUtil.doGet(url);
|
||||
JSONObject result = JSONObject.parseObject(response);
|
||||
|
||||
if (result.getInteger("status") == 0) {
|
||||
return result.getJSONObject("result")
|
||||
.getString("formatted_address");
|
||||
.getString("formatted_address");
|
||||
}
|
||||
throw new RuntimeException("地址解析失败:" + result.getString("message"));
|
||||
}
|
||||
|
@ -35,4 +41,79 @@ public class BaiduMapUtil {
|
|||
public static String getAddressByLocation(double lng, double lat) throws Exception {
|
||||
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);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
@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 io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author fangjiakai
|
||||
* @Desc 尾矿库基本信息表(BusTailingsReservoir)表控制层
|
||||
* @Date 2025-06-09 10:14:59
|
||||
* @Desc (BusTailingsReservoir)表控制层
|
||||
* @Date 2025-06-10 18:47:46
|
||||
*/
|
||||
@Api(tags = "尾矿库基本信息表")
|
||||
@Api(tags = "")
|
||||
@RestController
|
||||
@RequestMapping("busTailingsReservoir")
|
||||
public class BusTailingsReservoirController extends AbstractController {
|
||||
|
@ -27,19 +26,19 @@ public class BusTailingsReservoirController extends AbstractController {
|
|||
@Autowired
|
||||
private BusTailingsReservoirService busTailingsReservoirService;
|
||||
|
||||
@ApiOperation("尾矿库基本信息表-新增数据")
|
||||
@SysLog("尾矿库基本信息表-新增数据")
|
||||
@ApiOperation("-新增数据")
|
||||
@SysLog("-新增数据")
|
||||
@PostMapping("/save")
|
||||
public R insert(@RequestBody BusTailingsReservoirEntity param) {
|
||||
param.setCreator(getUserId());
|
||||
param.setOperator(getUserId());
|
||||
param.setOperator(getUserId());
|
||||
busTailingsReservoirService.save(param);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("尾矿库基本信息表-编辑数据")
|
||||
@SysLog("尾矿库基本信息表-编辑数据")
|
||||
@ApiOperation("-编辑数据")
|
||||
@SysLog("-编辑数据")
|
||||
@PostMapping("/update")
|
||||
public R update(@RequestBody BusTailingsReservoirEntity param) {
|
||||
param.setOperator(getUserId());
|
||||
|
@ -49,30 +48,34 @@ public class BusTailingsReservoirController extends AbstractController {
|
|||
}
|
||||
|
||||
|
||||
@ApiOperation("尾矿库基本信息表-删除数据")
|
||||
@SysLog("尾矿库基本信息表-删除数据")
|
||||
@ApiOperation("-删除数据")
|
||||
@SysLog("-删除数据")
|
||||
@PostMapping("/delete")
|
||||
public R delete(@RequestBody BusTailingsReservoirEntity param) {
|
||||
busTailingsReservoirService.delete(param.getTailingsReservoirId(), getUserId());
|
||||
busTailingsReservoirService.delete(param.getTailingsReservoirId(),getUserId());
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("尾矿库基本信息表-分页查询")
|
||||
@SysLog("尾矿库基本信息表-分页查询")
|
||||
@ApiOperation("-分页查询")
|
||||
@SysLog("-分页查询")
|
||||
@PostMapping("/listPage")
|
||||
public R listPage(@RequestBody Map<String, Object> params) {
|
||||
PageUtils page = busTailingsReservoirService.listPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("尾矿库基本信息表-根据ID查详情")
|
||||
@SysLog("尾矿库基本信息表-根据ID查详情")
|
||||
@ApiOperation("-根据ID查详情")
|
||||
@SysLog("-根据ID查详情")
|
||||
@PostMapping("/info")
|
||||
public R info(@RequestBody BusTailingsReservoirEntity param) {
|
||||
BusTailingsReservoirEntity busTailingsReservoir = busTailingsReservoirService.getById(param.getTailingsReservoirId());
|
||||
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);
|
||||
}
|
||||
|
||||
@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 org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import java.util.Map;
|
||||
/**
|
||||
* @Author fangjiakai
|
||||
* @Desc 尾矿库基本信息表(BusTailingsReservoir)表数据库访问层
|
||||
* @Date 2025-06-09 10:15:00
|
||||
* @Desc (BusTailingsReservoir)表数据库访问层
|
||||
* @Date 2025-06-10 18:47:48
|
||||
*/
|
||||
@Mapper
|
||||
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 = "地区")
|
||||
private String areaName;
|
||||
//级别
|
||||
@ApiModelProperty(value = "级别")
|
||||
private String emergencyLevel;
|
||||
//地址
|
||||
@ApiModelProperty(value = "地址")
|
||||
private String address;
|
||||
//管理单位
|
||||
@ApiModelProperty(value = "管理单位")
|
||||
private String managementUnit;
|
||||
|
|
|
@ -11,62 +11,92 @@ import java.io.Serializable;
|
|||
|
||||
/**
|
||||
* @Author fangjiakai
|
||||
* @Desc 尾矿库基本信息表(BusTailingsReservoir)实体
|
||||
* @Date 2025-06-09 10:14:59
|
||||
* @Desc (BusTailingsReservoir)实体
|
||||
* @Date 2025-06-10 18:47:45
|
||||
*/
|
||||
@Data
|
||||
@TableName("bus_tailings_reservoir")
|
||||
public class BusTailingsReservoirEntity implements Serializable {
|
||||
private static final long serialVersionUID = -81902974361413735L;
|
||||
private static final long serialVersionUID = 956061069869617279L;
|
||||
//尾矿库唯一ID
|
||||
@ApiModelProperty(value = "尾矿库唯一ID")
|
||||
@TableId
|
||||
private String tailingsReservoirId;
|
||||
//归属单位
|
||||
@ApiModelProperty(value = "归属单位")
|
||||
private String ownerUnit;
|
||||
//名称
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
//地址
|
||||
@ApiModelProperty(value = "地址")
|
||||
private String address;
|
||||
//尾矿库名称
|
||||
@ApiModelProperty(value = "尾矿库名称")
|
||||
private String reservoirName;
|
||||
//类型(字典)
|
||||
@ApiModelProperty(value = "类型(字典)")
|
||||
private String reservoirType;
|
||||
//是否备案(字典:是/否)
|
||||
@ApiModelProperty(value = "是否备案(字典:是/否)")
|
||||
private String isRecorded;
|
||||
//备案日期
|
||||
@ApiModelProperty(value = "备案日期")
|
||||
private String recordDate;
|
||||
//坝高(m)
|
||||
@ApiModelProperty(value = "坝高(m)")
|
||||
private Double damHeight;
|
||||
//库容(万m³)
|
||||
@ApiModelProperty(value = "库容(万m³)")
|
||||
private Double capacity;
|
||||
//等级(字典)
|
||||
@ApiModelProperty(value = "等级(字典)")
|
||||
private String reservoirGrade;
|
||||
//最小安全超高(m)
|
||||
@ApiModelProperty(value = "最小安全超高(m)")
|
||||
private Double minSafetyHeight;
|
||||
//最小滩长(m)
|
||||
@ApiModelProperty(value = "最小滩长(m)")
|
||||
private Double minBeachLength;
|
||||
//坝的级别(字典)
|
||||
@ApiModelProperty(value = "坝的级别(字典)")
|
||||
private String damGrade;
|
||||
//联系人
|
||||
@ApiModelProperty(value = "联系人")
|
||||
private String contactPerson;
|
||||
//联系电话
|
||||
@ApiModelProperty(value = "联系电话")
|
||||
private String contactPhone;
|
||||
//备注
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
//省(字典)
|
||||
@ApiModelProperty(value = "省(字典)")
|
||||
private String province;
|
||||
//市(字典)
|
||||
@ApiModelProperty(value = "市(字典)")
|
||||
private String city;
|
||||
//县(字典)
|
||||
@ApiModelProperty(value = "县(字典)")
|
||||
private String county;
|
||||
//乡(字典)
|
||||
@ApiModelProperty(value = "乡(字典)")
|
||||
private String village;
|
||||
//街(字典)
|
||||
@ApiModelProperty(value = "街(字典)")
|
||||
private String street;
|
||||
//地区
|
||||
@ApiModelProperty(value = "地区")
|
||||
private String areaName;
|
||||
//运行状态
|
||||
@ApiModelProperty(value = "运行状态")
|
||||
private String runningStatus;
|
||||
//是否有生产经营主体
|
||||
@ApiModelProperty(value = "是否有生产经营主体")
|
||||
private String hasProductionEntity;
|
||||
//是否为头顶库
|
||||
@ApiModelProperty(value = "是否为头顶库")
|
||||
private String isOverheadVault;
|
||||
//矿种
|
||||
@ApiModelProperty(value = "矿种")
|
||||
private String mineralSpecies;
|
||||
//设计等别
|
||||
@ApiModelProperty(value = "设计等别")
|
||||
private String designGrade;
|
||||
//现状等别
|
||||
@ApiModelProperty(value = "现状等别")
|
||||
private String currentGrade;
|
||||
//设计坝高
|
||||
@ApiModelProperty(value = "设计坝高")
|
||||
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 = "经度")
|
||||
private Double longitude;
|
||||
|
|
|
@ -10,15 +10,14 @@ import java.util.Map;
|
|||
|
||||
/**
|
||||
* @Author fangjiakai
|
||||
* @Desc 尾矿库基本信息表(BusTailingsReservoir)表服务接口
|
||||
* @Date 2025-06-09 10:15:00
|
||||
* @Desc (BusTailingsReservoir)表服务接口
|
||||
* @Date 2025-06-10 18:47:47
|
||||
*/
|
||||
public interface BusTailingsReservoirService extends IService<BusTailingsReservoirEntity> {
|
||||
|
||||
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;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zcloud.common.utils.PageUtils;
|
||||
import com.zcloud.modules.kangzai.dao.BusTailingsReservoirDao;
|
||||
import com.zcloud.modules.kangzai.entity.BusTailingsReservoirEntity;
|
||||
import com.zcloud.modules.kangzai.service.BusTailingsReservoirService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zcloud.common.utils.PageUtils;
|
||||
import com.zcloud.modules.kangzai.dao.BusTailingsReservoirDao;
|
||||
import com.zcloud.modules.kangzai.entity.BusTailingsReservoirEntity;
|
||||
import com.zcloud.modules.kangzai.service.BusTailingsReservoirService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author fangjiakai
|
||||
* @Desc 尾矿库基本信息表(BusTailingsReservoir)表服务实现类
|
||||
* @Date 2025-06-09 10:15:00
|
||||
* @Desc (BusTailingsReservoir)表服务实现类
|
||||
* @Date 2025-06-10 18:47:47
|
||||
*/
|
||||
@Service("busTailingsReservoirService")
|
||||
public class BusTailingsReservoirServiceImpl extends ServiceImpl<BusTailingsReservoirDao, BusTailingsReservoirEntity> implements BusTailingsReservoirService {
|
||||
|
||||
@Override
|
||||
public BusTailingsReservoirEntity queryByFlexibleParams(String paramName, Object paramValue) {
|
||||
QueryWrapper<BusTailingsReservoirEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq(paramName, paramValue); // 根据传入的参数名和参数值动态构建查询条件
|
||||
public BusTailingsReservoirEntity queryByFlexibleParams(String paramName, Object paramValue) {
|
||||
QueryWrapper<BusTailingsReservoirEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq(paramName, paramValue); // 根据传入的参数名和参数值动态构建查询条件
|
||||
|
||||
return baseMapper.selectOne(queryWrapper);
|
||||
}
|
||||
return baseMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BusTailingsReservoirEntity> queryListByFlexibleParams(String paramName, Object paramValue) {
|
||||
QueryWrapper<BusTailingsReservoirEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq(paramName, paramValue); // 根据传入的参数名和参数值动态构建查询条件
|
||||
@Override
|
||||
public List<BusTailingsReservoirEntity> queryListByFlexibleParams(String paramName, Object paramValue) {
|
||||
QueryWrapper<BusTailingsReservoirEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq(paramName, paramValue); // 根据传入的参数名和参数值动态构建查询条件
|
||||
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
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()));
|
||||
params.put("isDelete", 0);
|
||||
IPage<BusTailingsReservoirEntity> ipage = baseMapper.listPage(page, params);
|
||||
Page<Map<String,Object>> page = new Page<>(Integer.parseInt(params.get("curPage").toString()),Integer.parseInt(params.get("limit").toString()));
|
||||
params.put("isDelete",0);
|
||||
IPage<BusTailingsReservoirEntity> ipage = baseMapper.listPage(page,params);
|
||||
return new PageUtils(ipage);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void delete(String tailingsReservoirId, String userId) {
|
||||
UpdateWrapper<BusTailingsReservoirEntity> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("tailings_reservoir_id", tailingsReservoirId);
|
||||
@Override
|
||||
public void delete(String tailingsReservoirId,String userId){
|
||||
UpdateWrapper<BusTailingsReservoirEntity> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("tailings_reservoir_id",tailingsReservoirId);
|
||||
|
||||
BusTailingsReservoirEntity busTailingsReservoir = new BusTailingsReservoirEntity();
|
||||
busTailingsReservoir.setOperator(userId);
|
||||
busTailingsReservoir.setIsDelete(1);
|
||||
BusTailingsReservoirEntity busTailingsReservoir = new BusTailingsReservoirEntity();
|
||||
busTailingsReservoir.setOperator(userId);
|
||||
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
|
||||
t.*
|
||||
t.*
|
||||
FROM bus_tailings_reservoir t
|
||||
<where>
|
||||
<if test="params.tailingsReservoirId != null and params.tailingsReservoirId != ''">
|
||||
AND t.tailings_reservoir_id = #{params.tailingsReservoirId}
|
||||
AND t.tailings_reservoir_id = #{params.tailingsReservoirId}
|
||||
</if>
|
||||
<if test="params.ownerUnit != null and params.ownerUnit != ''">
|
||||
AND t.owner_unit = #{params.ownerUnit}
|
||||
<if test="params.name != null and params.name != ''">
|
||||
AND t.name = #{params.name}
|
||||
</if>
|
||||
<if test="params.address != null and params.address != ''">
|
||||
AND t.address = #{params.address}
|
||||
AND t.address = #{params.address}
|
||||
</if>
|
||||
<if test="params.reservoirName != null and params.reservoirName != ''">
|
||||
AND t.reservoir_name like '%${params.reservoirName}%'
|
||||
<if test="params.province != null and params.province != ''">
|
||||
AND t.province = #{params.province}
|
||||
</if>
|
||||
<if test="params.reservoirType != null and params.reservoirType != ''">
|
||||
AND t.reservoir_type = #{params.reservoirType}
|
||||
<if test="params.city != null and params.city != ''">
|
||||
AND t.city = #{params.city}
|
||||
</if>
|
||||
<if test="params.isRecorded != null and params.isRecorded != ''">
|
||||
AND t.is_recorded = #{params.isRecorded}
|
||||
<if test="params.county != null and params.county != ''">
|
||||
AND t.county = #{params.county}
|
||||
</if>
|
||||
<if test="params.recordDate != null and params.recordDate != ''">
|
||||
AND t.record_date = #{params.recordDate}
|
||||
<if test="params.village != null and params.village != ''">
|
||||
AND t.village = #{params.village}
|
||||
</if>
|
||||
<if test="params.damHeight != null and params.damHeight != ''">
|
||||
AND t.dam_height = #{params.damHeight}
|
||||
<if test="params.street != null and params.street != ''">
|
||||
AND t.street = #{params.street}
|
||||
</if>
|
||||
<if test="params.capacity != null and params.capacity != ''">
|
||||
AND t.capacity = #{params.capacity}
|
||||
<if test="params.areaName != null and params.areaName != ''">
|
||||
AND t.area_name = #{params.areaName}
|
||||
</if>
|
||||
<if test="params.reservoirGrade != null and params.reservoirGrade != ''">
|
||||
AND t.reservoir_grade = #{params.reservoirGrade}
|
||||
<if test="params.runningStatus != null and params.runningStatus != ''">
|
||||
AND t.running_status = #{params.runningStatus}
|
||||
</if>
|
||||
<if test="params.minSafetyHeight != null and params.minSafetyHeight != ''">
|
||||
AND t.min_safety_height = #{params.minSafetyHeight}
|
||||
<if test="params.hasProductionEntity != null and params.hasProductionEntity != ''">
|
||||
AND t.has_production_entity = #{params.hasProductionEntity}
|
||||
</if>
|
||||
<if test="params.minBeachLength != null and params.minBeachLength != ''">
|
||||
AND t.min_beach_length = #{params.minBeachLength}
|
||||
<if test="params.isOverheadVault != null and params.isOverheadVault != ''">
|
||||
AND t.is_overhead_vault = #{params.isOverheadVault}
|
||||
</if>
|
||||
<if test="params.damGrade != null and params.damGrade != ''">
|
||||
AND t.dam_grade = #{params.damGrade}
|
||||
<if test="params.mineralSpecies != null and params.mineralSpecies != ''">
|
||||
AND t.mineral_species = #{params.mineralSpecies}
|
||||
</if>
|
||||
<if test="params.contactPerson != null and params.contactPerson != ''">
|
||||
AND t.contact_person = #{params.contactPerson}
|
||||
<if test="params.designGrade != null and params.designGrade != ''">
|
||||
AND t.design_grade = #{params.designGrade}
|
||||
</if>
|
||||
<if test="params.contactPhone != null and params.contactPhone != ''">
|
||||
AND t.contact_phone = #{params.contactPhone}
|
||||
<if test="params.currentGrade != null and params.currentGrade != ''">
|
||||
AND t.current_grade = #{params.currentGrade}
|
||||
</if>
|
||||
<if test="params.remarks != null and params.remarks != ''">
|
||||
AND t.remarks = #{params.remarks}
|
||||
<if test="params.designDamHeight != null and params.designDamHeight != ''">
|
||||
AND t.design_dam_height = #{params.designDamHeight}
|
||||
</if>
|
||||
<if test="params.longitude != null and params.longitude != ''">
|
||||
AND t.longitude = #{params.longitude}
|
||||
<if test="params.currentDamHeight != null and params.currentDamHeight != ''">
|
||||
AND t.current_dam_height = #{params.currentDamHeight}
|
||||
</if>
|
||||
<if test="params.latitude != null and params.latitude != ''">
|
||||
AND t.latitude = #{params.latitude}
|
||||
<if test="params.designStorageCapacity != null and params.designStorageCapacity != ''">
|
||||
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 test="params.creator != null and params.creator != ''">
|
||||
AND t.creator = #{params.creator}
|
||||
AND t.creator = #{params.creator}
|
||||
</if>
|
||||
<if test="params.createTime != null and params.createTime != ''">
|
||||
AND t.create_time = #{params.createTime}
|
||||
AND t.create_time = #{params.createTime}
|
||||
</if>
|
||||
<if test="params.operator != null and params.operator != ''">
|
||||
AND t.operator = #{params.operator}
|
||||
AND t.operator = #{params.operator}
|
||||
</if>
|
||||
<if test="params.operatTime != null and params.operatTime != ''">
|
||||
AND t.operat_time = #{params.operatTime}
|
||||
AND t.operat_time = #{params.operatTime}
|
||||
</if>
|
||||
<if test="params.isDelete != null">
|
||||
AND t.is_delete = #{params.isDelete}
|
||||
AND t.is_delete = #{params.isDelete}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY t.create_time DESC
|
||||
|
|
Loading…
Reference in New Issue