Commit 87d76c81 authored by 周健威's avatar 周健威

修改代码

parent 01e750c9
...@@ -12,9 +12,14 @@ import lombok.Data; ...@@ -12,9 +12,14 @@ import lombok.Data;
@Data @Data
public class ImageInformationDto extends PageParam { public class ImageInformationDto extends PageParam {
public static final int SORT_TYPE_ASC = 1;
public static final int SORT_TYPE_DESC = 2;
String name; String name;
Integer status; Integer status;
Integer indexShow; Integer indexShow;
Integer sortType;
} }
...@@ -70,6 +70,13 @@ public class ImageInformationBiz extends BaseBiz<ImageInformationMapper, ImageIn ...@@ -70,6 +70,13 @@ public class ImageInformationBiz extends BaseBiz<ImageInformationMapper, ImageIn
if (imageInformationDto.getIndexShow() != null) { if (imageInformationDto.getIndexShow() != null) {
criteria.andEqualTo("indexShow", imageInformationDto.getIndexShow()); criteria.andEqualTo("indexShow", imageInformationDto.getIndexShow());
} }
if (imageInformationDto.getSortType() != null) {
if(ImageInformationDto.SORT_TYPE_ASC == imageInformationDto.getSortType()) {
example.orderBy("rank").asc();
}else {
example.orderBy("rank").desc();
}
}
example.orderBy("updTime").desc(); example.orderBy("updTime").desc();
Query query = new Query(imageInformationDto); Query query = new Query(imageInformationDto);
PageDataVO<ImageInformation> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.selectByExample(example)); PageDataVO<ImageInformation> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.selectByExample(example));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment