From ad504bb31086e2489224333ce9563be1461b20d0 Mon Sep 17 00:00:00 2001 From: Junling Bu Date: Sun, 1 Apr 2018 15:49:15 +0800 Subject: [PATCH] =?UTF-8?q?fix[litemall-db]:=20=E6=9F=A5=E8=AF=A2=E7=9A=84?= =?UTF-8?q?=E5=95=86=E5=93=81=E8=AF=84=E8=AE=BA=E6=8C=89=E7=85=A7=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=97=B6=E9=97=B4=E9=99=8D=E5=BA=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../linlinjava/litemall/db/service/LitemallCommentService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallCommentService.java b/litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallCommentService.java index ed26972b..aa89432d 100644 --- a/litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallCommentService.java +++ b/litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallCommentService.java @@ -18,6 +18,7 @@ public class LitemallCommentService { public List queryGoodsByGid(Integer id, int offset, int limit) { LitemallCommentExample example = new LitemallCommentExample(); + example.setOrderByClause(LitemallComment.Column.addTime.desc()); example.or().andValueIdEqualTo(id).andTypeIdEqualTo((byte)0); PageHelper.startPage(offset, limit); return commentMapper.selectByExample(example); @@ -31,6 +32,7 @@ public class LitemallCommentService { public List query(Byte typeId, Integer valueId, Integer showType, Integer offset, Integer limit) { LitemallCommentExample example = new LitemallCommentExample(); + example.setOrderByClause(LitemallComment.Column.addTime.desc()); if(showType == 0) { example.or().andValueIdEqualTo(valueId).andTypeIdEqualTo(typeId); } @@ -70,6 +72,7 @@ public class LitemallCommentService { public List querySelective(String userId, String valueId, Integer page, Integer size, String sort, String order) { LitemallCommentExample example = new LitemallCommentExample(); + example.setOrderByClause(LitemallComment.Column.addTime.desc()); LitemallCommentExample.Criteria criteria = example.createCriteria(); if(!StringUtils.isEmpty(userId)){