边带预警信息修改、添加天气预警抓取
This commit is contained in:
parent
3029e5d868
commit
b2900fbe11
|
|
@ -11,6 +11,7 @@ import io.swagger.annotations.ApiOperation;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
|
@ -106,6 +107,7 @@ public class TbProDepartController extends BaseController {
|
|||
* @return 删除是否成功
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
|
||||
public AjaxResult deleteById(@PathVariable("id") Long id) {
|
||||
return tbProDepartService.deleteById(id);
|
||||
}
|
||||
|
|
@ -115,7 +117,8 @@ public class TbProDepartController extends BaseController {
|
|||
*/
|
||||
@ApiOperation("项目部管理导出")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TbProDepart tbProDepart) {
|
||||
public void export(HttpServletResponse response, HttpServletRequest request,TbProDepart tbProDepart) {
|
||||
String de= request.getParameter("departName");
|
||||
List<TbProDepart> list = tbProDepartService.queryByPage(tbProDepart);
|
||||
ExcelUtil<TbProDepart> util = new ExcelUtil<>(TbProDepart.class);
|
||||
util.exportExcel(response, list, "项目部管理数据");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
package com.bonus.data.config;
|
||||
|
||||
import com.bonus.data.service.WatherWarnService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
/**
|
||||
* 系统定时任务处理器
|
||||
* @author 黑子
|
||||
*/
|
||||
@Slf4j
|
||||
@EnableScheduling
|
||||
@Configuration
|
||||
public class SystemScheduleConfig {
|
||||
|
||||
@Autowired
|
||||
WatherWarnService service;
|
||||
|
||||
/**
|
||||
* 自动获取预警数据
|
||||
*/
|
||||
@Scheduled(cron = "0 0/30 * * * ?")
|
||||
@PostConstruct
|
||||
private void updateWeather(){
|
||||
service.getCityWather();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 自动更新边带状态
|
||||
*/
|
||||
@Scheduled(cron = "0 0/10 * * * ?")
|
||||
private void updateBdStatus(){
|
||||
service.updateBdStatus();
|
||||
}
|
||||
}
|
||||
|
|
@ -14,4 +14,9 @@ public class DeviceVo {
|
|||
private String devName;
|
||||
|
||||
private String devType;
|
||||
|
||||
private String proName;
|
||||
|
||||
private String proCode;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
package com.bonus.data.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 系统设备告警表
|
||||
* @author 黑子
|
||||
*/
|
||||
@Data
|
||||
public class WarnVo {
|
||||
|
||||
private String id;
|
||||
|
||||
private String warnTime;
|
||||
|
||||
private String warnContent;
|
||||
|
||||
private String warnType;
|
||||
|
||||
private String devId;
|
||||
|
||||
private String proId;
|
||||
|
||||
private String proCode;
|
||||
|
||||
private String remarks;
|
||||
|
||||
public WarnVo(String warnTime, String warnContent, String warnType, String devId, String proCode, String remarks) {
|
||||
this.warnTime = warnTime;
|
||||
this.warnContent = warnContent;
|
||||
this.warnType = warnType;
|
||||
this.devId = devId;
|
||||
this.proCode = proCode;
|
||||
this.remarks = remarks;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.bonus.data.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 天气预警实体类
|
||||
* @author 黑子
|
||||
*/
|
||||
@Data
|
||||
public class WatherVo {
|
||||
|
||||
private String city;
|
||||
|
||||
private String createTime;
|
||||
|
||||
|
||||
private String content;
|
||||
|
||||
|
||||
private String type;
|
||||
|
||||
|
||||
private String level;
|
||||
|
||||
|
||||
private String province;
|
||||
|
||||
private String day;
|
||||
|
||||
public WatherVo(String city, String createTime, String content, String type, String level, String province, String day) {
|
||||
this.city = city;
|
||||
this.createTime = createTime;
|
||||
this.content = content;
|
||||
this.type = type;
|
||||
this.level = level;
|
||||
this.province = province;
|
||||
this.day = day;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +1,6 @@
|
|||
package com.bonus.data.mapper;
|
||||
|
||||
import com.bonus.data.entity.DevAttributeVo;
|
||||
import com.bonus.data.entity.DevInfoVo;
|
||||
import com.bonus.data.entity.DeviceVo;
|
||||
import com.bonus.data.entity.WarnConfigVo;
|
||||
import com.bonus.data.entity.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
|
@ -97,4 +94,16 @@ public interface DataCenterMapper {
|
|||
* @return
|
||||
*/
|
||||
Integer getDevTypeId(DevInfoVo vo);
|
||||
|
||||
/**
|
||||
* 新增告警数据
|
||||
* @param vo
|
||||
*/
|
||||
void insertWarn(WarnVo vo);
|
||||
|
||||
/**
|
||||
* 更新边带状态
|
||||
* @param bdId
|
||||
*/
|
||||
void updateBdStatus(@Param("bdId") String bdId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
package com.bonus.data.mapper;
|
||||
|
||||
import com.bonus.data.entity.WatherVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 天气接口处理
|
||||
* @author 黑子
|
||||
*/
|
||||
@Repository
|
||||
public interface WatherMapper {
|
||||
|
||||
/**
|
||||
* 删除当天数据
|
||||
* @param day
|
||||
*/
|
||||
void delWatherWrn(@Param("day") String day);
|
||||
|
||||
/**
|
||||
*更新数据
|
||||
* @param date
|
||||
*/
|
||||
void replaceWather(WatherVo date);
|
||||
|
||||
/**
|
||||
* 更新边带状态
|
||||
*/
|
||||
void updateBdStatus();
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@ package com.bonus.data.service;
|
|||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.alibaba.nacos.common.utils.UuidUtils;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.data.entity.*;
|
||||
|
|
@ -43,6 +44,7 @@ public class DataCenterServiceImpl implements DataCenterService{
|
|||
String bdId = mapper.getDevBdData(edgeId.toString());
|
||||
if(StringUtils.isNotEmpty(bdId)){
|
||||
if (StringUtils.isNotEmpty(list)) {
|
||||
mapper.updateBdStatus(bdId);
|
||||
list.forEach(vo->{
|
||||
vo.setBdId(bdId);
|
||||
vo.setRelType(vo.getDeviceType());
|
||||
|
|
@ -102,8 +104,9 @@ public class DataCenterServiceImpl implements DataCenterService{
|
|||
if (StringUtils.isNotEmpty(list)) {
|
||||
list.forEach(vo->{
|
||||
//先找到系统设备id
|
||||
DeviceVo deviceVo=mapper.getDevInfoId( vo.getDeviceId(),bdId);
|
||||
DeviceVo deviceVo=mapper.getDevInfoId(vo.getDeviceId(),bdId);
|
||||
if(ObjectUtils.isNotEmpty(deviceVo) && StringUtils.isNotEmpty(deviceVo.getDevId())){
|
||||
mapper.updateBdStatus(bdId);
|
||||
String json="";
|
||||
try {
|
||||
json = objectMapper.writeValueAsString(vo);
|
||||
|
|
@ -117,11 +120,11 @@ public class DataCenterServiceImpl implements DataCenterService{
|
|||
attributeVos.clear();
|
||||
DevAttributeVo devAttributeVo=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"电池电量",vo.getCapacity(),"%","capacity","0",vo.getDataTime(),mergerId);
|
||||
attributeVos.add(devAttributeVo);
|
||||
DevAttributeVo devAttributeVo2=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"角度X",vo.getAngleX(),"°","angle_x",isWarn(config,vo.getAngleX(),1),vo.getDataTime(),mergerId);
|
||||
DevAttributeVo devAttributeVo2=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"角度X",vo.getAngleX(),"°","angle_x",isWarn(config,vo.getAngleX(),1,deviceVo,"角度X"),vo.getDataTime(),mergerId);
|
||||
attributeVos.add(devAttributeVo2);
|
||||
DevAttributeVo devAttributeVo3=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"角度Y",vo.getAngleY(),"°","angle_y",isWarn(config,vo.getAngleY(),1),vo.getDataTime(),mergerId);
|
||||
DevAttributeVo devAttributeVo3=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"角度Y",vo.getAngleY(),"°","angle_y",isWarn(config,vo.getAngleY(),1,deviceVo,"角度Y"),vo.getDataTime(),mergerId);
|
||||
attributeVos.add(devAttributeVo3);
|
||||
DevAttributeVo devAttributeVo4=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"角度Z",vo.getAngleZ(),"°","angle_z",isWarn(config,vo.getAngleZ(),1),vo.getDataTime(),mergerId);
|
||||
DevAttributeVo devAttributeVo4=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"角度Z",vo.getAngleZ(),"°","angle_z",isWarn(config,vo.getAngleZ(),1,deviceVo,"角度Z"),vo.getDataTime(),mergerId);
|
||||
attributeVos.add(devAttributeVo4);
|
||||
//更新/新增设备检测信息及记录
|
||||
insertOrAddDevAttribute(attributeVos);
|
||||
|
|
@ -160,6 +163,7 @@ public class DataCenterServiceImpl implements DataCenterService{
|
|||
for (CjDataVo vo : list) {//先找到系统设备id
|
||||
DeviceVo deviceVo = mapper.getDevInfoId(vo.getDeviceId(), bdId);
|
||||
if (ObjectUtils.isNotEmpty(deviceVo) && StringUtils.isNotEmpty(deviceVo.getDevId())) {
|
||||
mapper.updateBdStatus(bdId);
|
||||
String json = "";
|
||||
try {
|
||||
json = objectMapper.writeValueAsString(vo);
|
||||
|
|
@ -223,6 +227,7 @@ public class DataCenterServiceImpl implements DataCenterService{
|
|||
//先找到系统设备id
|
||||
DeviceVo deviceVo = mapper.getDevInfoId(vo.getDeviceId(),bdId);
|
||||
if(ObjectUtils.isNotEmpty(deviceVo) && StringUtils.isNotEmpty(deviceVo.getDevId())){
|
||||
mapper.updateBdStatus(bdId);
|
||||
String json;
|
||||
try {
|
||||
json = objectMapper.writeValueAsString(vo);
|
||||
|
|
@ -231,12 +236,12 @@ public class DataCenterServiceImpl implements DataCenterService{
|
|||
}
|
||||
String devId = deviceVo.getDevId();
|
||||
log.info("设备注册系统id---->{}",devId);
|
||||
WarnConfigVo config = mapper.getDevWarnConfig(devId);
|
||||
// WarnConfigVo config = mapper.getDevWarnConfig(devId);
|
||||
String mergerId= UuidUtils.generateUuid().toUpperCase().replaceAll("-","");
|
||||
safetyHatVos.clear();
|
||||
DevAttributeVo devAttributeVo = new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"经度",vo.getLon(),"%度","hat_lon","0",vo.getDataTime(),mergerId);
|
||||
DevAttributeVo devAttributeVo = new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"经度",vo.getLon(),"","hat_lon","0",vo.getDataTime(),mergerId);
|
||||
safetyHatVos.add(devAttributeVo);
|
||||
DevAttributeVo devAttributeVo2 = new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"纬度",vo.getLat(),"/度","hat_lat","0",vo.getDataTime(),mergerId);
|
||||
DevAttributeVo devAttributeVo2 = new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"纬度",vo.getLat(),"","hat_lat","0",vo.getDataTime(),mergerId);
|
||||
safetyHatVos.add(devAttributeVo2);
|
||||
//更新/新增设备检测信息及记录
|
||||
insertOrAddDevAttribute(safetyHatVos);
|
||||
|
|
@ -262,7 +267,6 @@ public class DataCenterServiceImpl implements DataCenterService{
|
|||
List<SwhjDataVo> list = jsonObject.getList("list",SwhjDataVo.class);
|
||||
ObjectMapper objectMapper=new ObjectMapper();
|
||||
List<DevAttributeVo> attributeVos=new ArrayList<>();
|
||||
|
||||
Object edgeId=jsonObject.get("edgeId");
|
||||
String bdId;
|
||||
if(ObjectUtils.isNotEmpty(edgeId)){
|
||||
|
|
@ -276,6 +280,7 @@ public class DataCenterServiceImpl implements DataCenterService{
|
|||
//先找到系统设备id
|
||||
DeviceVo deviceVo=mapper.getDevInfoId(vo.getDeviceId(),bdId);
|
||||
if(ObjectUtils.isNotEmpty(deviceVo) && StringUtils.isNotEmpty(deviceVo.getDevId())){
|
||||
mapper.updateBdStatus(bdId);
|
||||
String json="";
|
||||
try {
|
||||
json = objectMapper.writeValueAsString(vo);
|
||||
|
|
@ -293,19 +298,19 @@ public class DataCenterServiceImpl implements DataCenterService{
|
|||
attributeVos.add(devAttributeVo2);
|
||||
DevAttributeVo devAttributeVo3=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"5.0µm粒子数",vo.getGrain50(),"m³","grain_50","0",vo.getDataTime(),mergerId);
|
||||
attributeVos.add(devAttributeVo3);
|
||||
DevAttributeVo devAttributeVo4=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"pm25",vo.getPm25(),"μg/m3","pm25","0",vo.getDataTime(),mergerId);
|
||||
DevAttributeVo devAttributeVo4=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"pm2.5",vo.getPm25(),"μg/m3","pm25",isWarn(config,vo.getPm25(),2,deviceVo,"pm2.5"),vo.getDataTime(),mergerId);
|
||||
attributeVos.add(devAttributeVo4);
|
||||
DevAttributeVo devAttributeVo5=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"pm10",vo.getPm10(),"μg/m3","pm10","0",vo.getDataTime(),mergerId);
|
||||
DevAttributeVo devAttributeVo5=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"pm10",vo.getPm10(),"μg/m3","pm10",isWarn(config,vo.getPm10(),3,deviceVo,"pm10"),vo.getDataTime(),mergerId);
|
||||
attributeVos.add(devAttributeVo5);
|
||||
DevAttributeVo devAttributeVo6=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"噪声",vo.getNoise(),"db","noise","0",vo.getDataTime(),mergerId);
|
||||
DevAttributeVo devAttributeVo6=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"噪声",vo.getNoise(),"db","noise",isWarn(config,vo.getNoise(),4,deviceVo,"噪声"),vo.getDataTime(),mergerId);
|
||||
attributeVos.add(devAttributeVo6);
|
||||
DevAttributeVo devAttributeVo7=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"风向",vo.getWindDirection(),"","wind_direction","0",vo.getDataTime(),mergerId);
|
||||
attributeVos.add(devAttributeVo7);
|
||||
DevAttributeVo devAttributeVo8=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"风速",vo.getWindForce(),"m/s","wind_force","0",vo.getDataTime(),mergerId);
|
||||
attributeVos.add(devAttributeVo8);
|
||||
DevAttributeVo devAttributeVo9=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"温度",vo.getAirTemperature(),"°C","air_Temperature","0",vo.getDataTime(),mergerId);
|
||||
DevAttributeVo devAttributeVo9=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"温度",vo.getAirTemperature(),"°C","air_Temperature",isWarn(config,vo.getAirTemperature(),5,deviceVo,"温度"),vo.getDataTime(),mergerId);
|
||||
attributeVos.add(devAttributeVo9);
|
||||
DevAttributeVo devAttributeVo10=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"湿度",vo.getHumidity(),"%rh","humidity","0",vo.getDataTime(),mergerId);
|
||||
DevAttributeVo devAttributeVo10=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"湿度",vo.getHumidity(),"%rh","humidity",isWarn(config,vo.getHumidity(),6,deviceVo,"湿度"),vo.getDataTime(),mergerId);
|
||||
attributeVos.add(devAttributeVo10);
|
||||
DevAttributeVo devAttributeVo11=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"微正压",vo.getPositivePressure(),"Pa","positive_pressure","0",vo.getDataTime(),mergerId);
|
||||
attributeVos.add(devAttributeVo11);
|
||||
|
|
@ -348,6 +353,7 @@ public class DataCenterServiceImpl implements DataCenterService{
|
|||
//先找到系统设备id
|
||||
DeviceVo deviceVo=mapper.getDevInfoId(vo.getDeviceId(),bdId);
|
||||
if(ObjectUtils.isNotEmpty(deviceVo) && StringUtils.isNotEmpty(deviceVo.getDevId())){
|
||||
mapper.updateBdStatus(bdId);
|
||||
String json="";
|
||||
try {
|
||||
json = objectMapper.writeValueAsString(vo);
|
||||
|
|
@ -359,13 +365,13 @@ public class DataCenterServiceImpl implements DataCenterService{
|
|||
WarnConfigVo config=mapper.getDevWarnConfig(devId);
|
||||
String mergerId= UuidUtils.generateUuid().toUpperCase().replaceAll("-","");
|
||||
attributeVos.clear();
|
||||
DevAttributeVo devAttributeVo=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"含氧量",vo.getOxygen(),"%VOL","oxygen","0",vo.getDataTime(),mergerId);
|
||||
DevAttributeVo devAttributeVo=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"含氧量",vo.getOxygen(),"%VOL","oxygen",isWarn(config,vo.getOxygen(),7,deviceVo,"含氧量"),vo.getDataTime(),mergerId);
|
||||
attributeVos.add(devAttributeVo);
|
||||
DevAttributeVo devAttributeVo2=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"一氧化碳",vo.getCarbonMonoxide(),"ppm","carbon_monoxide","0",vo.getDataTime(),mergerId);
|
||||
DevAttributeVo devAttributeVo2=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"一氧化碳",vo.getCarbonMonoxide(),"ppm","carbon_monoxide",isWarn(config,vo.getCarbonMonoxide(),8,deviceVo,"一氧化碳"),vo.getDataTime(),mergerId);
|
||||
attributeVos.add(devAttributeVo2);
|
||||
DevAttributeVo devAttributeVo3=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"可燃气体",vo.getCombustible(),"%LEL","combustible","0",vo.getDataTime(),mergerId);
|
||||
DevAttributeVo devAttributeVo3=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"可燃气体",vo.getCombustible(),"%LEL","combustible",isWarn(config,vo.getCombustible(),9,deviceVo,"可燃气体"),vo.getDataTime(),mergerId);
|
||||
attributeVos.add(devAttributeVo3);
|
||||
DevAttributeVo devAttributeVo4=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"硫化氢",vo.getHydrothion(),"ppm","hydrothion","0",vo.getDataTime(),mergerId);
|
||||
DevAttributeVo devAttributeVo4=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"硫化氢",vo.getHydrothion(),"ppm","hydrothion",isWarn(config,vo.getHydrothion(),10,deviceVo,"硫化氢"),vo.getDataTime(),mergerId);
|
||||
attributeVos.add(devAttributeVo4);
|
||||
//更新/新增设备检测信息及记录
|
||||
insertOrAddDevAttribute(attributeVos);
|
||||
|
|
@ -404,6 +410,7 @@ public class DataCenterServiceImpl implements DataCenterService{
|
|||
//先找到系统设备id
|
||||
DeviceVo deviceVo=mapper.getDevInfoId(vo.getDeviceId(),bdId);
|
||||
if(ObjectUtils.isNotEmpty(deviceVo) && StringUtils.isNotEmpty(deviceVo.getDevId())){
|
||||
mapper.updateBdStatus(bdId);
|
||||
String json="";
|
||||
try {
|
||||
json = objectMapper.writeValueAsString(vo);
|
||||
|
|
@ -417,7 +424,7 @@ public class DataCenterServiceImpl implements DataCenterService{
|
|||
attributeVos.clear();
|
||||
DevAttributeVo devAttributeVo=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"电量",vo.getCapacity(),"%VOL","capacity","0",vo.getDataTime(),mergerId);
|
||||
attributeVos.add(devAttributeVo);
|
||||
DevAttributeVo devAttributeVo2=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"拉力",vo.getTractionData(),"/KN","traction_data","0",vo.getDataTime(),mergerId);
|
||||
DevAttributeVo devAttributeVo2=new DevAttributeVo(devId,json,deviceVo.getDevName(),deviceVo.getDevType(),"拉力",vo.getTractionData(),"/KN","traction_data",isWarn(config,vo.getTractionData(),11,deviceVo,"拉力"),vo.getDataTime(),mergerId);
|
||||
attributeVos.add(devAttributeVo2);
|
||||
//更新/新增设备检测信息及记录
|
||||
insertOrAddDevAttribute(attributeVos);
|
||||
|
|
@ -455,6 +462,7 @@ public class DataCenterServiceImpl implements DataCenterService{
|
|||
//先找到系统设备id
|
||||
DeviceVo deviceVo=mapper.getDevInfoId(vo.getDeviceId(),bdId);
|
||||
if(ObjectUtils.isNotEmpty(deviceVo) && StringUtils.isNotEmpty(deviceVo.getDevId())){
|
||||
mapper.updateBdStatus(bdId);
|
||||
String json="";
|
||||
try {
|
||||
json = objectMapper.writeValueAsString(vo);
|
||||
|
|
@ -538,41 +546,129 @@ public class DataCenterServiceImpl implements DataCenterService{
|
|||
* 判断是否告警
|
||||
* @return
|
||||
*/
|
||||
public String isWarn(WarnConfigVo config,String val,int type ){
|
||||
public String isWarn(WarnConfigVo config,String val,int type ,DeviceVo deviceVo,String warn){
|
||||
try{
|
||||
if(ObjectUtils.isNotEmpty(config) && type==1 && ObjectUtils.isNotEmpty(val)){
|
||||
BigDecimal max=config.getConfigVal1Max();
|
||||
BigDecimal min=config.getConfigVal1Min();
|
||||
BigDecimal value=new BigDecimal(val);
|
||||
if(max.compareTo(value)<0 || min.compareTo(value)>0 ){
|
||||
//设备告警
|
||||
if(max.compareTo(value)<0){
|
||||
insertWarn(deviceVo.getDevId(),deviceVo.getProCode(),"倾角异常",warn+"超出阈值",DateUtils.getTime());
|
||||
return "1";
|
||||
}
|
||||
if(min.compareTo(value)>0 ){
|
||||
insertWarn(deviceVo.getDevId(),deviceVo.getProCode(),"倾角异常",warn+"低于阈值",DateUtils.getTime());
|
||||
return "1";
|
||||
}
|
||||
}else if(ObjectUtils.isNotEmpty(config) && type==2 && ObjectUtils.isNotEmpty(val)){
|
||||
BigDecimal max=config.getConfigVal1Max();
|
||||
BigDecimal min=config.getConfigVal1Min();
|
||||
BigDecimal max=config.getConfigVal4Max();
|
||||
BigDecimal min=config.getConfigVal4Min();
|
||||
BigDecimal value=new BigDecimal(val);
|
||||
if(max.compareTo(value)<0 || min.compareTo(value)>0 ){
|
||||
if(max.compareTo(value)<0){
|
||||
insertWarn(deviceVo.getDevId(),deviceVo.getProCode(),"PM2.5异常",warn+"超出阈值",DateUtils.getTime());
|
||||
return "1";
|
||||
}else if(min.compareTo(value)>0 ){
|
||||
insertWarn(deviceVo.getDevId(),deviceVo.getProCode(),"PM2.5异常",warn+"低于阈值",DateUtils.getTime());
|
||||
return "1";
|
||||
}
|
||||
}else if(ObjectUtils.isNotEmpty(config) && type==3 && ObjectUtils.isNotEmpty(val)){
|
||||
BigDecimal max=config.getConfigVal1Max();
|
||||
BigDecimal min=config.getConfigVal1Min();
|
||||
BigDecimal max=config.getConfigVal5Max();
|
||||
BigDecimal min=config.getConfigVal5Min();
|
||||
BigDecimal value=new BigDecimal(val);
|
||||
if(max.compareTo(value)<0 || min.compareTo(value)>0 ){
|
||||
if(max.compareTo(value)<0){
|
||||
insertWarn(deviceVo.getDevId(),deviceVo.getProCode(),"PM10异常",warn+"超出阈值",DateUtils.getTime());
|
||||
return "1";
|
||||
}else if(min.compareTo(value)>0 ){
|
||||
insertWarn(deviceVo.getDevId(),deviceVo.getProCode(),"PM10异常",warn+"低于阈值",DateUtils.getTime());
|
||||
return "1";
|
||||
}
|
||||
}else if(ObjectUtils.isNotEmpty(config) && type==4 && ObjectUtils.isNotEmpty(val)){
|
||||
BigDecimal max=config.getConfigVal1Max();
|
||||
BigDecimal min=config.getConfigVal1Min();
|
||||
BigDecimal max=config.getConfigVal3Max();
|
||||
BigDecimal min=config.getConfigVal3Min();
|
||||
BigDecimal value=new BigDecimal(val);
|
||||
if(max.compareTo(value)<0 || min.compareTo(value)>0 ){
|
||||
if(max.compareTo(value)<0){
|
||||
insertWarn(deviceVo.getDevId(),deviceVo.getProCode(),"噪声异常",warn+"超出阈值",DateUtils.getTime());
|
||||
return "1";
|
||||
}else if(min.compareTo(value)>0 ){
|
||||
insertWarn(deviceVo.getDevId(),deviceVo.getProCode(),"噪声异常",warn+"低于阈值",DateUtils.getTime());
|
||||
return "1";
|
||||
}
|
||||
}else if(ObjectUtils.isNotEmpty(config) && type==5 && ObjectUtils.isNotEmpty(val)){
|
||||
BigDecimal max=config.getConfigVal1Max();
|
||||
BigDecimal min=config.getConfigVal1Min();
|
||||
BigDecimal value=new BigDecimal(val);
|
||||
if(max.compareTo(value)<0 || min.compareTo(value)>0 ){
|
||||
if(max.compareTo(value)<0){
|
||||
insertWarn(deviceVo.getDevId(),deviceVo.getProCode(),"温度异常",warn+"超出阈值",DateUtils.getTime());
|
||||
return "1";
|
||||
}else if(min.compareTo(value)>0 ){
|
||||
insertWarn(deviceVo.getDevId(),deviceVo.getProCode(),"温度异常",warn+"低于阈值",DateUtils.getTime());
|
||||
return "1";
|
||||
}
|
||||
}else if(ObjectUtils.isNotEmpty(config) && type==6 && ObjectUtils.isNotEmpty(val)){
|
||||
BigDecimal max=config.getConfigVal2Max();
|
||||
BigDecimal min=config.getConfigVal2Min();
|
||||
BigDecimal value=new BigDecimal(val);
|
||||
if(max.compareTo(value)<0){
|
||||
insertWarn(deviceVo.getDevId(),deviceVo.getProCode(),"湿度异常",warn+"超出阈值",DateUtils.getTime());
|
||||
return "1";
|
||||
}else if(min.compareTo(value)>0 ){
|
||||
insertWarn(deviceVo.getDevId(),deviceVo.getProCode(),"湿度异常",warn+"低于阈值",DateUtils.getTime());
|
||||
return "1";
|
||||
}
|
||||
}else if(ObjectUtils.isNotEmpty(config) && type==7 && ObjectUtils.isNotEmpty(val)){
|
||||
BigDecimal max=config.getConfigVal1Max();
|
||||
BigDecimal min=config.getConfigVal1Min();
|
||||
BigDecimal value=new BigDecimal(val);
|
||||
if(max.compareTo(value)<0){
|
||||
insertWarn(deviceVo.getDevId(),deviceVo.getProCode(),"含氧量异常",warn+"超出阈值",DateUtils.getTime());
|
||||
return "1";
|
||||
}else if(min.compareTo(value)>0 ){
|
||||
insertWarn(deviceVo.getDevId(),deviceVo.getProCode(),"含氧量异常",warn+"低于阈值",DateUtils.getTime());
|
||||
return "1";
|
||||
}
|
||||
}else if(ObjectUtils.isNotEmpty(config) && type==8 && ObjectUtils.isNotEmpty(val)){
|
||||
BigDecimal max=config.getConfigVal2Max();
|
||||
BigDecimal min=config.getConfigVal2Min();
|
||||
BigDecimal value=new BigDecimal(val);
|
||||
if(max.compareTo(value)<0){
|
||||
insertWarn(deviceVo.getDevId(),deviceVo.getProCode(),"一氧化碳异常",warn+"超出阈值",DateUtils.getTime());
|
||||
return "1";
|
||||
}else if(min.compareTo(value)>0 ){
|
||||
insertWarn(deviceVo.getDevId(),deviceVo.getProCode(),"一氧化碳异常",warn+"低于阈值",DateUtils.getTime());
|
||||
return "1";
|
||||
}
|
||||
}else if(ObjectUtils.isNotEmpty(config) && type==9 && ObjectUtils.isNotEmpty(val)){
|
||||
BigDecimal max=config.getConfigVal3Max();
|
||||
BigDecimal min=config.getConfigVal3Min();
|
||||
BigDecimal value=new BigDecimal(val);
|
||||
if(max.compareTo(value)<0){
|
||||
insertWarn(deviceVo.getDevId(),deviceVo.getProCode(),"可燃气体异常",warn+"超出阈值",DateUtils.getTime());
|
||||
return "1";
|
||||
}else if(min.compareTo(value)>0 ){
|
||||
insertWarn(deviceVo.getDevId(),deviceVo.getProCode(),"可燃气体异常",warn+"低于阈值",DateUtils.getTime());
|
||||
return "1";
|
||||
}
|
||||
}else if(ObjectUtils.isNotEmpty(config) && type==10 && ObjectUtils.isNotEmpty(val)){
|
||||
BigDecimal max=config.getConfigVal4Max();
|
||||
BigDecimal min=config.getConfigVal4Min();
|
||||
BigDecimal value=new BigDecimal(val);
|
||||
if(max.compareTo(value)<0){
|
||||
insertWarn(deviceVo.getDevId(),deviceVo.getProCode(),"硫化氢异常",warn+"超出阈值",DateUtils.getTime());
|
||||
return "1";
|
||||
}else if(min.compareTo(value)>0 ){
|
||||
insertWarn(deviceVo.getDevId(),deviceVo.getProCode(),"硫化氢异常",warn+"低于阈值",DateUtils.getTime());
|
||||
return "1";
|
||||
}
|
||||
}else if(ObjectUtils.isNotEmpty(config) && type==11 && ObjectUtils.isNotEmpty(val)){
|
||||
BigDecimal max=config.getConfigVal4Max();
|
||||
BigDecimal min=config.getConfigVal4Min();
|
||||
BigDecimal value=new BigDecimal(val);
|
||||
if(max.compareTo(value)<0){
|
||||
insertWarn(deviceVo.getDevId(),deviceVo.getProCode(),"拉力异常",warn+"超出阈值",DateUtils.getTime());
|
||||
return "1";
|
||||
}else if(min.compareTo(value)>0 ){
|
||||
insertWarn(deviceVo.getDevId(),deviceVo.getProCode(),"拉力异常",warn+"低于阈值",DateUtils.getTime());
|
||||
return "1";
|
||||
}
|
||||
}
|
||||
|
|
@ -583,4 +679,20 @@ public class DataCenterServiceImpl implements DataCenterService{
|
|||
return "0";
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备告警数据插入
|
||||
* @param devId
|
||||
* @param
|
||||
* @param warnType
|
||||
* @param warnContent
|
||||
* @param warnTime
|
||||
*/
|
||||
public void insertWarn(String devId,String proCode,String warnType,String warnContent,String warnTime){
|
||||
try{
|
||||
WarnVo vo=new WarnVo(warnTime,warnContent,warnType,devId,proCode,"");
|
||||
mapper.insertWarn(vo);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,195 @@
|
|||
package com.bonus.data.service;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.data.entity.WatherVo;
|
||||
import com.bonus.data.mapper.WatherMapper;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 天气预警抓取
|
||||
*/
|
||||
@Service
|
||||
public class WatherWarnService {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(WatherWarnService.class);
|
||||
/**
|
||||
* 搜索城市
|
||||
*/
|
||||
// static String CITY = "合肥市@阜阳市@安庆市@滁州市@六安市@宿州市@宣城市@芜湖市@池州市@淮南市@黄山市@蚌埠市@亳州市@淮北市@铜陵市@马鞍山市";
|
||||
|
||||
static String CITY ="";
|
||||
/**
|
||||
* 所有城市灾害预警列表
|
||||
*/
|
||||
final static String ALL_CITY_URL = "http://product.weather.com.cn/alarm/grepalarm_cn.php";
|
||||
|
||||
/**
|
||||
* 搜索城市灾害预警数据页面
|
||||
*/
|
||||
final static String VALUE_URL = "http://product.weather.com.cn/alarm/webdata/";
|
||||
/**
|
||||
* 时间戳
|
||||
*/
|
||||
static long TIME_STAMP = System.currentTimeMillis();
|
||||
|
||||
@Autowired
|
||||
private WatherMapper mapper;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 数据信息接口
|
||||
* @param
|
||||
*/
|
||||
public void getCityWather(){
|
||||
try{
|
||||
String url = ALL_CITY_URL + "?_=" + TIME_STAMP;
|
||||
String allWarningCity = getWarnCityList(url);
|
||||
if (allWarningCity == null) {
|
||||
return;
|
||||
}
|
||||
List<List<String>> data = getCityLists(allWarningCity);
|
||||
List<String> citys=Arrays.asList(CITY.split("@"));
|
||||
for (String city:citys) {
|
||||
String realUrl = getSearchCityUrl(data,city);
|
||||
if (realUrl == null || "".equals(realUrl)) {
|
||||
mapper.delWatherWrn(DateUtils.getDate());
|
||||
} else {
|
||||
String wholeUrl = VALUE_URL + realUrl + "?_=" + TIME_STAMP;
|
||||
Map<String, String> map = dealNewUrl(wholeUrl);
|
||||
System.out.println("预警内容: "+map.get("ISSUECONTENT")+"类型:"+map.get("SIGNALTYPE")+"等级:"+map.get("SIGNALLEVEL"));
|
||||
String time=map.get("ISSUETIME");//时间
|
||||
String content=map.get("ISSUECONTENT").split("(预警信息来源")[0];
|
||||
String type=map.get("SIGNALTYPE")+"预警";
|
||||
String level=map.get("SIGNALLEVEL");
|
||||
String prov=map.get("PROVINCE");
|
||||
WatherVo vo=new WatherVo(prov,time,content,type,level,prov,DateUtils.getDate());
|
||||
mapper.replaceWather(vo);
|
||||
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 处理所有城市灾害列表页面
|
||||
*
|
||||
* @param url
|
||||
* @return
|
||||
*/
|
||||
public static String getWarnCityList(String url) {
|
||||
String allWeatherInfo = null;
|
||||
CloseableHttpClient client;
|
||||
client = HttpClientBuilder.create().build();
|
||||
|
||||
HttpGet get = new HttpGet(url);
|
||||
RequestConfig config = RequestConfig.custom()
|
||||
.setConnectTimeout(10*1000) //连接超时时间
|
||||
.setConnectionRequestTimeout(6000) //从连接池中取的连接的最长时间
|
||||
.setSocketTimeout(2*60*1000) //数据传输的超时时间
|
||||
.build();
|
||||
get.setConfig(config);
|
||||
HttpResponse response;
|
||||
try {
|
||||
response = client.execute(get);
|
||||
if (response != null) {
|
||||
HttpEntity entity = response.getEntity();
|
||||
allWeatherInfo = EntityUtils.toString(entity, "UTF-8");
|
||||
} else {
|
||||
System.out.println("全国所有城市都没有预警或者中国预警网错误");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return allWeatherInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得城市列表
|
||||
* @param allWeatherInfo
|
||||
* @return
|
||||
*/
|
||||
private static List<List<String>> getCityLists(String allWeatherInfo) {
|
||||
String[] split = allWeatherInfo.split("=");
|
||||
String value = split[1];
|
||||
String substring = value.substring(0, value.length() - 1);
|
||||
Map<String, List<List<String>>> jsonMap = JSON.parseObject(substring, Map.class);
|
||||
return jsonMap.get("data");
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到搜索城市的url
|
||||
*
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
public static String getSearchCityUrl(List<List<String>> data, String city) {
|
||||
String realUrl = "";
|
||||
List<List<String>> sortedList = data.stream()
|
||||
.filter(strings -> strings.get(0).contains(city))
|
||||
.sorted(Comparator.comparing(s -> s.get(0).length()))
|
||||
.limit(1)
|
||||
.collect(Collectors.toList());
|
||||
if (sortedList.isEmpty()) {
|
||||
return realUrl;
|
||||
}
|
||||
realUrl = sortedList.get(0).get(1);
|
||||
return realUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 访问城市url
|
||||
*
|
||||
* @param url
|
||||
* @return
|
||||
*/
|
||||
public static Map<String, String> dealNewUrl(String url) {
|
||||
Map<String, String> map=new HashMap<>(16);
|
||||
CloseableHttpClient client;
|
||||
client = HttpClients.createDefault();
|
||||
HttpGet get = new HttpGet(url);
|
||||
HttpResponse response;
|
||||
try {
|
||||
response = client.execute(get);
|
||||
HttpEntity entity = response.getEntity();
|
||||
if (entity != null) {
|
||||
String string = EntityUtils.toString(entity, "UTF-8");
|
||||
// System.out.println("搜索城市数据: " + string);
|
||||
String[] split = string.split("=");
|
||||
String s = split[1];
|
||||
map = JSON.parseObject(s, Map.class);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public void updateBdStatus() {
|
||||
try{
|
||||
mapper.updateBdStatus();
|
||||
}catch (Exception e){
|
||||
log.error(e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -142,14 +142,12 @@
|
|||
device.dev_code as devCode,
|
||||
MAX(CASE WHEN tda.jc_name = '经度' THEN tda.jc_value END) AS lon,
|
||||
MAX(CASE WHEN tda.jc_name = '纬度' THEN tda.jc_value END) AS lat
|
||||
|
||||
FROM
|
||||
tb_people tp
|
||||
LEFT JOIN tb_team tt ON tt.id = tp.team_id AND tt.del_flag = 0
|
||||
LEFT JOIN tb_project project ON project.id = tt.pro_id AND project.del_flag = 0
|
||||
LEFT JOIN tb_device device ON tp.dev_id = device.id AND device.del_flag = 0
|
||||
LEFT JOIN tb_dev_attribute tda ON tda.dev_id = tp.dev_id AND tda.del_flag = 0
|
||||
|
||||
WHERE tp.del_flag = 0 AND project.id = #{proId}
|
||||
GROUP BY tp.id
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -36,6 +36,13 @@
|
|||
dev_id,dev_data,sys_time
|
||||
)VALUES (#{devId},#{devJson},now())
|
||||
</insert>
|
||||
<insert id="insertWarn">
|
||||
INSERT INTO tb_warn(
|
||||
warn_time,warn_content,
|
||||
warn_type, dev_id, state,
|
||||
pro_code, remarks
|
||||
)values (#{warnTime},#{warnContent},#{warnType},#{devId},0,#{proId},#{remarks})
|
||||
</insert>
|
||||
<!--更新设备信息-->
|
||||
<update id="updateDevInfo">
|
||||
update tb_device set
|
||||
|
|
@ -53,6 +60,12 @@
|
|||
jc_value=#{jcValue},jc_time=#{jcTime},is_warn=#{isWarn}
|
||||
where id=#{attributeId}
|
||||
</update>
|
||||
<!--更新边带状态-->
|
||||
<update id="updateBdStatus" >
|
||||
update tb_bd_device_record
|
||||
set dev_status='1',status_time=now()
|
||||
WHERE dev_code=#{bdId}
|
||||
</update>
|
||||
<!--依据级联id查询数据是否存在-->
|
||||
<select id="getDevInfoNum" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
|
|
@ -61,7 +74,7 @@
|
|||
</select>
|
||||
<!--查询接入边带设备ID-->
|
||||
<select id="getDevInfoId" resultType="com.bonus.data.entity.DeviceVo">
|
||||
select td.id devId, td.dev_name devName, td.dev_type devType
|
||||
select td.id devId, td.dev_name devName, td.dev_type devType,td.pro_name proName,td.pro_code proCode
|
||||
from tb_device td
|
||||
LEFT JOIN tb_bd_device_record bdr on td.bd_id=bdr.id
|
||||
LEFT JOIN tb_bd_record tbr on bdr.record_id=tbr.id
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.data.mapper.WatherMapper">
|
||||
<insert id="replaceWather">
|
||||
replace into t_warn_prediction(
|
||||
city, create_time, content,
|
||||
type, level, is_accecpt, state,
|
||||
is_xf, cs_val, province, day
|
||||
)values (#{city},#{createTime},#{content},#{type},#{level},0,0,0,0,#{province},#{day})
|
||||
|
||||
</insert>
|
||||
<update id="updateBdStatus">
|
||||
update tb_bd_device_record
|
||||
set dev_status='0'
|
||||
WHERE TIMESTAMPDIFF(HOUR, status_time, NOW()) >= 1 and dev_status='1'
|
||||
</update>
|
||||
<delete id="delWatherWrn">
|
||||
delete from t_warn_prediction
|
||||
where day like CONCAT('%',#{day},'%')
|
||||
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -16,13 +16,13 @@
|
|||
<select id="getDeviceWarnRecord" resultType="com.bonus.screen.vo.DeviceWarnRecordVo">
|
||||
SELECT
|
||||
tddr.id,
|
||||
tddr.dev_name AS devName,
|
||||
tddr.create_time AS warnTime,
|
||||
tddr.attribute_name AS warnType,
|
||||
tddr.attribute_val AS warnValue,
|
||||
tddr.dev_json AS warnContent,
|
||||
tp.pro_name AS proName,
|
||||
td.dev_code AS devCode
|
||||
ANY_VALUE(tddr.dev_name) AS devName,
|
||||
ANY_VALUE(tddr.create_time) AS warnTime,
|
||||
ANY_VALUE(tddr.attribute_name) AS warnType,
|
||||
ANY_VALUE(tddr.attribute_val) AS warnValue,
|
||||
ANY_VALUE( tddr.dev_json) AS warnContent,
|
||||
ANY_VALUE( tp.pro_name) AS proName,
|
||||
ANY_VALUE( td.dev_code) AS devCode
|
||||
FROM tb_dev_data_record tddr
|
||||
LEFT JOIN tb_device td ON tddr.dev_id = td.id
|
||||
LEFT JOIN tb_bd_device_record tbdr ON td.dev_code = tbdr.dev_code
|
||||
|
|
|
|||
Loading…
Reference in New Issue