Commit 48a74123 authored by luben's avatar luben

fix

parent 4d5ab03b
...@@ -19,8 +19,8 @@ public class MapEntityController extends BaseController { ...@@ -19,8 +19,8 @@ public class MapEntityController extends BaseController {
@RequestMapping(value = "/getAllMapEntities",method = RequestMethod.GET) @RequestMapping(value = "/getAllMapEntities",method = RequestMethod.GET)
@ResponseBody @ResponseBody
public List<MapEntity> getAllMapEntities() { public List<MapEntity> getAllMapEntities(@RequestParam(name = "level") String level) {
return mapEntityService.getAllMapEntities(); return mapEntityService.getAllMapEntitiesByLevel(level);
} }
@RequestMapping(value = "/getMapEntityById",method = RequestMethod.GET) @RequestMapping(value = "/getMapEntityById",method = RequestMethod.GET)
......
...@@ -6,7 +6,7 @@ import java.util.List; ...@@ -6,7 +6,7 @@ import java.util.List;
public interface MapEntityService { public interface MapEntityService {
// 获取所有实体 // 获取所有实体
List<MapEntity> getAllMapEntities(); List<MapEntity> getAllMapEntitiesByLevel(String level);
// 根据 ID 获取实体 // 根据 ID 获取实体
MapEntity getMapEntityById(String id); MapEntity getMapEntityById(String id);
// 更新实体 // 更新实体
......
package com.ruoyi.system.service.other.impl; package com.ruoyi.system.service.other.impl;
import cn.hutool.core.lang.UUID; import cn.hutool.core.lang.UUID;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.system.domain.other.MapEntity; import com.ruoyi.system.domain.other.MapEntity;
import com.ruoyi.system.mapper.other.MapEntityMapper; import com.ruoyi.system.mapper.other.MapEntityMapper;
import com.ruoyi.system.service.other.MapEntityService; import com.ruoyi.system.service.other.MapEntityService;
...@@ -16,8 +17,12 @@ public class MapEntityServiceImpl implements MapEntityService { ...@@ -16,8 +17,12 @@ public class MapEntityServiceImpl implements MapEntityService {
private MapEntityMapper mapEntityMapper; private MapEntityMapper mapEntityMapper;
@Override @Override
public List<MapEntity> getAllMapEntities() { public List<MapEntity> getAllMapEntitiesByLevel(String level) {
return mapEntityMapper.selectList(null); QueryWrapper<MapEntity> queryWrapper = new QueryWrapper<>();
if(level!=null&& !level.isEmpty()){
queryWrapper.eq("entity_level", level);
}
return mapEntityMapper.selectList(queryWrapper);
} }
@Override @Override
......
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