Browse Source

_9003设备

master
review512jwy@163.com 6 days ago
parent
commit
87ee22ac54
  1. 6
      dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceInfoMapperExt.xml
  2. 15
      dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/common/CommonOpt.java

6
dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceInfoMapperExt.xml

@ -51,7 +51,8 @@
#{deviceId}
</foreach>
</if>
and device_info.flag = 0 and device_info.device_id LIKE '%\_85' and basic_monitoring_asset.flag != 1 and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1
and device_info.flag = 0 and (device_info.device_id LIKE '%\_85' or device_info.device_id LIKE '%\_85_9003')
and basic_monitoring_asset.flag != 1 and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1
and type.device_category_id in
<foreach collection="categoryIdList" item="categoryId" open="(" separator="," close=")">
#{categoryId}
@ -421,7 +422,8 @@
#{companyId}
</foreach>
</if>
and device_info.flag = 0 and device_info.device_id LIKE '%\_85' and basic_monitoring_asset.flag != 1 and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1
and device_info.flag = 0 and (device_info.device_id LIKE '%\_85' or device_info.device_id LIKE '%\_85_9003')
and basic_monitoring_asset.flag != 1 and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1
and type.device_category_id in
<foreach collection="categoryIdList" item="categoryId" open="(" separator="," close=")">
#{categoryId}

15
dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/common/CommonOpt.java

@ -44,7 +44,9 @@ public class CommonOpt {
private static Logger logger = LoggerFactory.getLogger(CommonOpt.class);
private static final String SUFFIX_85 = "_85";
private static final String SUFFIX_85_9003 = "_85_9003";
private static final String SUFFIX_111 = "_111";
private static final String SUFFIX_111_9003 = "_111_9003";
@Value("${spring.datasource.url}")
private String dbUrl;
@ -464,11 +466,18 @@ public class CommonOpt {
public Map<String, String> buildDeviceId85To111Map(List<String> deviceIds) {
return deviceIds.stream()
.filter(id -> id.endsWith(SUFFIX_85))
.filter(id -> id.endsWith(SUFFIX_85) || id.endsWith(SUFFIX_85_9003))
.collect(Collectors.toMap(
String::toLowerCase,
id -> (id.substring(0, id.length() - SUFFIX_85.length()) + SUFFIX_111)
.toLowerCase(),
id -> {
if (id.endsWith(SUFFIX_85_9003)) {
return (id.substring(0, id.length() - SUFFIX_85_9003.length()) + SUFFIX_111_9003)
.toLowerCase();
} else {
return (id.substring(0, id.length() - SUFFIX_85.length()) + SUFFIX_111)
.toLowerCase();
}
},
(a, b) -> b
));

Loading…
Cancel
Save