测量数据倒序排列

This commit is contained in:
liuchengqian 2022-03-07 20:19:32 +08:00
parent 3fcc427813
commit c698abfa11

View File

@ -3,6 +3,7 @@ package com.xkrs.util;
import com.xkrs.dao.DataSourceDao; import com.xkrs.dao.DataSourceDao;
import com.xkrs.model.entity.DataSource; import com.xkrs.model.entity.DataSource;
import org.apache.http.util.TextUtils; import org.apache.http.util.TextUtils;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification; import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -50,6 +51,6 @@ public class DataSourceQuery {
Predicate[] predicates = new Predicate[list.size()]; Predicate[] predicates = new Predicate[list.size()];
return criteriaBuilder.and(list.toArray(predicates)); return criteriaBuilder.and(list.toArray(predicates));
}; };
return dataSourceDao.findAll(specification); return dataSourceDao.findAll(specification, Sort.by(Sort.Direction.DESC, "id"));
} }
} }