From 6c69ac15ad1705495e3bcfb3d5ea54c9d599007a Mon Sep 17 00:00:00 2001
From: zy <82248909@qq.com>
Date: Tue, 18 Nov 2025 17:01:19 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=9B=91=E6=B5=8B=E5=91=8A?=
=?UTF-8?q?=E8=AD=A6=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/lanhai/MybatisPlusGenerator.java | 2 +-
.../controller/SurvStationInfoController.java | 21 ++
.../com/lanhai/entity/SurvAlertRecord.java | 35 +++-
.../com/lanhai/entity/SurvStationInfo.java | 190 ++++++++++++++++++
.../lanhai/mapper/SurvStationInfoMapper.java | 16 ++
.../mapper/xml/SurvStationInfoMapper.xml | 5 +
.../service/ISurvStationInfoService.java | 17 ++
.../Impl/SurvAlertRecordServiceImpl.java | 78 +++----
.../Impl/SurvStationInfoServiceImpl.java | 28 +++
9 files changed, 355 insertions(+), 37 deletions(-)
create mode 100644 src/main/java/com/lanhai/controller/SurvStationInfoController.java
create mode 100644 src/main/java/com/lanhai/entity/SurvStationInfo.java
create mode 100644 src/main/java/com/lanhai/mapper/SurvStationInfoMapper.java
create mode 100644 src/main/java/com/lanhai/mapper/xml/SurvStationInfoMapper.xml
create mode 100644 src/main/java/com/lanhai/service/ISurvStationInfoService.java
create mode 100644 src/main/java/com/lanhai/service/Impl/SurvStationInfoServiceImpl.java
diff --git a/src/main/java/com/lanhai/MybatisPlusGenerator.java b/src/main/java/com/lanhai/MybatisPlusGenerator.java
index 673bb0f..bef4acf 100644
--- a/src/main/java/com/lanhai/MybatisPlusGenerator.java
+++ b/src/main/java/com/lanhai/MybatisPlusGenerator.java
@@ -80,7 +80,7 @@ public class MybatisPlusGenerator {
public static void main(String[] args) {
- new MybatisPlusGenerator().generator("surv_hisdata_livestockwater_error","surv_hisdata_orientwater_error");//指标
+ new MybatisPlusGenerator().generator("surv_station_info");//指标
}
diff --git a/src/main/java/com/lanhai/controller/SurvStationInfoController.java b/src/main/java/com/lanhai/controller/SurvStationInfoController.java
new file mode 100644
index 0000000..f04d7ef
--- /dev/null
+++ b/src/main/java/com/lanhai/controller/SurvStationInfoController.java
@@ -0,0 +1,21 @@
+package com.lanhai.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+/**
+ *
+ * 检测站点表 前端控制器
+ *
+ *
+ * @author ${author}
+ * @since 2025-11-18
+ */
+@Controller
+@RequestMapping("/survStationInfo")
+public class SurvStationInfoController {
+
+}
+
diff --git a/src/main/java/com/lanhai/entity/SurvAlertRecord.java b/src/main/java/com/lanhai/entity/SurvAlertRecord.java
index 51d5b70..9ac437a 100644
--- a/src/main/java/com/lanhai/entity/SurvAlertRecord.java
+++ b/src/main/java/com/lanhai/entity/SurvAlertRecord.java
@@ -132,8 +132,15 @@ public class SurvAlertRecord extends Model {
@TableField("ALERT_TIME")
private Date alertTime;
+
/**
- * 监测项
+ * 监测项编号
+ */
+ @TableField("ITEM_CODE")
+ private String itemCode;
+
+ /**
+ * 监测项名称
*/
@TableField("ITEM_NAME")
private String itemName;
@@ -160,6 +167,32 @@ public class SurvAlertRecord extends Model {
private String orgMessage;
+ /**
+ * 正常值
+ */
+ @TableField("NORMAL_VALUE")
+ private String normalValue;
+
+ /**
+ * 监测值
+ */
+ @TableField("SURV_VALUE")
+ private String survValue;
+
+
+ /**
+ * 监测情况
+ */
+ @TableField("READ_STATUS")
+ private String readStatus;
+
+ /**
+ * 监测单位
+ */
+ @TableField("SURV_UNIT")
+ private String survUnit;
+
+
@Override
protected Serializable pkVal() {
return this.id;
diff --git a/src/main/java/com/lanhai/entity/SurvStationInfo.java b/src/main/java/com/lanhai/entity/SurvStationInfo.java
new file mode 100644
index 0000000..fa21f77
--- /dev/null
+++ b/src/main/java/com/lanhai/entity/SurvStationInfo.java
@@ -0,0 +1,190 @@
+package com.lanhai.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ *
+ * 检测站点表
+ *
+ *
+ * @author ${author}
+ * @since 2025-11-18
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class SurvStationInfo extends Model {
+
+ private static final long serialVersionUID=1L;
+
+ /**
+ * 主键
+ */
+ @TableId(value = "ID", type = IdType.ID_WORKER_STR)
+ private String id;
+
+ /**
+ * 站点名称
+ */
+ @TableField("STATION_NAME")
+ private String stationName;
+
+ /**
+ * 经度
+ */
+ @TableField("STATION_LATITUDE")
+ private String stationLatitude;
+
+ /**
+ * 纬度
+ */
+ @TableField("STATION_LONGITUDE")
+ private String stationLongitude;
+
+ /**
+ * 站点类型,livestock=畜禽,orient=农田
+ */
+ @TableField("STATION_TYPE")
+ private String stationType;
+
+ /**
+ * 所属企业ID
+ */
+ @TableField("CORP_ID")
+ private String corpId;
+
+ /**
+ * 排序号
+ */
+ @TableField("SORT_NO")
+ private Integer sortNo;
+
+ /**
+ * 站点负责人
+ */
+ @TableField("CONTACT_NAME")
+ private String contactName;
+
+ /**
+ * 站点编号
+ */
+ @TableField("STATION_CODE")
+ private String stationCode;
+
+ /**
+ * 站点联系电话
+ */
+ @TableField("CONTACT_PHONE")
+ private String contactPhone;
+
+ /**
+ * 建站时间
+ */
+ @TableField("BUILD_TIME")
+ private Date buildTime;
+
+ /**
+ * 站点位置
+ */
+ @TableField("STATION_LOCATION")
+ private String stationLocation;
+
+ /**
+ * 监测范围
+ */
+ @TableField("SURV_RANGE")
+ private String survRange;
+
+ /**
+ * 监测对象;数组
+ */
+ @TableField("SURV_OBJ")
+ private String survObj;
+
+ /**
+ * 监测频率
+ */
+ @TableField("SURV_FREQUENCY")
+ private String survFrequency;
+
+ /**
+ * 租户号
+ */
+ @TableField("TENANT_ID")
+ private String tenantId;
+
+ /**
+ * 乐观锁
+ */
+ @TableField("RE_VISION")
+ private Integer reVision;
+
+ /**
+ * 创建人
+ */
+ @TableField("CREATED_BY")
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ @TableField("CREATE_TIME")
+ private Date createTime;
+
+ /**
+ * 更新人
+ */
+ @TableField("UPDATED_BY")
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ @TableField("UPDATED_TIME")
+ private Date updatedTime;
+
+ /**
+ * 逻辑删除
+ */
+ @TableField("IS_DEL")
+ private Integer isDel;
+
+ /**
+ * 站点图片
+ */
+ @TableField("STATION_PIC")
+ private String stationPic;
+
+ /**
+ * 站点图标
+ */
+ @TableField("STATION_ICON")
+ private String stationIcon;
+
+ /**
+ * 站点管理
+ */
+ @TableField("STATION_ORG")
+ private String stationOrg;
+
+ /**
+ * 站点介绍
+ */
+ @TableField("STATION_INTRO")
+ private String stationIntro;
+
+
+ @Override
+ protected Serializable pkVal() {
+ return this.id;
+ }
+
+}
diff --git a/src/main/java/com/lanhai/mapper/SurvStationInfoMapper.java b/src/main/java/com/lanhai/mapper/SurvStationInfoMapper.java
new file mode 100644
index 0000000..d98c2ca
--- /dev/null
+++ b/src/main/java/com/lanhai/mapper/SurvStationInfoMapper.java
@@ -0,0 +1,16 @@
+package com.lanhai.mapper;
+
+import com.lanhai.entity.SurvStationInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ *
+ * 检测站点表 Mapper 接口
+ *
+ *
+ * @author ${author}
+ * @since 2025-11-18
+ */
+public interface SurvStationInfoMapper extends BaseMapper {
+
+}
diff --git a/src/main/java/com/lanhai/mapper/xml/SurvStationInfoMapper.xml b/src/main/java/com/lanhai/mapper/xml/SurvStationInfoMapper.xml
new file mode 100644
index 0000000..c17ef09
--- /dev/null
+++ b/src/main/java/com/lanhai/mapper/xml/SurvStationInfoMapper.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/src/main/java/com/lanhai/service/ISurvStationInfoService.java b/src/main/java/com/lanhai/service/ISurvStationInfoService.java
new file mode 100644
index 0000000..4f6697c
--- /dev/null
+++ b/src/main/java/com/lanhai/service/ISurvStationInfoService.java
@@ -0,0 +1,17 @@
+package com.lanhai.service;
+
+import com.lanhai.entity.SurvStationInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ *
+ * 检测站点表 服务类
+ *
+ *
+ * @author ${author}
+ * @since 2025-11-18
+ */
+public interface ISurvStationInfoService extends IService {
+
+ SurvStationInfo getByCode(String stationCode);
+}
diff --git a/src/main/java/com/lanhai/service/Impl/SurvAlertRecordServiceImpl.java b/src/main/java/com/lanhai/service/Impl/SurvAlertRecordServiceImpl.java
index 022f370..fe32945 100644
--- a/src/main/java/com/lanhai/service/Impl/SurvAlertRecordServiceImpl.java
+++ b/src/main/java/com/lanhai/service/Impl/SurvAlertRecordServiceImpl.java
@@ -9,10 +9,12 @@ import com.lanhai.constant.CommonConstant;
import com.lanhai.constant.DeviceReadConstants;
import com.lanhai.entity.SurvAlertRecord;
import com.lanhai.entity.SurvDeviceDeploy;
+import com.lanhai.entity.SurvStationInfo;
import com.lanhai.mapper.SurvAlertRecordMapper;
import com.lanhai.service.IScEquZhibiaoService;
import com.lanhai.service.ISurvAlertRecordService;
import com.lanhai.service.ISurvDeviceDeployService;
+import com.lanhai.service.ISurvStationInfoService;
import com.lanhai.util.DataUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -34,6 +36,8 @@ public class SurvAlertRecordServiceImpl extends ServiceImpl baowenMap) {
@@ -187,38 +191,42 @@ public class SurvAlertRecordServiceImpl extends ServiceImpl mails = new ArrayList();
-// if(StringUtils.isNotBlank(sb.toString()) || jsonarr.size()>0){
-// List saveList = new ArrayList<>();
-// for (int i=0;i0){
+ List saveList = new ArrayList<>();
+ for (int i=0;i0){
-// saveBatch(saveList);
-// }
+ }
+ if(saveList.size()>0){
+ saveBatch(saveList);
+ }
// if(!mails.isEmpty()){
// for (VOEmailContent mail : mails) {
// log.error("======xxxxxxxxxxxxxxxxxxxxxxxxxx====预警触发发送邮件至:"+mail.getMailBox());
@@ -246,8 +254,8 @@ public class SurvAlertRecordServiceImpl extends ServiceImpl
+ * 检测站点表 服务实现类
+ *
+ *
+ * @author ${author}
+ * @since 2025-11-18
+ */
+@Service
+public class SurvStationInfoServiceImpl extends ServiceImpl implements ISurvStationInfoService {
+
+ @Override
+ public SurvStationInfo getByCode(String stationCode) {
+ SurvStationInfo survStationInfo = lambdaQuery().eq(SurvStationInfo::getStationCode,stationCode)
+ .orderByDesc(SurvStationInfo::getCreateTime)
+ .last("limit 1")
+ .one();
+ return survStationInfo;
+ }
+}