Commit c428f82e9505f0f6aebe318e115c2bb7fe640cfd

Authored by 黄 x
1 parent 6049cb16

feat: add return column device_profile_id for master devices and slave devices

... ... @@ -19,4 +19,7 @@ public class SelectItemDTO {
19 19
20 20 @ApiModelProperty("设备类型")
21 21 private DeviceTypeEnum deviceType;
  22 +
  23 + @ApiModelProperty("设备配置ID")
  24 + private String deviceProfileId;
22 25 }
... ...
... ... @@ -45,7 +45,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev
45 45
46 46 private final DeviceProfileDao deviceProfileDao;
47 47
48   - private final OrganizationMapper ytOrganizationMapper;
  48 + private final OrganizationMapper tkOrganizationMapper;
49 49 private final SceneLinkageMapper sceneLinkageMapper;
50 50 private final TriggerMapper triggerMapper;
51 51 private final DoConditionMapper conditionMapper;
... ... @@ -128,7 +128,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev
128 128 DeviceProfile deviceProfile =
129 129 deviceProfileDao.findById(id, UUID.fromString(deviceDTO.getProfileId()));
130 130 TkOrganizationEntity organization =
131   - ytOrganizationMapper.selectById(deviceDTO.getOrganizationId());
  131 + tkOrganizationMapper.selectById(deviceDTO.getOrganizationId());
132 132 if (null == deviceProfile || null == organization) {
133 133 throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage());
134 134 } else if (!organization.getTenantId().equals(deviceTenantId)) {
... ... @@ -347,7 +347,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev
347 347 }
348 348 // 查询该组织的所有子类
349 349 List<OrganizationDTO> organizationDTOS =
350   - ytOrganizationMapper.findOrganizationTreeList(tenantId, organizationIds);
  350 + tkOrganizationMapper.findOrganizationTreeList(tenantId, organizationIds);
351 351 List<String> queryOrganizationIds = new ArrayList<>();
352 352 organizationDTOS.forEach(item -> queryOrganizationIds.add(item.getId()));
353 353 return queryOrganizationIds;
... ...
... ... @@ -331,7 +331,7 @@
331 331
332 332 <select id="masterDevices" resultMap="listInform">
333 333 SELECT
334   - base.tb_device_id as id,base.name,base.device_type
  334 + base.tb_device_id as id,base.name,base.device_type,base.device_profile_id
335 335 FROM tk_device base
336 336 LEFT JOIN device tde ON tde.ID :: TEXT = base.tb_device_id
337 337 <where>
... ... @@ -356,7 +356,7 @@
356 356
357 357 <select id="slaveDevices" resultMap="listInform">
358 358 SELECT
359   - ide.tb_device_id as id,ide.name,ide.device_type
  359 + ide.tb_device_id as id,ide.name,ide.device_type,ide.device_profile_id
360 360 FROM (select * from relation where relation_type_group = 'COMMON' AND relation_type = 'Created' AND from_type = 'DEVICE' AND to_type = 'DEVICE'
361 361 <if test="masterId !=null and masterId !=''">
362 362 AND from_id :: TEXT = #{masterId}
... ...