Commit 0fe95dae authored by luben's avatar luben

fix

parent 68081979
...@@ -914,4 +914,21 @@ public class RegionController extends BaseController { ...@@ -914,4 +914,21 @@ public class RegionController extends BaseController {
return AjaxResult.success(gridRegionMapper.changeTreeNodeNameByCode(id,name)); return AjaxResult.success(gridRegionMapper.changeTreeNodeNameByCode(id,name));
} }
@RequestMapping(value = "/getRegion", method = RequestMethod.GET)
@ResponseBody
public AjaxResult getRegion(@RequestParam("wgCode") String wgCode) {
Map<String,List<GridRegion>> res = new HashMap<>();
List<GridRegion> type1 = gridRegionService.getGridRegionMapByWgCodeAndWgType(wgCode,"1");
List<GridRegion> type4 = gridRegionService.getGridRegionMapByWgCodeAndWgType(wgCode,"4");
List<GridRegion> type5 = gridRegionService.getGridRegionMapByWgCodeAndWgType(wgCode,"5");
List<GridRegion> type6 = gridRegionService.getGridRegionMapByWgCodeAndWgType(wgCode,"6");
List<GridRegion> type7 = gridRegionService.getGridRegionMapByWgCodeAndWgType(wgCode,"7");
res.put("1",type1);
res.put("4",type4);
res.put("5",type5);
res.put("6",type6);
res.put("7",type7);
return AjaxResult.success(res);
}
} }
...@@ -39,4 +39,6 @@ public interface GridRegionService extends BaseService<GridRegion, GridRegionExa ...@@ -39,4 +39,6 @@ public interface GridRegionService extends BaseService<GridRegion, GridRegionExa
List<GridRegion> getByParams(GridRegionSearchParam searchParam); List<GridRegion> getByParams(GridRegionSearchParam searchParam);
List<GridRegion> getGridRegionMapByWgType(String wgType); List<GridRegion> getGridRegionMapByWgType(String wgType);
List<GridRegion> getGridRegionMapByWgCodeAndWgType(String wgCode,String wgType);
} }
...@@ -15,10 +15,7 @@ import org.slf4j.LoggerFactory; ...@@ -15,10 +15,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -176,4 +173,15 @@ public class GridRegionServiceImpl extends BaseServiceImpl<GridRegionMapper, Gri ...@@ -176,4 +173,15 @@ public class GridRegionServiceImpl extends BaseServiceImpl<GridRegionMapper, Gri
return gridRegionService.selectByExample(ex); return gridRegionService.selectByExample(ex);
} }
@Override
public List<GridRegion> getGridRegionMapByWgCodeAndWgType(String wgCode, String wgType) {
GridRegionExample example = new GridRegionExample();
GridRegionExample.Criteria criteria = example.createCriteria();
criteria.andIsValidEqualTo("1");
criteria.andWgTypeEqualTo(wgType);
criteria.andWgCodeNotEqualTo(wgCode);
criteria.andWgCodeLike("%"+wgCode+"%");
return gridRegionMapper.selectByExampleWithBLOBs(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