Commit 9ddceb83010fb032c5757d063b1b362334c22f04

Authored by 云中非
1 parent ec3e0a54

fix(DEFECT-945): 设备下拉选项返回别名

@@ -16,6 +16,8 @@ public class SelectItemDTO { @@ -16,6 +16,8 @@ public class SelectItemDTO {
16 16
17 @ApiModelProperty("下拉选项名") 17 @ApiModelProperty("下拉选项名")
18 private String name; 18 private String name;
  19 + @ApiModelProperty("下拉选项别名")
  20 + private String alias;
19 21
20 @ApiModelProperty("设备类型") 22 @ApiModelProperty("设备类型")
21 private DeviceTypeEnum deviceType; 23 private DeviceTypeEnum deviceType;
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 <resultMap type="org.thingsboard.server.common.data.yunteng.dto.SelectItemDTO" id="listInform"> 5 <resultMap type="org.thingsboard.server.common.data.yunteng.dto.SelectItemDTO" id="listInform">
6 <result property="id" column="id"/> 6 <result property="id" column="id"/>
7 <result property="name" column="name"/> 7 <result property="name" column="name"/>
  8 + <result property="alias" column="alias"/>
8 <result property="deviceType" column="device_type" typeHandler="org.apache.ibatis.type.EnumTypeHandler"/> 9 <result property="deviceType" column="device_type" typeHandler="org.apache.ibatis.type.EnumTypeHandler"/>
9 </resultMap> 10 </resultMap>
10 <resultMap type="org.thingsboard.server.common.data.yunteng.dto.DeviceDTO" id="deviceMap"> 11 <resultMap type="org.thingsboard.server.common.data.yunteng.dto.DeviceDTO" id="deviceMap">
@@ -336,7 +337,7 @@ @@ -336,7 +337,7 @@
336 337
337 <select id="masterDevices" resultMap="listInform"> 338 <select id="masterDevices" resultMap="listInform">
338 SELECT 339 SELECT
339 - base.tb_device_id as id,base.name,base.device_type,base.device_profile_id 340 + base.tb_device_id as id,base.name,base.alias,base.device_type,base.device_profile_id
340 FROM tk_device base 341 FROM tk_device base
341 LEFT JOIN device tde ON tde.ID :: TEXT = base.tb_device_id 342 LEFT JOIN device tde ON tde.ID :: TEXT = base.tb_device_id
342 <where> 343 <where>
@@ -361,7 +362,7 @@ @@ -361,7 +362,7 @@
361 362
362 <select id="slaveDevices" resultMap="listInform"> 363 <select id="slaveDevices" resultMap="listInform">
363 SELECT 364 SELECT
364 - ide.tb_device_id as id,ide.name,ide.device_type,ide.device_profile_id 365 + ide.tb_device_id as id,ide.name,base.alias,ide.device_type,ide.device_profile_id
365 FROM (select * from relation where relation_type_group = 'COMMON' AND relation_type = 'Created' AND from_type = 'DEVICE' AND to_type = 'DEVICE' 366 FROM (select * from relation where relation_type_group = 'COMMON' AND relation_type = 'Created' AND from_type = 'DEVICE' AND to_type = 'DEVICE'
366 <if test="masterId !=null and masterId !=''"> 367 <if test="masterId !=null and masterId !=''">
367 AND from_id :: TEXT = #{masterId} 368 AND from_id :: TEXT = #{masterId}