Browse Source

Merge remote-tracking branch 'origin/develop' into develop

develop
zhaoxianglong 9 months ago
parent
commit
037d6e10b8
  1. 119
      zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java
  2. 8
      zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java
  3. 2
      zc-business/src/main/java/com/zc/business/domain/DcEventTrafficControl.java
  4. 7
      zc-business/src/main/java/com/zc/business/mapper/DcDeviceMapper.java
  5. 1
      zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java
  6. 6
      zc-business/src/main/java/com/zc/business/service/IDcDeviceService.java
  7. 11
      zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java
  8. 37
      zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java
  9. 10
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java
  10. 14
      zc-business/src/main/resources/mapper/business/DcDeviceMapper.xml

119
zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java

@ -1,16 +1,19 @@
package com.zc.business.controller; package com.zc.business.controller;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference; import com.alibaba.fastjson.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.zc.business.constant.DeviceTypeConstants; import com.zc.business.constant.DeviceTypeConstants;
import com.zc.business.domain.DcDevice; import com.zc.business.domain.DcDevice;
@ -25,6 +28,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import okhttp3.Response; import okhttp3.Response;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
@ -34,6 +38,8 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import java.io.IOException; import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -687,4 +693,117 @@ public class DcDeviceController extends BaseController {
Map<String, Object> map = new ObjectMapper().convertValue(object, Map.class); Map<String, Object> map = new ObjectMapper().convertValue(object, Map.class);
return batchInvokedFunction(map); return batchInvokedFunction(map);
} }
/**
* 分页查询设备名称列表
* @param dcDevice 请求参数
* @return 分页查询结果
*/
@GetMapping("/selectDeviceNameList")
public TableDataInfo selectDeviceNameList(DcDevice dcDevice) {
startPage();
return getDataTable(dcDeviceService.selectDeviceNameList(dcDevice));
}
@GetMapping("/deviceParameter")
public TableDataInfo selectDeviceParameterProperties(DcDevice dcDevice) {
if (dcDevice==null||dcDevice.getDeviceType()==null){
TableDataInfo tableDataInfo = new TableDataInfo();
tableDataInfo.setCode(500);
tableDataInfo.setMsg("参数错误");
return tableDataInfo;
}
startPage();
return getDataTable(dcDeviceService.selectDeviceParameterProperties(dcDevice));
}
/**
* 查询设备指定属性属性列表
* param参数
* deviceId 设备id
* propertyId 属性id
* propertyName 属性名称
* deviceType 设备类型
* dateTime 时间
* @return 属性列表
*/
@PostMapping("/properties/deviceNameData")
public AjaxResult queryDevice(@RequestBody HashMap map) throws HttpException, IOException {
if (map==null||!map.containsKey("deviceId")||!map.containsKey("deviceType")
||!map.containsKey("propertyName")||!map.containsKey("propertyId")
||!map.containsKey("dateTime")){
return AjaxResult.error("参数错误");
}
String deviceType = map.get("deviceType").toString();//设备类型
String deviceId = map.get("deviceId").toString();//设备id
String propertyId = map.get("propertyId").toString();//属性id
String propertyName = map.get("propertyName").toString();//属性名称
HashMap<String, Object> props = new HashMap<>();
// 设置查询条件的键为“timestamp$BTW”,表示时间戳在一定范围内
props.put("terms[0].column", "timestamp$BTW");
ArrayList<String> dateList = new ArrayList<>();
// 添加当前日期的开始和结束时间到列表,用于设定时间范围
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
try {
Date date = dateFormat.parse((String) map.get("dateTime"));
dateList.add(DateUtil.beginOfDay(date).toString());
dateList.add(DateUtil.endOfDay(date).toString());
} catch (ParseException e) {
e.printStackTrace();
}
// 将日期列表以逗号分隔并设置为查询条件的值
props.put("terms[0].value", String.join(",", dateList));
props.put("paging", false);
props.put("sorts[0].order", "asc");
props.put("sorts[0].name", "timestamp");
AjaxResult ajaxResult = queryDeviceProperties(deviceId, propertyId, props);
String code = ajaxResult.get("code").toString();
if ("500".equals(code)){
return ajaxResult;
}
if ("13".equals(deviceType) || "16".equals(deviceType)) { //判断是否为设备箱/远端机
JSONObject data = (JSONObject) ajaxResult.get("data");
JSONArray dataVale = (JSONArray) data.get("data");
List<JSONObject> jsonObjectList = dataVale.toJavaList(JSONObject.class);
// 定义一个时间格式转换的工具
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
// 使用Stream API提取每个JSONObject中的timestamp和propertyName值
List<Map<String, String>> results = jsonObjectList.stream()
.map(jsonObject -> {
long timestamp = jsonObject.getLongValue("timestamp"); // 假设timestamp是long类型
Date date = new Date(timestamp); // 将时间戳转换为Date对象
String formattedTime = sdf.format(date); // 将Date对象格式化为字符串
JSONObject formatValue = jsonObject.getJSONObject("formatValue"); // 获取嵌套的JSONObject
String result = formatValue.getString(propertyName); // 从嵌套的JSONObject中获取电压值
Map<String, String> hashMap = new HashMap<>();
hashMap.put("timestamp", formattedTime); // 使用"timestamp"作为键来存储格式化后的时间
hashMap.put("result", result); // 使用"voltage"作为键来存储电压值
return hashMap;
})
.collect(Collectors.toList());
results.sort(Comparator.comparing(hashMap -> hashMap.get("timestamp")));
return AjaxResult.success(results);
}
if ("3".equals(deviceType)||"17".equals(deviceType)){ //气象预警/ups设备
JSONObject data = (JSONObject) ajaxResult.get("data");
JSONArray dataValue = (JSONArray) data.get("data");
List<JSONObject> jsonObjectList = dataValue.toJavaList(JSONObject.class);
// 定义一个时间格式转换的工具
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
List<HashMap<String, String>> results = jsonObjectList.stream()
.map(jsonObject -> {
long timestamp = jsonObject.getLongValue("timestamp"); // 假设timestamp是long类型
Date date = new Date(timestamp); // 将时间戳转换为Date对象
String formattedTime = sdf.format(date); // 将Date对象格式化为字符串
String result = jsonObject.getString(propertyName);
HashMap<String, String> hashMap = new HashMap<>();
hashMap.put("timestamp", formattedTime); // 使用时间戳作为键可能不是最佳实践,但这里保持与原始逻辑一致
hashMap.put("result", result);
return hashMap;
})
.collect(Collectors.toList());
results.sort(Comparator.comparing(hashMap -> hashMap.get("timestamp")));
return AjaxResult.success(results);
}
return null;
}
} }

