Commit 7be8b2df1efbb39fb15d2f0a6743321d53ba71de

Authored by 云中非
1 parent 2926ea7a

refactor: 设备分页数据返回客户信息

... ... @@ -64,6 +64,7 @@ public class DeviceDTO extends TenantDTO {
64 64
65 65 @ApiModelProperty(value = "分配客户")
66 66 private String customerId;
  67 + private String customerName;
67 68
68 69 private DeviceProfileDTO deviceProfile;
69 70 private OrganizationDTO organizationDTO;
... ...
... ... @@ -25,6 +25,7 @@
25 25 <result property="updater" column="updater"/>
26 26 <result property="description" column="description"/>
27 27 <result property="customerId" column="customer_id"/>
  28 + <result property="customerName" column="cusotomer_name"/>
28 29 <result property="organizationId" column="organization_id"/>
29 30 <result property="gatewayId" column="gateway_id"/>
30 31 <result property="gatewayName" column="gateway_name"/>
... ... @@ -72,7 +73,7 @@
72 73 </sql>
73 74 <select id="getDevicePage" resultMap="deviceMap">
74 75 SELECT
75   - <include refid="pageColumns"/>,d.customer_id::TEXT AS customer_id
  76 + <include refid="pageColumns"/>,d.customer_id::TEXT AS customer_id,cus.title AS cusotomer_name
76 77 FROM iotfs_device ifd
77 78 LEFT JOIN device_profile ifdp ON ifd.profile_id = ifdp.id::TEXT
78 79 LEFT JOIN iotfs_organization io ON io.id = ifd.organization_id
... ... @@ -83,6 +84,7 @@
83 84 LEFT JOIN attribute_kv c ON ifd.tb_device_id = c.entity_id::TEXT AND c.entity_type ='DEVICE' AND
84 85 c.attribute_key='inactivityAlarmTime'
85 86 LEFT JOIN device d ON d.id::TEXT = ifd.tb_device_id
  87 + LEFT JOIN customer cus ON cus.id = d.customer_id
86 88 <where>
87 89 <if test="queryMap.tenantId !=null and queryMap.tenantId !=''">
88 90 AND ifd.tenant_id = #{queryMap.tenantId}
... ...