提交代码
parent
a32bb3c79c
commit
72f534622c
|
@ -11,9 +11,15 @@ package com.ruoyi.iot.conf;
|
|||
public class HzApiConf {
|
||||
|
||||
/**
|
||||
* IOT配电箱数据获取HOST
|
||||
* IOT配电箱数据获取HOST&&华筑
|
||||
*/
|
||||
public static String IOT_POWER_HOST = "http://api.1357.cn/hz-condition-monitor";
|
||||
|
||||
/**
|
||||
* IOT配电箱数据获取HOST&&萨达
|
||||
*/
|
||||
public static String SD_IOT_POWER_HOST = "https://api.e.v1.i-sada.net";
|
||||
|
||||
/**
|
||||
* 标养室获取数据HOST
|
||||
*/
|
||||
|
|
|
@ -42,6 +42,10 @@ public class IotDeviceInfo extends BaseEntity
|
|||
|
||||
private String hzTenantId;
|
||||
private String hzProjectId;
|
||||
private String factoryName;
|
||||
private String companyName;
|
||||
private String projectName;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
|
@ -121,6 +125,30 @@ public class IotDeviceInfo extends BaseEntity
|
|||
this.hzProjectId = hzProjectId;
|
||||
}
|
||||
|
||||
public String getFactoryName() {
|
||||
return factoryName;
|
||||
}
|
||||
|
||||
public void setFactoryName(String factoryName) {
|
||||
this.factoryName = factoryName;
|
||||
}
|
||||
|
||||
public String getCompanyName() {
|
||||
return companyName;
|
||||
}
|
||||
|
||||
public void setCompanyName(String companyName) {
|
||||
this.companyName = companyName;
|
||||
}
|
||||
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
|
|
@ -5,6 +5,7 @@ import cn.hutool.http.HttpRequest;
|
|||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.HttpUtils;
|
||||
import com.ruoyi.iot.conf.HzApiConf;
|
||||
|
@ -46,7 +47,6 @@ import java.util.*;
|
|||
@Component("gainHzDataTask")
|
||||
public class GainHzDataTask {
|
||||
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(GainHzDataTask.class);
|
||||
|
||||
@Autowired
|
||||
|
@ -61,7 +61,6 @@ public class GainHzDataTask {
|
|||
@Autowired
|
||||
private IStandardCuringRoomDeviceService iStandardCuringRoomDeviceService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IEnvironmentService environmentService;
|
||||
|
||||
|
@ -73,6 +72,7 @@ public class GainHzDataTask {
|
|||
|
||||
public static Boolean[] warrning = new Boolean[]{false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false};
|
||||
public static Boolean[] warrning1 = new Boolean[]{false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false};
|
||||
public static Boolean[] warrning_power_sd = new Boolean[]{false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false};
|
||||
|
||||
@Test
|
||||
public void getPowerData() {
|
||||
|
@ -87,80 +87,184 @@ public class GainHzDataTask {
|
|||
iotDeviceInfo.setDeviceName("配电箱");
|
||||
List<IotDeviceInfo> iotDeviceInfos = iIotDeviceInfoService.selectIotDeviceInfoList(iotDeviceInfo);
|
||||
iotDeviceInfos.forEach(item -> {
|
||||
if(item.getHzTenantId() != null && item.getHzProjectId() != null) {
|
||||
JSONObject body = new JSONObject();
|
||||
body.put("tenantId", item.getHzTenantId());
|
||||
body.put("projectId", item.getHzProjectId());
|
||||
body.put("startTime", startTime);
|
||||
body.put("endTime", endTime);
|
||||
String res_str = HttpRequest.post(HzApiConf.IOT_POWER_HOST + HzApiConf.DISTRIBUTION_BOX_PAGE_REAL_DATA)
|
||||
.header("appId", HzApiConf.APP_ID).header("appSecret", HzApiConf.APP_SECRET)
|
||||
.body(body.toString())
|
||||
.execute().body();
|
||||
JSONObject res = JSONObject.parseObject(res_str);
|
||||
if(Objects.equals("华筑",item.getFactoryName())){
|
||||
if(item.getHzTenantId() != null && item.getHzProjectId() != null) {
|
||||
JSONObject body = new JSONObject();
|
||||
body.put("tenantId", item.getHzTenantId());
|
||||
body.put("projectId", item.getHzProjectId());
|
||||
body.put("startTime", startTime);
|
||||
body.put("endTime", endTime);
|
||||
String res_str = HttpRequest.post(HzApiConf.IOT_POWER_HOST + HzApiConf.DISTRIBUTION_BOX_PAGE_REAL_DATA)
|
||||
.header("appId", HzApiConf.APP_ID).header("appSecret", HzApiConf.APP_SECRET)
|
||||
.body(body.toString())
|
||||
.execute().body();
|
||||
JSONObject res = JSONObject.parseObject(res_str);
|
||||
|
||||
//2. 解析数据
|
||||
System.out.println(res_str);
|
||||
JSONArray content = res.getJSONObject("data").getJSONArray("content");
|
||||
System.out.println(content);
|
||||
List<IotWarningInfo> iotWarningInfos = new ArrayList<>(16);
|
||||
List<IotPower> iotPowers = new ArrayList<>(16);
|
||||
for (int i = 0; i < content.size(); i++) {
|
||||
//2. 解析数据
|
||||
System.out.println(res_str);
|
||||
JSONArray content = res.getJSONObject("data").getJSONArray("content");
|
||||
System.out.println(content);
|
||||
List<IotWarningInfo> iotWarningInfos = new ArrayList<>(16);
|
||||
List<IotPower> iotPowers = new ArrayList<>(16);
|
||||
for (int i = 0; i < content.size(); i++) {
|
||||
|
||||
//3.数据转换
|
||||
JSONObject tmp = content.getJSONObject(i);
|
||||
IotPower iotPower = new IotPower();
|
||||
iotPower.setUid(tmp.getString("deviceSn"));
|
||||
iotPower.setTime(tmp.getDate("createTime"));
|
||||
iotPower.setPower(BigDecimal.valueOf(tmp.getFloat("totalPower")));
|
||||
iotPower.setLeak(BigDecimal.valueOf(tmp.getFloat("leftElectric")));
|
||||
iotPower.setC1(BigDecimal.valueOf(tmp.getFloat("currentElectric1")));
|
||||
iotPower.setC2(BigDecimal.valueOf(tmp.getFloat("currentElectric2")));
|
||||
iotPower.setC3(BigDecimal.valueOf(tmp.getFloat("currentElectric3")));
|
||||
iotPower.setV1(BigDecimal.valueOf(tmp.getFloat("currentVoltage1")));
|
||||
iotPower.setV2(BigDecimal.valueOf(tmp.getFloat("currentVoltage2")));
|
||||
iotPower.setV3(BigDecimal.valueOf(tmp.getFloat("currentVoltage3")));
|
||||
iotPower.setT1(BigDecimal.valueOf(tmp.getFloat("monitorTem1")));
|
||||
iotPower.setT2(BigDecimal.valueOf(tmp.getFloat("monitorTem2")));
|
||||
iotPower.setT3(BigDecimal.valueOf(tmp.getFloat("monitorTem3")));
|
||||
iotPower.setT4(BigDecimal.valueOf(tmp.getFloat("monitorTem4")));
|
||||
if (t % 2 == 0 && !warrning[t]) {
|
||||
warrning = new Boolean[]{false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false};
|
||||
warrning[t] = true;
|
||||
if (iotPower.getLeak().floatValue() > HzApiConf.DISTRIBUTION_BOX_WARNING_LEAK) {
|
||||
IotWarningInfo iotWarningInfo = new IotWarningInfo();
|
||||
iotWarningInfo.setDeviceId(iotPower.getUid());
|
||||
iotWarningInfo.setType("漏电预警");
|
||||
iotWarningInfo.setContent(String.format("设备存在漏电,当前剩余电流:%s", iotPower.getLeak()));
|
||||
iotWarningInfo.setCreateTime(new Date());
|
||||
iotWarningInfos.add(iotWarningInfo);
|
||||
//3.数据转换
|
||||
JSONObject tmp = content.getJSONObject(i);
|
||||
IotPower iotPower = new IotPower();
|
||||
iotPower.setUid(tmp.getString("deviceSn"));
|
||||
iotPower.setTime(tmp.getDate("createTime"));
|
||||
iotPower.setPower(BigDecimal.valueOf(tmp.getFloat("totalPower")));
|
||||
iotPower.setLeak(BigDecimal.valueOf(tmp.getFloat("leftElectric")));
|
||||
iotPower.setC1(BigDecimal.valueOf(tmp.getFloat("currentElectric1")));
|
||||
iotPower.setC2(BigDecimal.valueOf(tmp.getFloat("currentElectric2")));
|
||||
iotPower.setC3(BigDecimal.valueOf(tmp.getFloat("currentElectric3")));
|
||||
iotPower.setV1(BigDecimal.valueOf(tmp.getFloat("currentVoltage1")));
|
||||
iotPower.setV2(BigDecimal.valueOf(tmp.getFloat("currentVoltage2")));
|
||||
iotPower.setV3(BigDecimal.valueOf(tmp.getFloat("currentVoltage3")));
|
||||
iotPower.setT1(BigDecimal.valueOf(tmp.getFloat("monitorTem1")));
|
||||
iotPower.setT2(BigDecimal.valueOf(tmp.getFloat("monitorTem2")));
|
||||
iotPower.setT3(BigDecimal.valueOf(tmp.getFloat("monitorTem3")));
|
||||
iotPower.setT4(BigDecimal.valueOf(tmp.getFloat("monitorTem4")));
|
||||
if (t % 2 == 0 && !warrning[t]) {
|
||||
warrning = new Boolean[]{false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false};
|
||||
warrning[t] = true;
|
||||
if (iotPower.getLeak().floatValue() > HzApiConf.DISTRIBUTION_BOX_WARNING_LEAK) {
|
||||
IotWarningInfo iotWarningInfo = new IotWarningInfo();
|
||||
iotWarningInfo.setDeviceId(iotPower.getUid());
|
||||
iotWarningInfo.setType("漏电预警");
|
||||
iotWarningInfo.setContent(String.format("设备存在漏电,当前剩余电流:%s", iotPower.getLeak()));
|
||||
iotWarningInfo.setCreateTime(new Date());
|
||||
iotWarningInfos.add(iotWarningInfo);
|
||||
}
|
||||
|
||||
if (iotPower.getT1().floatValue() > HzApiConf.DISTRIBUTION_BOX_WARNING_TEMP
|
||||
|| iotPower.getT2().floatValue() > HzApiConf.DISTRIBUTION_BOX_WARNING_TEMP
|
||||
|| iotPower.getT3().floatValue() > HzApiConf.DISTRIBUTION_BOX_WARNING_TEMP
|
||||
|| iotPower.getT4().floatValue() > HzApiConf.DISTRIBUTION_BOX_WARNING_TEMP) {
|
||||
IotWarningInfo iotWarningInfo = new IotWarningInfo();
|
||||
iotWarningInfo.setDeviceId(iotPower.getUid());
|
||||
iotWarningInfo.setType("温度异常");
|
||||
iotWarningInfo.setContent(String.format("设备当前温度:%s,%s,%s,%s,有温度高于70度", iotPower.getT1(), iotPower.getT2(), iotPower.getT3(), iotPower.getT4()));
|
||||
iotWarningInfo.setCreateTime(new Date());
|
||||
iotWarningInfos.add(iotWarningInfo);
|
||||
}
|
||||
}
|
||||
|
||||
if (iotPower.getT1().floatValue() > HzApiConf.DISTRIBUTION_BOX_WARNING_TEMP
|
||||
|| iotPower.getT2().floatValue() > HzApiConf.DISTRIBUTION_BOX_WARNING_TEMP
|
||||
|| iotPower.getT3().floatValue() > HzApiConf.DISTRIBUTION_BOX_WARNING_TEMP
|
||||
|| iotPower.getT4().floatValue() > HzApiConf.DISTRIBUTION_BOX_WARNING_TEMP) {
|
||||
IotWarningInfo iotWarningInfo = new IotWarningInfo();
|
||||
iotWarningInfo.setDeviceId(iotPower.getUid());
|
||||
iotWarningInfo.setType("温度异常");
|
||||
iotWarningInfo.setContent(String.format("设备当前温度:%s,%s,%s,%s,有温度高于70度", iotPower.getT1(), iotPower.getT2(), iotPower.getT3(), iotPower.getT4()));
|
||||
iotWarningInfo.setCreateTime(new Date());
|
||||
iotWarningInfos.add(iotWarningInfo);
|
||||
//4. 数据入库
|
||||
iotPowers.add(iotPower);
|
||||
|
||||
Request request = new Request();
|
||||
request.setUri("https://aqzg.makalu.cc/api/iot/power/save");
|
||||
request.addBody(JSONObject.parseObject(JSONObject.toJSONString(iotPower), HashMap.class));
|
||||
try {
|
||||
HttpClient.json(request);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
//4. 数据入库
|
||||
iotPowers.add(iotPower);
|
||||
|
||||
Request request = new Request();
|
||||
request.setUri("https://aqzg.makalu.cc/api/iot/power/save");
|
||||
request.addBody(JSONObject.parseObject(JSONObject.toJSONString(iotPower), HashMap.class));
|
||||
try {
|
||||
HttpClient.json(request);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
if (iotPowers.size() > 0) {
|
||||
iotPowerService.batchInsertPower(iotPowers);
|
||||
}
|
||||
if (iotWarningInfos.size() > 0) {
|
||||
iotWarningInfoService.batchInsertWarning(iotWarningInfos);
|
||||
}
|
||||
}
|
||||
}else if(Objects.equals("华筑",item.getFactoryName())){
|
||||
String res_str = HttpRequest.get(HzApiConf.SD_IOT_POWER_HOST + "/metric/box/"+item.getDeviceId())
|
||||
.execute().body();
|
||||
JSONObject res = JSONObject.parseObject(res_str).getJSONObject("result");
|
||||
// 电能检测数据
|
||||
JSONObject metric = res.getJSONObject("metric");
|
||||
// 温度检测数据
|
||||
JSONArray temperatures = res.getJSONArray("temperatures");
|
||||
// 漏电检测数据
|
||||
JSONArray leakages = res.getJSONArray("leakages");
|
||||
// 报警数据
|
||||
JSONObject ticketStatus = res.getJSONObject("ticketStatus");
|
||||
List<IotPower> iotPowers = new ArrayList<>(16);
|
||||
List<IotWarningInfo> iotWarningInfos = new ArrayList<>(16);
|
||||
IotPower iotPower = new IotPower();
|
||||
iotPower.setUid(item.getDeviceId());
|
||||
iotPower.setTime(DateUtils.getNowDate());
|
||||
BigDecimal power = metric.getBigDecimal("power_a").add(metric.getBigDecimal("power_b")).add(metric.getBigDecimal("power_c"));
|
||||
iotPower.setPower(power.divide(new BigDecimal(3), 2, BigDecimal.ROUND_HALF_UP));
|
||||
int leak = 0;
|
||||
for (int i = 0; i < leakages.size(); i++) {
|
||||
JSONObject leakage = leakages.getJSONObject(i);
|
||||
if(Convert.toInt(leakage.get("leakage"),0)>leak){
|
||||
leak = leakage.getInteger("leakage");
|
||||
}
|
||||
}
|
||||
iotPower.setLeak(BigDecimal.valueOf(leak));
|
||||
iotPower.setC1(BigDecimal.valueOf(metric.getFloat("current_a")));
|
||||
iotPower.setC2(BigDecimal.valueOf(metric.getFloat("current_b")));
|
||||
iotPower.setC3(BigDecimal.valueOf(metric.getFloat("current_c")));
|
||||
iotPower.setV1(BigDecimal.valueOf(metric.getFloat("voltage_a")));
|
||||
iotPower.setV2(BigDecimal.valueOf(metric.getFloat("voltage_b")));
|
||||
iotPower.setV3(BigDecimal.valueOf(metric.getFloat("voltage_c")));
|
||||
BigDecimal data = temperatures.getJSONObject(0).getBigDecimal("temperature");
|
||||
iotPower.setT1(data);
|
||||
iotPower.setT2(data);
|
||||
iotPower.setT3(data);
|
||||
iotPower.setT4(data);
|
||||
|
||||
// 预警数据
|
||||
if (t % 2 == 0 && !warrning_power_sd[t]) {
|
||||
warrning_power_sd = new Boolean[]{false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false};
|
||||
warrning_power_sd[t] = true;
|
||||
|
||||
if(ticketStatus.getInteger("is_blackout")>0){
|
||||
IotWarningInfo iotWarningInfo = new IotWarningInfo();
|
||||
iotWarningInfo.setDeviceId(iotPower.getUid());
|
||||
iotWarningInfo.setType("断电预警");
|
||||
iotWarningInfo.setContent("设备触发断电,请排查异常情况");
|
||||
iotWarningInfo.setCreateTime(new Date());
|
||||
iotWarningInfos.add(iotWarningInfo);
|
||||
}
|
||||
if(ticketStatus.getInteger("is_smoke")>0){
|
||||
IotWarningInfo iotWarningInfo = new IotWarningInfo();
|
||||
iotWarningInfo.setDeviceId(iotPower.getUid());
|
||||
iotWarningInfo.setType("烟感报警");
|
||||
iotWarningInfo.setContent("设备烟感报警,请排查异常情况");
|
||||
iotWarningInfo.setCreateTime(new Date());
|
||||
iotWarningInfos.add(iotWarningInfo);
|
||||
}
|
||||
if(ticketStatus.getInteger("is_overload")>0){
|
||||
IotWarningInfo iotWarningInfo = new IotWarningInfo();
|
||||
iotWarningInfo.setDeviceId(iotPower.getUid());
|
||||
iotWarningInfo.setType("过载报警");
|
||||
iotWarningInfo.setContent("设备过载报警,请排查异常情况");
|
||||
iotWarningInfo.setCreateTime(new Date());
|
||||
iotWarningInfos.add(iotWarningInfo);
|
||||
}
|
||||
if(ticketStatus.getInteger("is_disconnect")>0){
|
||||
IotWarningInfo iotWarningInfo = new IotWarningInfo();
|
||||
iotWarningInfo.setDeviceId(iotPower.getUid());
|
||||
iotWarningInfo.setType("断开报警");
|
||||
iotWarningInfo.setContent("设备断开报警,请排查异常情况");
|
||||
iotWarningInfo.setCreateTime(new Date());
|
||||
iotWarningInfos.add(iotWarningInfo);
|
||||
}
|
||||
if(ticketStatus.getInteger("is_overheat")>0){
|
||||
IotWarningInfo iotWarningInfo = new IotWarningInfo();
|
||||
iotWarningInfo.setDeviceId(iotPower.getUid());
|
||||
iotWarningInfo.setType(" 高温报警");
|
||||
iotWarningInfo.setContent("设备高温报警,请排查异常情况");
|
||||
iotWarningInfo.setCreateTime(new Date());
|
||||
iotWarningInfos.add(iotWarningInfo);
|
||||
}
|
||||
if(ticketStatus.getInteger("is_leakage")>0){
|
||||
IotWarningInfo iotWarningInfo = new IotWarningInfo();
|
||||
iotWarningInfo.setDeviceId(iotPower.getUid());
|
||||
iotWarningInfo.setType(" 漏电报警");
|
||||
iotWarningInfo.setContent("设备漏电报警,请排查异常情况");
|
||||
iotWarningInfo.setCreateTime(new Date());
|
||||
iotWarningInfos.add(iotWarningInfo);
|
||||
}
|
||||
}
|
||||
|
||||
iotPowers.add(iotPower);
|
||||
|
||||
if (iotPowers.size() > 0) {
|
||||
iotPowerService.batchInsertPower(iotPowers);
|
||||
}
|
||||
|
@ -169,7 +273,6 @@ public class GainHzDataTask {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -1,43 +1,20 @@
|
|||
package com.ruoyi.iot.task;
|
||||
|
||||
import cc.casually.htmlParse.http.*;
|
||||
import cc.casually.htmlParse.util.HttpUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.common.message.MessageOneUtil;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.iot.conf.HzApiConf;
|
||||
import com.ruoyi.iot.domain.IotPower;
|
||||
import com.ruoyi.iot.domain.IotWarningInfo;
|
||||
import com.ruoyi.iot.domain.StandardCuringRoomDevice;
|
||||
import com.ruoyi.iot.service.IIotPowerService;
|
||||
import com.ruoyi.iot.service.IIotWarningInfoService;
|
||||
import com.ruoyi.iot.service.IStandardCuringRoomDeviceService;
|
||||
import com.ruoyi.system.mapper.MeasureDeviceMapper;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import com.ruoyi.utils.HttpUtils;
|
||||
import com.ruoyi.weixin.domain.Environment;
|
||||
import com.ruoyi.weixin.mapper.ConcreteStrengthDataMapper;
|
||||
import com.ruoyi.weixin.mapper.EnvironmentMapper;
|
||||
import com.ruoyi.weixin.service.IEnvironmentService;
|
||||
import org.apache.commons.collections.map.HashedMap;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.protocol.HTTP;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 混凝土强度数据拉取定时任务
|
||||
|
|
|
@ -14,10 +14,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="typeName" column="type_name" />
|
||||
<result property="hzTenantId" column="hz_tenant_id" />
|
||||
<result property="hzProjectId" column="hz_project_id" />
|
||||
<result property="factoryName" column="factory_name" />
|
||||
<result property="companyName" column="company_name" />
|
||||
<result property="projectName" column="project_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectIotDeviceInfoVo">
|
||||
select id, device_id, device_name, state, project_id, points,type_name,hz_tenant_id,hz_project_id from iot_device_info
|
||||
select id, device_id, device_name, state, project_id, points, type_name, hz_tenant_id, hz_project_id, factory_name, company_name, project_name from iot_device_info
|
||||
</sql>
|
||||
|
||||
<select id="selectIotDeviceInfoList" parameterType="IotDeviceInfo" resultMap="IotDeviceInfoResult">
|
||||
|
@ -29,6 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="projectId != null "> and project_id = #{projectId}</if>
|
||||
<if test="points != null "> and points = #{points}</if>
|
||||
<if test="typeName != null "> and type_name = #{typeName}</if>
|
||||
<if test="factoryName != null and factoryName != ''"> and factory_name = #{factoryName}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
|
Loading…
Reference in New Issue