气象设备实时数据修改
This commit is contained in:
parent
921ffc4fb5
commit
60f48d503c
@ -1,24 +1,17 @@
|
||||
package com.fastbee.deviceData.api.renke.service;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.fastbee.deviceData.api.renke.constant.RenKeDeviceTypeConstant;
|
||||
import com.fastbee.deviceData.domain.DeviceRealtimedataMeteorology;
|
||||
import com.fastbee.deviceData.domain.DeviceRealtimedataWorms;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collector;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class RenKeUserDeviceOverview {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.fastbee.deviceData.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.math.BigDecimal;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@ -14,77 +14,89 @@ import com.fastbee.common.core.domain.BaseEntity;
|
||||
* 气象设备实时数据对象 iot_device_realtimedata_meteorology
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-11-08
|
||||
* @date 2024-11-13
|
||||
*/
|
||||
@ApiModel(value = "DeviceRealtimedataMeteorology",description = "气象设备实时数据 iot_device_realtimedata_meteorology")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("iot_device_realtimedata_meteorology")
|
||||
public class DeviceRealtimedataMeteorology extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 节点编号 */
|
||||
private Long nodeId;
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 节点名称 */
|
||||
@Excel(name = "节点名称")
|
||||
@ApiModelProperty("节点名称")
|
||||
private String nodeName;
|
||||
/** 设备id */
|
||||
@Excel(name = "设备id")
|
||||
@ApiModelProperty("设备id")
|
||||
private Long deviceId;
|
||||
|
||||
/** 节点类型 -- 节点类型 --1:模拟量1使能模拟量2使能 --2:模拟量1使能模拟量2禁用 --3:模拟量1禁用模拟量2使能 --4:浮点型设备--5:开关量型设备 --6:32位有符号整形 --7:32位无符号整形--8:遥调设备 */
|
||||
@Excel(name = "节点类型 -- 节点类型 --1:模拟量1使能模拟量2使能 --2:模拟量1使能模拟量2禁用 --3:模拟量1禁用模拟量2使能 --4:浮点型设备--5:开关量型设备 --6:32位有符号整形 --7:32位无符号整形--8:遥调设备")
|
||||
@ApiModelProperty("节点类型 -- 节点类型 --1:模拟量1使能模拟量2使能 --2:模拟量1使能模拟量2禁用 --3:模拟量1禁用模拟量2使能 --4:浮点型设备--5:开关量型设备 --6:32位有符号整形 --7:32位无符号整形--8:遥调设备")
|
||||
private Long nodeType;
|
||||
/** 空气温度 */
|
||||
@Excel(name = "空气温度")
|
||||
@ApiModelProperty("空气温度")
|
||||
private BigDecimal airTemp;
|
||||
|
||||
/** 模拟量1名称 */
|
||||
@Excel(name = "模拟量1名称")
|
||||
@ApiModelProperty("模拟量1名称")
|
||||
private String temName;
|
||||
/** 空气湿度 */
|
||||
@Excel(name = "空气湿度")
|
||||
@ApiModelProperty("空气湿度")
|
||||
private BigDecimal airHumi;
|
||||
|
||||
/** 模拟量1单位 */
|
||||
@Excel(name = "模拟量1单位")
|
||||
@ApiModelProperty("模拟量1单位")
|
||||
private String temUnit;
|
||||
/** 风速 */
|
||||
@Excel(name = "风速")
|
||||
@ApiModelProperty("风速")
|
||||
private BigDecimal windSpeed;
|
||||
|
||||
/** 模拟量1原值 */
|
||||
@Excel(name = "模拟量1原值")
|
||||
@ApiModelProperty("模拟量1原值")
|
||||
private Long temValue;
|
||||
/** 风向 */
|
||||
@Excel(name = "风向")
|
||||
@ApiModelProperty("风向")
|
||||
private Long windDir;
|
||||
|
||||
/** 模拟量1显示值 */
|
||||
@Excel(name = "模拟量1显示值")
|
||||
@ApiModelProperty("模拟量1显示值")
|
||||
private String temValueStr;
|
||||
/** 大气压力 */
|
||||
@Excel(name = "大气压力")
|
||||
@ApiModelProperty("大气压力")
|
||||
private BigDecimal airPre;
|
||||
|
||||
/** 报警等级, -- 报警等级 --0:正常--1:超上限报警 --2:超下限报警 --3:开关闭合报警 --4:开关断开报警 --5:遥调报警 */
|
||||
@Excel(name = "报警等级, -- 报警等级 --0:正常--1:超上限报警 --2:超下限报警 --3:开关闭合报警 --4:开关断开报警 --5:遥调报警")
|
||||
@ApiModelProperty("报警等级, -- 报警等级 --0:正常--1:超上限报警 --2:超下限报警 --3:开关闭合报警 --4:开关断开报警 --5:遥调报警")
|
||||
private Long temAlarmStatus;
|
||||
/** 光照度 */
|
||||
@Excel(name = "光照度")
|
||||
@ApiModelProperty("光照度")
|
||||
private Long guangzhao;
|
||||
|
||||
/** 模拟量2名称 */
|
||||
@Excel(name = "模拟量2名称")
|
||||
@ApiModelProperty("模拟量2名称")
|
||||
private String humName;
|
||||
/** 光合有效辐射 */
|
||||
@Excel(name = "光合有效辐射")
|
||||
@ApiModelProperty("光合有效辐射")
|
||||
private BigDecimal fushe;
|
||||
|
||||
/** 模拟量2单位 */
|
||||
@Excel(name = "模拟量2单位")
|
||||
@ApiModelProperty("模拟量2单位")
|
||||
private String humUnit;
|
||||
/** 累积雨量 */
|
||||
@Excel(name = "累积雨量")
|
||||
@ApiModelProperty("累积雨量")
|
||||
private BigDecimal sumRain;
|
||||
|
||||
/** 模拟量2原值 */
|
||||
@Excel(name = "模拟量2原值")
|
||||
@ApiModelProperty("模拟量2原值")
|
||||
private Long humValue;
|
||||
/** 瞬时雨量 */
|
||||
@Excel(name = "瞬时雨量")
|
||||
@ApiModelProperty("瞬时雨量")
|
||||
private BigDecimal insRain;
|
||||
|
||||
/** 模拟量2显示值 */
|
||||
@Excel(name = "模拟量2显示值")
|
||||
@ApiModelProperty("模拟量2显示值")
|
||||
private String humValueStr;
|
||||
/** 日雨量 */
|
||||
@Excel(name = "日雨量")
|
||||
@ApiModelProperty("日雨量")
|
||||
private BigDecimal dayRain;
|
||||
|
||||
/** 报警等级 , --0:正常 --1:超上限报警 --2:超下限报警 */
|
||||
@Excel(name = "报警等级 , --0:正常 --1:超上限报警 --2:超下限报警")
|
||||
@ApiModelProperty("报警等级 , --0:正常 --1:超上限报警 --2:超下限报警")
|
||||
private Long humAlarmStatus;
|
||||
/** 蒸发量 */
|
||||
@Excel(name = "蒸发量")
|
||||
@ApiModelProperty("蒸发量")
|
||||
private BigDecimal zhengfa;
|
||||
|
||||
/** 土壤温度 */
|
||||
@Excel(name = "土壤温度")
|
||||
@ApiModelProperty("土壤温度")
|
||||
private BigDecimal soilTemp;
|
||||
|
||||
/** 土壤湿度 */
|
||||
@Excel(name = "土壤湿度")
|
||||
@ApiModelProperty("土壤湿度")
|
||||
private BigDecimal soilHumi;
|
||||
|
||||
/** 删除标志(0代表存在,2代表删除) */
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
|
@ -1,8 +1,6 @@
|
||||
package com.fastbee.deviceData.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fastbee.deviceData.domain.DeviceRealtimedataMeteorology;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@ -10,18 +8,18 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
* 气象设备实时数据Mapper接口
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-11-08
|
||||
* @date 2024-11-13
|
||||
*/
|
||||
@Mapper
|
||||
public interface DeviceRealtimedataMeteorologyMapper extends BaseMapper<DeviceRealtimedataMeteorology>
|
||||
public interface DeviceRealtimedataMeteorologyMapper
|
||||
{
|
||||
/**
|
||||
* 查询气象设备实时数据
|
||||
*
|
||||
* @param nodeId 气象设备实时数据主键
|
||||
* @param id 气象设备实时数据主键
|
||||
* @return 气象设备实时数据
|
||||
*/
|
||||
public DeviceRealtimedataMeteorology selectDeviceRealtimedataMeteorologyByNodeId(Long nodeId);
|
||||
public DeviceRealtimedataMeteorology selectDeviceRealtimedataMeteorologyById(Long id);
|
||||
|
||||
/**
|
||||
* 查询气象设备实时数据列表
|
||||
@ -50,16 +48,16 @@ public interface DeviceRealtimedataMeteorologyMapper extends BaseMapper<DeviceRe
|
||||
/**
|
||||
* 删除气象设备实时数据
|
||||
*
|
||||
* @param nodeId 气象设备实时数据主键
|
||||
* @param id 气象设备实时数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeviceRealtimedataMeteorologyByNodeId(Long nodeId);
|
||||
public int deleteDeviceRealtimedataMeteorologyById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除气象设备实时数据
|
||||
*
|
||||
* @param nodeIds 需要删除的数据主键集合
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeviceRealtimedataMeteorologyByNodeIds(Long[] nodeIds);
|
||||
public int deleteDeviceRealtimedataMeteorologyByIds(Long[] ids);
|
||||
}
|
||||
|
@ -7,17 +7,17 @@ import com.fastbee.deviceData.domain.DeviceRealtimedataMeteorology;
|
||||
* 气象设备实时数据Service接口
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-11-08
|
||||
* @date 2024-11-13
|
||||
*/
|
||||
public interface IDeviceRealtimedataMeteorologyService
|
||||
public interface IDeviceRealtimedataMeteorologyService
|
||||
{
|
||||
/**
|
||||
* 查询气象设备实时数据
|
||||
*
|
||||
* @param nodeId 气象设备实时数据主键
|
||||
* @param id 气象设备实时数据主键
|
||||
* @return 气象设备实时数据
|
||||
*/
|
||||
public DeviceRealtimedataMeteorology selectDeviceRealtimedataMeteorologyByNodeId(Long nodeId);
|
||||
public DeviceRealtimedataMeteorology selectDeviceRealtimedataMeteorologyById(Long id);
|
||||
|
||||
/**
|
||||
* 查询气象设备实时数据列表
|
||||
@ -46,16 +46,16 @@ public interface IDeviceRealtimedataMeteorologyService
|
||||
/**
|
||||
* 批量删除气象设备实时数据
|
||||
*
|
||||
* @param nodeIds 需要删除的气象设备实时数据主键集合
|
||||
* @param ids 需要删除的气象设备实时数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeviceRealtimedataMeteorologyByNodeIds(Long[] nodeIds);
|
||||
public int deleteDeviceRealtimedataMeteorologyByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除气象设备实时数据信息
|
||||
*
|
||||
* @param nodeId 气象设备实时数据主键
|
||||
* @param id 气象设备实时数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeviceRealtimedataMeteorologyByNodeId(Long nodeId);
|
||||
public int deleteDeviceRealtimedataMeteorologyById(Long id);
|
||||
}
|
||||
|
@ -2,21 +2,20 @@ package com.fastbee.deviceData.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.fastbee.common.utils.DateUtils;
|
||||
import com.fastbee.deviceData.service.IDeviceRealtimedataMeteorologyService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fastbee.deviceData.mapper.DeviceRealtimedataMeteorologyMapper;
|
||||
import com.fastbee.deviceData.domain.DeviceRealtimedataMeteorology;
|
||||
|
||||
import com.fastbee.deviceData.service.IDeviceRealtimedataMeteorologyService;
|
||||
|
||||
/**
|
||||
* 气象设备实时数据Service业务层处理
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-11-08
|
||||
* @date 2024-11-13
|
||||
*/
|
||||
@Service
|
||||
public class DeviceRealtimeDataMeteorologyServiceImpl implements IDeviceRealtimedataMeteorologyService
|
||||
public class DeviceRealtimedataMeteorologyServiceImpl implements IDeviceRealtimedataMeteorologyService
|
||||
{
|
||||
@Autowired
|
||||
private DeviceRealtimedataMeteorologyMapper deviceRealtimedataMeteorologyMapper;
|
||||
@ -24,13 +23,13 @@ public class DeviceRealtimeDataMeteorologyServiceImpl implements IDeviceRealtime
|
||||
/**
|
||||
* 查询气象设备实时数据
|
||||
*
|
||||
* @param nodeId 气象设备实时数据主键
|
||||
* @param id 气象设备实时数据主键
|
||||
* @return 气象设备实时数据
|
||||
*/
|
||||
@Override
|
||||
public DeviceRealtimedataMeteorology selectDeviceRealtimedataMeteorologyByNodeId(Long nodeId)
|
||||
public DeviceRealtimedataMeteorology selectDeviceRealtimedataMeteorologyById(Long id)
|
||||
{
|
||||
return deviceRealtimedataMeteorologyMapper.selectDeviceRealtimedataMeteorologyByNodeId(nodeId);
|
||||
return deviceRealtimedataMeteorologyMapper.selectDeviceRealtimedataMeteorologyById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -55,7 +54,7 @@ public class DeviceRealtimeDataMeteorologyServiceImpl implements IDeviceRealtime
|
||||
public int insertDeviceRealtimedataMeteorology(DeviceRealtimedataMeteorology deviceRealtimedataMeteorology)
|
||||
{
|
||||
deviceRealtimedataMeteorology.setCreateTime(DateUtils.getNowDate());
|
||||
return deviceRealtimedataMeteorologyMapper.insert(deviceRealtimedataMeteorology);
|
||||
return deviceRealtimedataMeteorologyMapper.insertDeviceRealtimedataMeteorology(deviceRealtimedataMeteorology);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -67,30 +66,31 @@ public class DeviceRealtimeDataMeteorologyServiceImpl implements IDeviceRealtime
|
||||
@Override
|
||||
public int updateDeviceRealtimedataMeteorology(DeviceRealtimedataMeteorology deviceRealtimedataMeteorology)
|
||||
{
|
||||
deviceRealtimedataMeteorology.setUpdateTime(DateUtils.getNowDate());
|
||||
return deviceRealtimedataMeteorologyMapper.updateDeviceRealtimedataMeteorology(deviceRealtimedataMeteorology);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除气象设备实时数据
|
||||
*
|
||||
* @param nodeIds 需要删除的气象设备实时数据主键
|
||||
* @param ids 需要删除的气象设备实时数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDeviceRealtimedataMeteorologyByNodeIds(Long[] nodeIds)
|
||||
public int deleteDeviceRealtimedataMeteorologyByIds(Long[] ids)
|
||||
{
|
||||
return deviceRealtimedataMeteorologyMapper.deleteDeviceRealtimedataMeteorologyByNodeIds(nodeIds);
|
||||
return deviceRealtimedataMeteorologyMapper.deleteDeviceRealtimedataMeteorologyByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除气象设备实时数据信息
|
||||
*
|
||||
* @param nodeId 气象设备实时数据主键
|
||||
* @param id 气象设备实时数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDeviceRealtimedataMeteorologyByNodeId(Long nodeId)
|
||||
public int deleteDeviceRealtimedataMeteorologyById(Long id)
|
||||
{
|
||||
return deviceRealtimedataMeteorologyMapper.deleteDeviceRealtimedataMeteorologyByNodeId(nodeId);
|
||||
return deviceRealtimedataMeteorologyMapper.deleteDeviceRealtimedataMeteorologyById(id);
|
||||
}
|
||||
}
|
@ -5,113 +5,137 @@
|
||||
<mapper namespace="com.fastbee.deviceData.mapper.DeviceRealtimedataMeteorologyMapper">
|
||||
|
||||
<resultMap type="DeviceRealtimedataMeteorology" id="DeviceRealtimedataMeteorologyResult">
|
||||
<result property="nodeId" column="node_id" />
|
||||
<result property="nodeName" column="node_name" />
|
||||
<result property="nodeType" column="node_type" />
|
||||
<result property="temName" column="tem_name" />
|
||||
<result property="temUnit" column="tem_unit" />
|
||||
<result property="temValue" column="tem_value" />
|
||||
<result property="temValueStr" column="tem_value_str" />
|
||||
<result property="temAlarmStatus" column="tem_alarm_status" />
|
||||
<result property="humName" column="hum_name" />
|
||||
<result property="humUnit" column="hum_unit" />
|
||||
<result property="humValue" column="hum_value" />
|
||||
<result property="humValueStr" column="hum_value_str" />
|
||||
<result property="humAlarmStatus" column="hum_alarm_status" />
|
||||
<result property="id" column="id" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="airTemp" column="air_temp" />
|
||||
<result property="airHumi" column="air_humi" />
|
||||
<result property="windSpeed" column="wind_speed" />
|
||||
<result property="windDir" column="wind_dir" />
|
||||
<result property="airPre" column="air_pre" />
|
||||
<result property="guangzhao" column="guangzhao" />
|
||||
<result property="fushe" column="fushe" />
|
||||
<result property="sumRain" column="sum_rain" />
|
||||
<result property="insRain" column="ins_rain" />
|
||||
<result property="dayRain" column="day_rain" />
|
||||
<result property="zhengfa" column="zhengfa" />
|
||||
<result property="soilTemp" column="soil_temp" />
|
||||
<result property="soilHumi" column="soil_humi" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDeviceRealtimedataMeteorologyVo">
|
||||
select node_id, node_name, node_type, tem_name, tem_unit, tem_value, tem_value_str, tem_alarm_status, hum_name, hum_unit, hum_value, hum_value_str, hum_alarm_status, create_time from iot_device_realtimedata_meteorology
|
||||
select id, device_id, air_temp, air_humi, wind_speed, wind_dir, air_pre, guangzhao, fushe, sum_rain, ins_rain, day_rain, zhengfa, soil_temp, soil_humi, del_flag, create_time, create_by, update_time, update_by from iot_device_realtimedata_meteorology
|
||||
</sql>
|
||||
|
||||
<select id="selectDeviceRealtimedataMeteorologyList" parameterType="DeviceRealtimedataMeteorology" resultMap="DeviceRealtimedataMeteorologyResult">
|
||||
<include refid="selectDeviceRealtimedataMeteorologyVo"/>
|
||||
<where>
|
||||
<if test="nodeName != null and nodeName != ''"> and node_name like concat('%', #{nodeName}, '%')</if>
|
||||
<if test="nodeType != null "> and node_type = #{nodeType}</if>
|
||||
<if test="temName != null and temName != ''"> and tem_name like concat('%', #{temName}, '%')</if>
|
||||
<if test="temUnit != null and temUnit != ''"> and tem_unit = #{temUnit}</if>
|
||||
<if test="temValue != null "> and tem_value = #{temValue}</if>
|
||||
<if test="temValueStr != null and temValueStr != ''"> and tem_value_str = #{temValueStr}</if>
|
||||
<if test="temAlarmStatus != null "> and tem_alarm_status = #{temAlarmStatus}</if>
|
||||
<if test="humName != null and humName != ''"> and hum_name like concat('%', #{humName}, '%')</if>
|
||||
<if test="humUnit != null and humUnit != ''"> and hum_unit = #{humUnit}</if>
|
||||
<if test="humValue != null "> and hum_value = #{humValue}</if>
|
||||
<if test="humValueStr != null and humValueStr != ''"> and hum_value_str = #{humValueStr}</if>
|
||||
<if test="humAlarmStatus != null "> and hum_alarm_status = #{humAlarmStatus}</if>
|
||||
<if test="deviceId != null "> and device_id = #{deviceId}</if>
|
||||
<if test="airTemp != null "> and air_temp = #{airTemp}</if>
|
||||
<if test="airHumi != null "> and air_humi = #{airHumi}</if>
|
||||
<if test="windSpeed != null "> and wind_speed = #{windSpeed}</if>
|
||||
<if test="windDir != null "> and wind_dir = #{windDir}</if>
|
||||
<if test="airPre != null "> and air_pre = #{airPre}</if>
|
||||
<if test="guangzhao != null "> and guangzhao = #{guangzhao}</if>
|
||||
<if test="fushe != null "> and fushe = #{fushe}</if>
|
||||
<if test="sumRain != null "> and sum_rain = #{sumRain}</if>
|
||||
<if test="insRain != null "> and ins_rain = #{insRain}</if>
|
||||
<if test="dayRain != null "> and day_rain = #{dayRain}</if>
|
||||
<if test="zhengfa != null "> and zhengfa = #{zhengfa}</if>
|
||||
<if test="soilTemp != null "> and soil_temp = #{soilTemp}</if>
|
||||
<if test="soilHumi != null "> and soil_humi = #{soilHumi}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDeviceRealtimedataMeteorologyByNodeId" parameterType="Long" resultMap="DeviceRealtimedataMeteorologyResult">
|
||||
<select id="selectDeviceRealtimedataMeteorologyById" parameterType="Long" resultMap="DeviceRealtimedataMeteorologyResult">
|
||||
<include refid="selectDeviceRealtimedataMeteorologyVo"/>
|
||||
where node_id = #{nodeId}
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertDeviceRealtimedataMeteorology" parameterType="DeviceRealtimedataMeteorology">
|
||||
<insert id="insertDeviceRealtimedataMeteorology" parameterType="DeviceRealtimedataMeteorology" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into iot_device_realtimedata_meteorology
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="nodeId != null">node_id,</if>
|
||||
<if test="nodeName != null">node_name,</if>
|
||||
<if test="nodeType != null">node_type,</if>
|
||||
<if test="temName != null">tem_name,</if>
|
||||
<if test="temUnit != null">tem_unit,</if>
|
||||
<if test="temValue != null">tem_value,</if>
|
||||
<if test="temValueStr != null">tem_value_str,</if>
|
||||
<if test="temAlarmStatus != null">tem_alarm_status,</if>
|
||||
<if test="humName != null">hum_name,</if>
|
||||
<if test="humUnit != null">hum_unit,</if>
|
||||
<if test="humValue != null">hum_value,</if>
|
||||
<if test="humValueStr != null">hum_value_str,</if>
|
||||
<if test="humAlarmStatus != null">hum_alarm_status,</if>
|
||||
<if test="deviceId != null">device_id,</if>
|
||||
<if test="airTemp != null">air_temp,</if>
|
||||
<if test="airHumi != null">air_humi,</if>
|
||||
<if test="windSpeed != null">wind_speed,</if>
|
||||
<if test="windDir != null">wind_dir,</if>
|
||||
<if test="airPre != null">air_pre,</if>
|
||||
<if test="guangzhao != null">guangzhao,</if>
|
||||
<if test="fushe != null">fushe,</if>
|
||||
<if test="sumRain != null">sum_rain,</if>
|
||||
<if test="insRain != null">ins_rain,</if>
|
||||
<if test="dayRain != null">day_rain,</if>
|
||||
<if test="zhengfa != null">zhengfa,</if>
|
||||
<if test="soilTemp != null">soil_temp,</if>
|
||||
<if test="soilHumi != null">soil_humi,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="nodeId != null">#{nodeId},</if>
|
||||
<if test="nodeName != null">#{nodeName},</if>
|
||||
<if test="nodeType != null">#{nodeType},</if>
|
||||
<if test="temName != null">#{temName},</if>
|
||||
<if test="temUnit != null">#{temUnit},</if>
|
||||
<if test="temValue != null">#{temValue},</if>
|
||||
<if test="temValueStr != null">#{temValueStr},</if>
|
||||
<if test="temAlarmStatus != null">#{temAlarmStatus},</if>
|
||||
<if test="humName != null">#{humName},</if>
|
||||
<if test="humUnit != null">#{humUnit},</if>
|
||||
<if test="humValue != null">#{humValue},</if>
|
||||
<if test="humValueStr != null">#{humValueStr},</if>
|
||||
<if test="humAlarmStatus != null">#{humAlarmStatus},</if>
|
||||
<if test="deviceId != null">#{deviceId},</if>
|
||||
<if test="airTemp != null">#{airTemp},</if>
|
||||
<if test="airHumi != null">#{airHumi},</if>
|
||||
<if test="windSpeed != null">#{windSpeed},</if>
|
||||
<if test="windDir != null">#{windDir},</if>
|
||||
<if test="airPre != null">#{airPre},</if>
|
||||
<if test="guangzhao != null">#{guangzhao},</if>
|
||||
<if test="fushe != null">#{fushe},</if>
|
||||
<if test="sumRain != null">#{sumRain},</if>
|
||||
<if test="insRain != null">#{insRain},</if>
|
||||
<if test="dayRain != null">#{dayRain},</if>
|
||||
<if test="zhengfa != null">#{zhengfa},</if>
|
||||
<if test="soilTemp != null">#{soilTemp},</if>
|
||||
<if test="soilHumi != null">#{soilHumi},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDeviceRealtimedataMeteorology" parameterType="DeviceRealtimedataMeteorology">
|
||||
update iot_device_realtimedata_meteorology
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="nodeName != null">node_name = #{nodeName},</if>
|
||||
<if test="nodeType != null">node_type = #{nodeType},</if>
|
||||
<if test="temName != null">tem_name = #{temName},</if>
|
||||
<if test="temUnit != null">tem_unit = #{temUnit},</if>
|
||||
<if test="temValue != null">tem_value = #{temValue},</if>
|
||||
<if test="temValueStr != null">tem_value_str = #{temValueStr},</if>
|
||||
<if test="temAlarmStatus != null">tem_alarm_status = #{temAlarmStatus},</if>
|
||||
<if test="humName != null">hum_name = #{humName},</if>
|
||||
<if test="humUnit != null">hum_unit = #{humUnit},</if>
|
||||
<if test="humValue != null">hum_value = #{humValue},</if>
|
||||
<if test="humValueStr != null">hum_value_str = #{humValueStr},</if>
|
||||
<if test="humAlarmStatus != null">hum_alarm_status = #{humAlarmStatus},</if>
|
||||
<if test="deviceId != null">device_id = #{deviceId},</if>
|
||||
<if test="airTemp != null">air_temp = #{airTemp},</if>
|
||||
<if test="airHumi != null">air_humi = #{airHumi},</if>
|
||||
<if test="windSpeed != null">wind_speed = #{windSpeed},</if>
|
||||
<if test="windDir != null">wind_dir = #{windDir},</if>
|
||||
<if test="airPre != null">air_pre = #{airPre},</if>
|
||||
<if test="guangzhao != null">guangzhao = #{guangzhao},</if>
|
||||
<if test="fushe != null">fushe = #{fushe},</if>
|
||||
<if test="sumRain != null">sum_rain = #{sumRain},</if>
|
||||
<if test="insRain != null">ins_rain = #{insRain},</if>
|
||||
<if test="dayRain != null">day_rain = #{dayRain},</if>
|
||||
<if test="zhengfa != null">zhengfa = #{zhengfa},</if>
|
||||
<if test="soilTemp != null">soil_temp = #{soilTemp},</if>
|
||||
<if test="soilHumi != null">soil_humi = #{soilHumi},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
</trim>
|
||||
where node_id = #{nodeId}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDeviceRealtimedataMeteorologyByNodeId" parameterType="Long">
|
||||
delete from iot_device_realtimedata_meteorology where node_id = #{nodeId}
|
||||
<delete id="deleteDeviceRealtimedataMeteorologyById" parameterType="Long">
|
||||
delete from iot_device_realtimedata_meteorology where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDeviceRealtimedataMeteorologyByNodeIds" parameterType="String">
|
||||
delete from iot_device_realtimedata_meteorology where node_id in
|
||||
<foreach item="nodeId" collection="array" open="(" separator="," close=")">
|
||||
#{nodeId}
|
||||
<delete id="deleteDeviceRealtimedataMeteorologyByIds" parameterType="String">
|
||||
delete from iot_device_realtimedata_meteorology where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -1,17 +1,12 @@
|
||||
package com.fastbee.iot.timer;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.fastbee.deviceData.api.renke.constant.RenKeDeviceTypeConstant;
|
||||
import com.fastbee.deviceData.api.renke.service.RenKeAuthorizationService;
|
||||
import com.fastbee.deviceData.domain.DeviceRealtimedataMeteorology;
|
||||
import com.fastbee.deviceData.domain.DeviceRealtimedataWorms;
|
||||
import com.fastbee.deviceData.service.impl.DeviceRealtimeDataMeteorologyServiceImpl;
|
||||
import com.fastbee.deviceData.service.impl.DeviceRealtimeDataWormsServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -19,11 +14,6 @@ import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @author mijiupro
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user