尝试吧:
query.addCriteria(Criteria.where("modelId").ne("").ne(null));query.with(new Sort(new Order(Direction.DESC, "ct")));
多个字段排序:第一排序按照sort降序,第二排序按照ct降序
query.with(new Sort(new Order(Direction.DESC, "sort")).and(new Sort(Direction.DESC,"ct")));
尝试吧:
query.addCriteria(Criteria.where("modelId").ne("").ne(null));query.with(new Sort(new Order(Direction.DESC, "ct")));
多个字段排序:第一排序按照sort降序,第二排序按照ct降序
query.with(new Sort(new Order(Direction.DESC, "sort")).and(new Sort(Direction.DESC,"ct")));