|
|
@@ -55,6 +55,7 @@ public class ASimplifiedHouseInfoServiceImpl extends ServiceImpl<ASimplifiedHous
|
|
|
@Override
|
|
|
public Page<ASimplifiedHouseInfoVo> getListPage(ASimplifiedHouseInfoDto entity) {
|
|
|
int offset = 0;
|
|
|
+ String sortClause = null;
|
|
|
// 计算偏移量
|
|
|
if (entity.getPageNum() != null && entity.getPageSize() != null) {
|
|
|
offset = (entity.getPageNum() - 1) * entity.getPageSize();
|
|
|
@@ -65,13 +66,21 @@ public class ASimplifiedHouseInfoServiceImpl extends ServiceImpl<ASimplifiedHous
|
|
|
entity.getPageNum() != null ? entity.getPageNum() : 1,
|
|
|
entity.getPageSize() != null ? entity.getPageSize() : 10
|
|
|
);
|
|
|
-
|
|
|
+ if (entity.getSortSearch() != null) {
|
|
|
+ switch (entity.getSortSearch()) {
|
|
|
+ case "1": sortClause = "a.rent_range DESC"; break;
|
|
|
+ case "2": sortClause = "a.rent_range ASC"; break;
|
|
|
+ case "3": sortClause = "b.area DESC"; break;
|
|
|
+ case "4": sortClause = "b.area ASC"; break;
|
|
|
+ default: sortClause = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
// 执行查询
|
|
|
- List<ASimplifiedHouseInfoVo> list = houseInfoMapper.getListPage(entity,offset,entity.getPageSize());
|
|
|
+ List<ASimplifiedHouseInfoVo> list = houseInfoMapper.getListPage(entity,offset,entity.getPageSize(),sortClause);
|
|
|
|
|
|
// 设置分页数据
|
|
|
page.setRecords(list);
|
|
|
- page.setTotal(houseInfoMapper.getListPage(entity,offset,entity.getPageSize()).size());
|
|
|
+ page.setTotal(houseInfoMapper.getListPage(entity,offset,entity.getPageSize(),sortClause).size());
|
|
|
|
|
|
return page;
|
|
|
}
|