8
zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java

@ -9,6 +9,8 @@ import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.exception.file.InvalidExtensionException; import com.ruoyi.common.exception.file.InvalidExtensionException;
import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.MimeTypeUtils; import com.ruoyi.common.utils.file.MimeTypeUtils;
import com.zc.business.domain.DcEvent;
import com.zc.business.service.IDcEventService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
@ -43,6 +45,8 @@ public class DcEventProcessController extends BaseController
{ {
@Autowired @Autowired
private IDcEventProcessService dcEventProcessService; private IDcEventProcessService dcEventProcessService;
@Autowired
private IDcEventService dcEventService;
/** /**
* 查询事件处理流程列表 * 查询事件处理流程列表
@ -101,6 +105,10 @@ public class DcEventProcessController extends BaseController
@Log(title = "事件处理流程", businessType = BusinessType.INSERT) @Log(title = "事件处理流程", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody DcEventProcess dcEventProcess){ public AjaxResult add(@RequestBody DcEventProcess dcEventProcess){
DcEvent dcEvent = dcEventService.selectDcEventById(dcEventProcess.getEventId());
if (dcEvent.getEventState() == 2){
return AjaxResult.error("事件已结束,无法进行操作!");
}
if (dcEventProcess.getProcessType() != null && dcEventProcess.getProcessType() == 1){ if (dcEventProcess.getProcessType() != null && dcEventProcess.getProcessType() == 1){
int status = dcEventProcessService.selectPreviousNodeStatus(dcEventProcess.getEventId(),dcEventProcess.getProcessId()); int status = dcEventProcessService.selectPreviousNodeStatus(dcEventProcess.getEventId(),dcEventProcess.getProcessId());
if (status < 1){ if (status < 1){

2
zc-business/src/main/java/com/zc/business/domain/DcEventTrafficControl.java

@ -66,7 +66,7 @@ public class DcEventTrafficControl extends BaseEntity
*/ */
@ApiModelProperty("匝道(立交)") @ApiModelProperty("匝道(立交)")
@Excel(name = "匝道", readConverterExp = "立=交") @Excel(name = "匝道", readConverterExp = "立=交")
private Long rampId; private String rampId;
/* /*
@ApiModelProperty("高速公路 id") @ApiModelProperty("高速公路 id")
private Long roadId; private Long roadId;

7
zc-business/src/main/java/com/zc/business/mapper/DcDeviceMapper.java

@ -5,6 +5,7 @@ import com.zc.business.domain.DcDevice;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -25,4 +26,10 @@ public interface DcDeviceMapper extends BaseMapper<DcDevice> {
List<DcDevice> selectNearBoard(@Param("direction") String direction,@Param("startMileage") Integer startMileage,@Param("endMileage") Integer endMileage); List<DcDevice> selectNearBoard(@Param("direction") String direction,@Param("startMileage") Integer startMileage,@Param("endMileage") Integer endMileage);
List<Map<String,String>> countTheNumberOfEligibleItems(); List<Map<String,String>> countTheNumberOfEligibleItems();
//设备查询-设备名称列表
public List<HashMap<String,Object>> selectDeviceNameList(DcDevice dcDevice);
//设备查询-设备参数属性列表
public List<HashMap<String,Object>> selectDeviceParameterProperties(DcDevice dcDevice);
} }

1
zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java

@ -84,6 +84,7 @@ public class DeviceMessageHandler {
DcDevice device = redisCache.getCacheMapValue(RedisKeyConstants.DC_DEVICES, dcDevice.getIotDeviceId()); DcDevice device = redisCache.getCacheMapValue(RedisKeyConstants.DC_DEVICES, dcDevice.getIotDeviceId());
if (!ObjectUtils.isEmpty(device)) { if (!ObjectUtils.isEmpty(device)) {
dcDevice.setId(device.getId()); dcDevice.setId(device.getId());
dcDevice.setDeviceType(device.getDeviceType());
} }
}); });

6
zc-business/src/main/java/com/zc/business/service/IDcDeviceService.java

@ -6,6 +6,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.zc.business.domain.DcDevice; import com.zc.business.domain.DcDevice;
import com.zc.business.domain.DcStakeMark; import com.zc.business.domain.DcStakeMark;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -104,4 +105,9 @@ public interface IDcDeviceService extends IService<DcDevice> {
* 查询上游10公里内的情报板 * 查询上游10公里内的情报板
*/ */
AjaxResult selectNearBoard(String stakeMark, String direction); AjaxResult selectNearBoard(String stakeMark, String direction);
//设备查询-设备名称列表
public List<HashMap<String,Object>> selectDeviceNameList(DcDevice dcDevice);
//设备查询-设备参数属性列表
public List<HashMap<String,Object>> selectDeviceParameterProperties(DcDevice dcDevice);
} }

