diff --git a/cloud-common-plugin-map/src/main/java/com/cm/plugin/map/service/IGridService.java b/cloud-common-plugin-map/src/main/java/com/cm/plugin/map/service/IGridService.java index 083f95f..90c96bd 100644 --- a/cloud-common-plugin-map/src/main/java/com/cm/plugin/map/service/IGridService.java +++ b/cloud-common-plugin-map/src/main/java/com/cm/plugin/map/service/IGridService.java @@ -74,6 +74,24 @@ public interface IGridService { */ List listGridRelationByRelationIds(List relationIds) throws SearchException; + /** + * 获取网格关系列表 + * + * @param gridId 网格ID + * @return + * @throws SearchException + */ + List listGridRelationByGridId(String gridId) throws SearchException; + + /** + * 获取网格关系列表 + * + * @param gridIds 网格ID列表 + * @return + * @throws SearchException + */ + List listGridRelationByGridIds(List gridIds) throws SearchException; + /** * 获取网格列表 * diff --git a/cloud-common-plugin-map/src/main/java/com/cm/plugin/map/service/impl/GridServiceImpl.java b/cloud-common-plugin-map/src/main/java/com/cm/plugin/map/service/impl/GridServiceImpl.java index 0745f3e..08d2ac3 100644 --- a/cloud-common-plugin-map/src/main/java/com/cm/plugin/map/service/impl/GridServiceImpl.java +++ b/cloud-common-plugin-map/src/main/java/com/cm/plugin/map/service/impl/GridServiceImpl.java @@ -60,7 +60,7 @@ public class GridServiceImpl extends AbstractService implements IGridService { params.put("gridId", gridId); gridDao.deleteGridPoint(params); // 新增网格数组 - for(GridPointVO gridPointVO : pointArray) { + for (GridPointVO gridPointVO : pointArray) { params = HashMapUtil.beanToMap(gridPointVO); params.put("gridId", gridId); gridDao.saveGridPoint(params); @@ -91,7 +91,7 @@ public class GridServiceImpl extends AbstractService implements IGridService { @Override public void deleteGridByGridIds(List gridIds) throws RemoveException { - if(gridIds.isEmpty()) { + if (gridIds.isEmpty()) { return; } // 删除网格 @@ -118,6 +118,20 @@ public class GridServiceImpl extends AbstractService implements IGridService { return gridDao.listGridRelation(params); } + @Override + public List listGridRelationByGridId(String gridId) throws SearchException { + Map params = getHashMap(2); + params.put("gridId", gridId); + return gridDao.listGridRelation(params); + } + + @Override + public List listGridRelationByGridIds(List gridIds) throws SearchException { + Map params = getHashMap(2); + params.put("gridIds", gridIds); + return gridDao.listGridRelation(params); + } + @Override public List listGridByRelationId(String relationId) throws SearchException { List gridDTOs = gridDao.listGridByRelationId(relationId); diff --git a/cloud-common-plugin-map/src/main/resources/mybatis/mapper/grid-mapper.xml b/cloud-common-plugin-map/src/main/resources/mybatis/mapper/grid-mapper.xml index 74d199d..9377481 100644 --- a/cloud-common-plugin-map/src/main/resources/mybatis/mapper/grid-mapper.xml +++ b/cloud-common-plugin-map/src/main/resources/mybatis/mapper/grid-mapper.xml @@ -138,6 +138,17 @@ #{relationIds[${index}]} + + AND + grid_id = #{gridId} + + + AND + grid_id IN + + #{gridIds[${index}]} + +