Commit 0165f0b14713e54f7666d4b1f9c49bf20919c730

Authored by xp.Huang
1 parent b1ccf0e9

refactor: 移除小程序、app首页的消息统计查询,后续需要重新封装查询

... ... @@ -266,11 +266,6 @@ public class TkHomePageServiceImpl implements HomePageService {
266 266 app.setTodayCustomer(today);
267 267 }
268 268
269   - if (!isPtSysAdmin && !isPtAdmin) {
270   - app.setTotalMsg(getFlowStatistics(totalFilter));
271   - app.setTodayMsg(getFlowStatistics(todayFilter));
272   - }
273   -
274 269 List<DeviceDTO> devices = getDeviceInfo(todayFilter);
275 270 AtomicInteger totalOnline = new AtomicInteger();
276 271 AtomicInteger totalOffline = new AtomicInteger();
... ... @@ -386,17 +381,6 @@ public class TkHomePageServiceImpl implements HomePageService {
386 381 return statistics;
387 382 }
388 383
389   - /**
390   - * 获取实体的流量统计信息
391   - *
392   - * @param filter 数据过滤参数
393   - */
394   - private FlowStatisticsDTO getFlowStatistics(Map<String, Object> filter) {
395   - FlowStatisticsDTO flow = new FlowStatisticsDTO(0);
396   - flow.setMessage(deviceMapper.countMsgs(filter));
397   - flow.setDataPoints(deviceMapper.countDataPoints(filter));
398   - return flow;
399   - }
400 384
401 385 @Override
402 386 public TkPageData<TenantDTO> getHomePageRightInfo(Map<String, Object> queryMap) {
... ...
... ... @@ -80,10 +80,6 @@ public interface DeviceMapper extends BaseMapper<TkDeviceEntity> {
80 80 @Param("startTime") Long startTime,
81 81 @Param("endTime") Long endTime);
82 82
83   - Integer countMsgs(@Param("queryMap") Map<String, Object> queryMap);
84   -
85   - Integer countDataPoints(@Param("queryMap") Map<String, Object> queryMap);
86   -
87 83 /**
88 84 * 主设备列表
89 85 *
... ...
... ... @@ -308,44 +308,6 @@
308 308 AND originator_type = 5;
309 309 </select>
310 310
311   - <select id="countMsgs" resultType="int">
312   - SELECT COUNT(1) FROM ts_kv v LEFT JOIN device d ON d.id = v.entity_id
313   - <where>
314   - 1=1
315   - <if test="queryMap.tenantId !=null">
316   - AND d.tenant_id= #{queryMap.tenantId}::uuid
317   - </if>
318   - <if test="queryMap.customerId !=null">
319   - AND d.customer_id= #{queryMap.customerId}::uuid
320   - </if>
321   - <if test="queryMap.startTime !=null">
322   - AND v.ts >= #{queryMap.startTime}
323   - </if>
324   - <if test="queryMap.endTime !=null">
325   - AND v.ts &lt; #{queryMap.endTime}
326   - </if>
327   - </where>
328   - </select>
329   -
330   - <select id="countDataPoints" resultType="int">
331   - SELECT COUNT(DISTINCT v.key) FROM ts_kv v LEFT JOIN device d ON d.id = v.entity_id
332   - <where>
333   - 1=1
334   - <if test="queryMap.tenantId !=null">
335   - AND tenant_id= #{queryMap.tenantId}::uuid
336   - </if>
337   - <if test="queryMap.customerId !=null">
338   - AND customer_id= #{queryMap.customerId}::uuid
339   - </if>
340   - <if test="queryMap.startTime !=null">
341   - AND ts >= #{queryMap.startTime}
342   - </if>
343   - <if test="queryMap.endTime !=null">
344   - AND ts &lt; #{queryMap.endTime}
345   - </if>
346   - </where>
347   - </select>
348   -
349 311 <select id="masterDevices" resultMap="listInform">
350 312 SELECT
351 313 base.tb_device_id as id,base.name,base.alias,base.device_type,base.device_profile_id
... ...