From 0d74fd1c714e27389afbe8256476b8d06470c378 Mon Sep 17 00:00:00 2001 From: wenc000 <450292408@qq.com> Date: Fri, 30 Oct 2020 18:06:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BD=91=E6=A0=BC=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cm/plugin/map/service/IGridService.java | 18 ++++++++++++++++++ .../map/service/impl/GridServiceImpl.java | 18 ++++++++++++++++-- .../resources/mybatis/mapper/grid-mapper.xml | 11 +++++++++++ 3 files changed, 45 insertions(+), 2 deletions(-) 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}]} + +