11
zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java

@ -533,5 +533,16 @@ public class DcDeviceServiceImpl extends ServiceImpl<DcDeviceMapper, DcDevice> i
} }
return AjaxResult.success(boardList); return AjaxResult.success(boardList);
} }
//设备查询-设备名称列表
@Override
public List<HashMap<String, Object>> selectDeviceNameList(DcDevice dcDevice) {
return dcDeviceMapper.selectDeviceNameList(dcDevice);
}
//设备查询-设备参数属性列表
@Override
public List<HashMap<String, Object>> selectDeviceParameterProperties(DcDevice dcDevice) {
return dcDeviceMapper.selectDeviceParameterProperties(dcDevice);
}
} }

37
zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java

@ -219,7 +219,26 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
*/ */
public void customPublishingDataFormatProcessing(List<DcDevice> deviceList, JSONObject otherConfig, int deviceType) { public void customPublishingDataFormatProcessing(List<DcDevice> deviceList, JSONObject otherConfig, int deviceType) {
List<Map<String,Object>> contentList = new ArrayList<>(); List<Map<String,Object>> contentList = new ArrayList<>();
if (!ObjectUtils.isEmpty(otherConfig.get("contentList"))) {
contentList.addAll((List<Map<String,Object>>) otherConfig.get("contentList"));
contentList.removeIf(cont -> deviceList.stream().noneMatch(device -> device.getId().toString().equals(cont.get("dcDeviceId").toString())));
deviceList.forEach(dcDevice -> { deviceList.forEach(dcDevice -> {
boolean filter = contentList.stream().anyMatch(content ->
content.get("dcDeviceId").toString().equals(dcDevice.getId().toString()));
if (!filter) {
handleContentList(dcDevice,deviceType,otherConfig,contentList);
}
});
}else {
deviceList.forEach(dcDevice -> {
handleContentList(dcDevice,deviceType,otherConfig,contentList);
});
}
otherConfig.put("contentList",contentList);
}
public void handleContentList(DcDevice dcDevice, int deviceType, JSONObject otherConfig, List<Map<String,Object>> contentList) {
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("dcDeviceId",dcDevice.getId()); map.put("dcDeviceId",dcDevice.getId());
map.put("deviceName",dcDevice.getDeviceName()); map.put("deviceName",dcDevice.getDeviceName());
@ -231,8 +250,6 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
map.put("content",otherConfig.get("content")); map.put("content",otherConfig.get("content"));
} }
contentList.add(map); contentList.add(map);
});
otherConfig.put("contentList",contentList);
} }
/** /**
@ -647,14 +664,14 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
// 车辆故障 // 车辆故障
DcEventVehicleAccident dcEventVehicleAccident = dcEvent.getDcEventVehicleAccident(); DcEventVehicleAccident dcEventVehicleAccident = dcEvent.getDcEventVehicleAccident();
int locationType = Integer.parseInt(dcEventVehicleAccident.getLocationType().toString()); int locationType = Integer.parseInt(dcEventVehicleAccident.getLocationType().toString());
// 路广设施id
Integer facilityId = dcEventVehicleAccident.getFacilityId();
DcFacility facility = dcFacilityService.getFacility(facilityId.toString());
String facilityName = facility.getFacilityName();
if (locationType == 1) { if (locationType == 1) {
content = "前方*高速主线发生车辆故障"; content = "前方*高速主线发生车辆故障";
} else if (locationType == 2 || locationType == 3 || locationType == 4) { } else if (locationType == 2 || locationType == 3 || locationType == 4) {
// 服务区、立交、收费站 // 服务区、立交、收费站
// 路广设施id
Integer facilityId = dcEventVehicleAccident.getFacilityId();
DcFacility facility = dcFacilityService.getFacility(facilityId.toString());
String facilityName = facility.getFacilityName();
content = "前方*"+facilityName+"发生车辆故障"; content = "前方*"+facilityName+"发生车辆故障";
} }
@ -838,14 +855,14 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
JSONObject foundContent = contentList.stream() JSONObject foundContent = contentList.stream()
.map(content -> JSON.parseObject(content.toString())) .map(content -> JSON.parseObject(content.toString()))
.filter(jsonObject -> .filter(jsonObject ->
Integer.parseInt(jsonObject.get("dcDeviceId").toString()) == device.getId()) jsonObject.get("dcDeviceId").toString().equals(device.getId().toString()))
.findFirst() .findFirst()
.orElse(null); .orElse(null);
if (foundContent == null) { if (foundContent == null) {
// 说明没有匹配到设备 // 说明没有匹配到设备
JSONObject errorResult = new JSONObject(); JSONObject errorResult = new JSONObject();
errorResult.put("device",device.getId()); errorResult.put("device",device.getId());
errorResult.put("errorMessage","未匹配到对应的模板内容"); errorResult.put("content","未匹配到对应的模板内容");
resultArray.add(errorResult); resultArray.add(errorResult);
}else { }else {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
@ -867,7 +884,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
JSONObject foundContent = contentList.stream() JSONObject foundContent = contentList.stream()
.map(content -> JSON.parseObject(content.toString())) .map(content -> JSON.parseObject(content.toString()))
.filter(jsonObject -> .filter(jsonObject ->
Integer.parseInt(jsonObject.get("dcDeviceId").toString()) == device.getId()) jsonObject.get("dcDeviceId").toString().equals(device.getId().toString()))
.findFirst() .findFirst()
.orElse(null); .orElse(null);
if (foundContent == null) { if (foundContent == null) {
@ -875,7 +892,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
JSONObject errorResult = new JSONObject(); JSONObject errorResult = new JSONObject();
errorResult.put("device",device.getId()); errorResult.put("device",device.getId());
errorResult.put("deviceName",device.getDeviceName()); errorResult.put("deviceName",device.getDeviceName());
errorResult.put("errorMessage","未匹配到对应的广播内容"); errorResult.put("content","未匹配到对应的广播内容");
resultArray.add(errorResult); resultArray.add(errorResult);
} }
if (StringUtils.isEmpty(foundContent.getString("content"))) { if (StringUtils.isEmpty(foundContent.getString("content"))) {

10
zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java

@ -170,6 +170,10 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
String facilityId = String.valueOf(dcEvent.getDcEventTrafficControl().getFacilityIds()[0]); String facilityId = String.valueOf(dcEvent.getDcEventTrafficControl().getFacilityIds()[0]);
dcEvent.setStakeMark(extracted(facilityId)); dcEvent.setStakeMark(extracted(facilityId));
} }
if (eventType == 3 && dcEvent.getDcEventTrafficControl().getFacilityId() != null && dcEvent.getDcEventTrafficControl().getFacilityId()>0) {
String facilityId = String.valueOf(dcEvent.getDcEventTrafficControl().getFacilityId());
dcEvent.setStakeMark(extracted(facilityId));
}
//交通拥堵 //交通拥堵
if (eventType == 4 && dcEvent.getDcEventTrafficCongestion().getFacilityId() != null) { if (eventType == 4 && dcEvent.getDcEventTrafficCongestion().getFacilityId() != null) {
String facilityId = String.valueOf(dcEvent.getDcEventTrafficCongestion().getFacilityId()); String facilityId = String.valueOf(dcEvent.getDcEventTrafficCongestion().getFacilityId());
@ -219,6 +223,11 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
//交通管制 //交通管制
case 3: case 3:
if (dcEvent.getDcEventTrafficControl() != null) { if (dcEvent.getDcEventTrafficControl() != null) {
if (dcEvent.getDcEventTrafficControl().getFacilityId()==null || dcEvent.getDcEventTrafficControl().getFacilityId()>0){
dcEvent.getDcEventTrafficControl().setId(uuid);
int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl());
break;
}
// 插入多个收费站 // 插入多个收费站
if (dcEvent.getDcEventTrafficControl().getFacilityIds().length == 1) {//facilityIds==1 说明只选择了一个收费站 if (dcEvent.getDcEventTrafficControl().getFacilityIds().length == 1) {//facilityIds==1 说明只选择了一个收费站
@ -352,6 +361,7 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
} }
} }
} }
break; break;
//交通拥堵 //交通拥堵

14
zc-business/src/main/resources/mapper/business/DcDeviceMapper.xml

@ -153,5 +153,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
GROUP BY GROUP BY
dc_road_section.id; dc_road_section.id;
</select> </select>
<select id="selectDeviceNameList" resultType="java.util.HashMap">
select iot_device_id deviceId, device_type deviceType,device_name deviceName,device_state deviceState from dc_device
<where>
<if test="deviceState != null and deviceState != ''">and device_state = #{deviceState}</if>
<if test="deviceName != null and deviceName != ''">and device_name like concat('%', #{deviceName}, '%')</if>
and (device_type=3||device_type=13||device_type=16||device_type=17) and iot_device_id is not null
</where>
</select>
<select id="selectDeviceParameterProperties" resultType="java.util.HashMap">
select id, device_type deviceType,
property_id propertyId,property_name propertyName,
name from dc_device_attribute
where device_type=#{deviceType}
</select>
</mapper> </mapper>

Loading…
Cancel
Save