Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
ad504bb3
Commit
ad504bb3
authored
Apr 01, 2018
by
Junling Bu
Browse files
fix[litemall-db]: 查询的商品评论按照添加时间降序。
parent
852d1cf7
Changes
1
Hide whitespace changes
Inline
Side-by-side
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallCommentService.java
View file @
ad504bb3
...
...
@@ -18,6 +18,7 @@ public class LitemallCommentService {
public
List
<
LitemallComment
>
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
<
LitemallComment
>
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
<
LitemallComment
>
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
)){
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment