From a49a6a80a76b2642232b887dd646a255cf5eaa4e Mon Sep 17 00:00:00 2001
From: liuhaonan <31457034@qq.com>
Date: 星期五, 12 八月 2022 18:16:01 +0800
Subject: [PATCH] changes
---
ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightReportDataService.java | 32 +++++++++++++++++++++++++++++---
1 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightReportDataService.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightReportDataService.java
index 7aa4294..1fe87b3 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightReportDataService.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightReportDataService.java
@@ -21,6 +21,7 @@
import com.sandu.ximon.dao.domain.LightReportData;
import com.sandu.ximon.dao.domain.Pole;
import com.sandu.ximon.dao.domain.PoleBinding;
+import com.sandu.ximon.dao.enums.OrderByEnums;
import com.sandu.ximon.dao.mapper.LightReportDataMapper;
import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
@@ -94,11 +95,36 @@
* @param keyword 鍏抽敭璇�
* @param deviceCode 璁惧鐮�
*/
- public CommonPage listReportData(int pageNo, int pageSize, String keyword, String deviceCode) {
+ public CommonPage listReportData(int pageNo, int pageSize, String keyword, String deviceCode,Integer order,Integer seq) {
List<LightReportDataBo> lightReportDataBos = new ArrayList<>(pageSize);
-
- CommonPage<String> stringCommonPage = SpringContextHolder.getBean(LightService.class).listDeviceCode(pageNo, pageSize, keyword, deviceCode);
+ //鎺掑簭瀛楁
+ String orderByResult = "t1.create_time";
+ //姝e簭銆佸�掑彊
+ String orderBySeq = OrderByEnums.ASC.getCode();
+ if (order != null) {
+ switch (order) {
+ case 1:
+ orderByResult = OrderByEnums.LIGHT_DATA_CREATE_TIME.getCode();
+ break;
+ default:
+ }
+ }
+ if (seq != null) {
+ switch (seq) {
+ case 1:
+ orderBySeq = " ASC";
+ break;
+ case 2:
+ orderBySeq = " DESC";
+ break;
+ default:
+ break;
+ }
+ }
+ //鎺掑簭鏂瑰紡
+ String orderBy = orderByResult + " " + orderBySeq;
+ CommonPage<String> stringCommonPage = SpringContextHolder.getBean(LightService.class).listDeviceCode(pageNo, pageSize, keyword, deviceCode,orderBy);
List<String> macList = stringCommonPage.getList();
if (CollUtil.isEmpty(macList)) {
return new CommonPage();
--
Gitblit v1.9.3