Commit ff58bcc0459eb247ff3b7aa53bd1cb357fe7ea3e
1 parent
f994227607
Exists in
master
and in
6 other branches
体重管理
Showing 1 changed file with 2 additions and 2 deletions
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/TempService.java
View file @
ff58bcc
... | ... | @@ -11,6 +11,7 @@ |
11 | 11 | import org.slf4j.Logger; |
12 | 12 | import org.slf4j.LoggerFactory; |
13 | 13 | import org.springframework.beans.factory.annotation.Autowired; |
14 | +import org.springframework.data.domain.Sort; | |
14 | 15 | import org.springframework.stereotype.Service; |
15 | 16 | |
16 | 17 | import java.util.Date; |
17 | 18 | |
... | ... | @@ -41,14 +42,13 @@ |
41 | 42 | target.setModified(new Date()); |
42 | 43 | return tempDao.addOneTemp(target); |
43 | 44 | } |
44 | - | |
45 | 45 | public List<TempModel> queryTemp(TempQuery tempQuery) { |
46 | 46 | MongoQuery mongoQuery = tempQuery.convertToQuery(); |
47 | 47 | if (StringUtils.isNotEmpty(tempQuery.getNeed())) { |
48 | 48 | tempQuery.mysqlBuild(tempDao.queryTempModelCount(mongoQuery)); |
49 | 49 | mongoQuery.start(tempQuery.getOffset()).end(tempQuery.getLimit()); |
50 | 50 | } |
51 | - return tempDao.findByCondion(mongoQuery); | |
51 | + return tempDao.findByCondion(mongoQuery.addOrder(Sort.Direction.DESC, "modified")); | |
52 | 52 | } |
53 | 53 | |
54 | 54 | public void update(TempModel temp,String id){ |