新增网格方法

This commit is contained in:
wenc000 2020-10-30 18:06:53 +08:00
parent 3ddf96bd4c
commit 0d74fd1c71
3 changed files with 45 additions and 2 deletions

View File

@ -74,6 +74,24 @@ public interface IGridService {
*/
List<GridRelationDTO> listGridRelationByRelationIds(List<String> relationIds) throws SearchException;
/**
* 获取网格关系列表
*
* @param gridId 网格ID
* @return
* @throws SearchException
*/
List<GridRelationDTO> listGridRelationByGridId(String gridId) throws SearchException;
/**
* 获取网格关系列表
*
* @param gridIds 网格ID列表
* @return
* @throws SearchException
*/
List<GridRelationDTO> listGridRelationByGridIds(List<String> gridIds) throws SearchException;
/**
* 获取网格列表
*

View File

@ -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<String> 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<GridRelationDTO> listGridRelationByGridId(String gridId) throws SearchException {
Map<String, Object> params = getHashMap(2);
params.put("gridId", gridId);
return gridDao.listGridRelation(params);
}
@Override
public List<GridRelationDTO> listGridRelationByGridIds(List<String> gridIds) throws SearchException {
Map<String, Object> params = getHashMap(2);
params.put("gridIds", gridIds);
return gridDao.listGridRelation(params);
}
@Override
public List<GridDTO> listGridByRelationId(String relationId) throws SearchException {
List<GridDTO> gridDTOs = gridDao.listGridByRelationId(relationId);

View File

@ -138,6 +138,17 @@
#{relationIds[${index}]}
</foreach>
</if>
<if test="gridId != null and gridId != ''">
AND
grid_id = #{gridId}
</if>
<if test="gridIds != null and gridIds.size > 0">
AND
grid_id IN
<foreach collection="gridIds" index="index" open="(" separator="," close=")">
#{gridIds[${index}]}
</foreach>
</if>
</select>
<!-- 获取网格列表通过关联ID -->