|
|
@@ -67,6 +67,11 @@ public class PlaceBaseInfoController {
|
|
|
|
|
|
Page<PlaceBaseInfo> resultData = this.placeBaseInfoService.page(page, wrapper);
|
|
|
|
|
|
+ for (PlaceBaseInfo baseInfo : resultData.getRecords()) {
|
|
|
+ PlaceCategory category = this.placeCategoryService.getById(baseInfo.getCategoryId());
|
|
|
+ baseInfo.setCategory(category);
|
|
|
+ }
|
|
|
+
|
|
|
return Result.instance(Result.Code.SUCCESS).setData(resultData);
|
|
|
}
|
|
|
|
|
|
@@ -200,4 +205,35 @@ public class PlaceBaseInfoController {
|
|
|
|
|
|
return Result.instance(Result.Code.SUCCESS).setData(listData);
|
|
|
}
|
|
|
+
|
|
|
+ @ResponseBody
|
|
|
+ @PostMapping("/findSelectByKeyword")
|
|
|
+ public Result findSelectBaseInfoByKeyword(String keyword) throws Exception {
|
|
|
+ QueryWrapper<PlaceBaseInfo> queryWrapper = new QueryWrapper<>();
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(keyword)) {
|
|
|
+ queryWrapper.like("id", keyword);
|
|
|
+ queryWrapper.or();
|
|
|
+ queryWrapper.like("name", keyword);
|
|
|
+ queryWrapper.or();
|
|
|
+ queryWrapper.like("brief", keyword);
|
|
|
+ queryWrapper.or();
|
|
|
+ queryWrapper.like("address", keyword);
|
|
|
+ queryWrapper.or();
|
|
|
+ queryWrapper.like("contacts", keyword);
|
|
|
+ queryWrapper.or();
|
|
|
+ queryWrapper.like("contact_number", keyword);
|
|
|
+ queryWrapper.or();
|
|
|
+ queryWrapper.inSql("category_id", "select id from place_category where name like '%" + keyword + "%'");
|
|
|
+ }
|
|
|
+ queryWrapper.last("limit 10");
|
|
|
+ queryWrapper.orderByDesc("id");
|
|
|
+
|
|
|
+ List<PlaceBaseInfo> listData = this.placeBaseInfoService.list(queryWrapper);
|
|
|
+ for (PlaceBaseInfo baseInfo : listData) {
|
|
|
+ PlaceCategory category = this.placeCategoryService.getById(baseInfo.getCategoryId());
|
|
|
+ baseInfo.setCategory(category);
|
|
|
+ }
|
|
|
+ return Result.instance(Result.Code.SUCCESS).setData(listData);
|
|
|
+ }
|
|
|
}
|