From c698abfa1173459a713b7999e3cd95b7dca45dfb Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Mon, 7 Mar 2022 20:19:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E9=87=8F=E6=95=B0=E6=8D=AE=E5=80=92?= =?UTF-8?q?=E5=BA=8F=E6=8E=92=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/xkrs/util/DataSourceQuery.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/xkrs/util/DataSourceQuery.java b/src/main/java/com/xkrs/util/DataSourceQuery.java index 18f5e4c..c982332 100644 --- a/src/main/java/com/xkrs/util/DataSourceQuery.java +++ b/src/main/java/com/xkrs/util/DataSourceQuery.java @@ -3,6 +3,7 @@ package com.xkrs.util; import com.xkrs.dao.DataSourceDao; import com.xkrs.model.entity.DataSource; import org.apache.http.util.TextUtils; +import org.springframework.data.domain.Sort; import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Component; @@ -50,6 +51,6 @@ public class DataSourceQuery { Predicate[] predicates = new Predicate[list.size()]; return criteriaBuilder.and(list.toArray(predicates)); }; - return dataSourceDao.findAll(specification); + return dataSourceDao.findAll(specification, Sort.by(Sort.Direction.DESC, "id")); } }