Commit 03c33d75 authored by libin's avatar libin

营地排序

parent 4f460617
......@@ -205,15 +205,16 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
List<String> tagNames = shopIdOfTagsMap.get(campsiteShopAdminPageDTO.getId());
campsiteShopAdminPageDTO.setStoreTypeName(tagNames == null ? new ArrayList<String>() : tagNames);
}
}).sorted(Comparator.comparing(CampsiteShopAdminPageDTO::getHot).reversed().thenComparing(CampsiteShopAdminPageDTO::getCrtTime).reversed()).collect(Collectors.toList());
}).collect(Collectors.toList());
List<CampsiteShopAdminPageVo> campsiteShopAdminPageVos = JSONObject.parseObject(JSONObject.toJSONString(campsiteShopAdminPageDTOS), new TypeReference<List<CampsiteShopAdminPageVo>>() {
});
campsiteShopAdminPageVos.sort(Comparator.comparing(CampsiteShopAdminPageVo::getHot).reversed().thenComparing(Comparator.comparing(CampsiteShopAdminPageVo::getCrtTime).reversed()));
//组装数据
campsiteShopAdminPageDataVos.setTotalPage(campsiteShopAdminpageDTOPageDataVO.getTotalPage());
campsiteShopAdminPageDataVos.setTotalCount(campsiteShopAdminpageDTOPageDataVO.getTotalCount());
campsiteShopAdminPageDataVos.setPageSize(campsiteShopAdminpageDTOPageDataVO.getPageSize());
campsiteShopAdminPageDataVos.setPageNum(campsiteShopAdminpageDTOPageDataVO.getPageNum());
campsiteShopAdminPageDataVos.setData(JSONObject.parseObject(JSONObject.toJSONString(campsiteShopAdminPageDTOS), new TypeReference<List<CampsiteShopAdminPageVo>>() {
}));
campsiteShopAdminPageDataVos.setData(campsiteShopAdminPageVos);
return campsiteShopAdminPageDataVos;
}
......
......@@ -44,7 +44,7 @@
where cs.sale_state=1 and cs.is_del=0
<if test="typeId!=null">
and cst.tag_id=#{typeId}
</if> order by `crtTime` DESC
</if> order by `hot`DESC,`crt_time` DESC
</select>
<!--首页查询全部-->
......@@ -79,7 +79,7 @@
<if test="name != null and name != ''">
and `name` like concat('%',#{name},'%')
</if>
ORDER BY `hot` DESC
</select>
<!--根据id更新营地状态-->
......
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