23 changed files with 906 additions and 38 deletions
@ -0,0 +1,56 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 北上诉办GIS坐标系统 |
||||
|
* |
||||
|
* @author zhy qu@elink-cn.com |
||||
|
* @since v1.0.0 2022-09-04 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GisFormDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 网格编码 |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 网格名称 |
||||
|
*/ |
||||
|
private String gridName; |
||||
|
|
||||
|
/** |
||||
|
* 经度 |
||||
|
*/ |
||||
|
private String longitude; |
||||
|
|
||||
|
/** |
||||
|
* 纬度 |
||||
|
*/ |
||||
|
private String latitude; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,91 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.dto; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* gis地图网格与平台网格对应关系表 |
||||
|
* |
||||
|
* @author zhy elink@elink-cn.com |
||||
|
* @since v1.0.0 2022-09-05 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GisGridDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* ID |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private Long gridId; |
||||
|
|
||||
|
/** |
||||
|
* 网格名称 |
||||
|
*/ |
||||
|
private String gridName; |
||||
|
|
||||
|
/** |
||||
|
* gis地图网格ID |
||||
|
*/ |
||||
|
private String gisGridId; |
||||
|
|
||||
|
/** |
||||
|
* gis地图网格名称 |
||||
|
*/ |
||||
|
private String gisGridName; |
||||
|
|
||||
|
/** |
||||
|
* 逻辑删除标识 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,57 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* gis地图网格与平台网格对应关系表 |
||||
|
* |
||||
|
* @author zhy elink@elink-cn.com |
||||
|
* @since v1.0.0 2022-09-05 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GisGridFormDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private Long gridId; |
||||
|
|
||||
|
/** |
||||
|
* 网格名称 |
||||
|
*/ |
||||
|
private String gridName; |
||||
|
|
||||
|
/** |
||||
|
* gis地图网格ID |
||||
|
*/ |
||||
|
private String gisGridId; |
||||
|
|
||||
|
/** |
||||
|
* gis地图网格名称 |
||||
|
*/ |
||||
|
private String gisGridName; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,56 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* gis地图网格与平台网格对应关系表 |
||||
|
* |
||||
|
* @author zhy elink@elink-cn.com |
||||
|
* @since v1.0.0 2022-09-05 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GisGridResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private Long gridId; |
||||
|
|
||||
|
/** |
||||
|
* 网格名称 |
||||
|
*/ |
||||
|
private String gridName; |
||||
|
|
||||
|
/** |
||||
|
* gis地图网格ID |
||||
|
*/ |
||||
|
private String gisGridId; |
||||
|
|
||||
|
/** |
||||
|
* gis地图网格名称 |
||||
|
*/ |
||||
|
private String gisGridName; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,43 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.dao; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
||||
|
import com.elink.esua.epdc.dto.GisGridDTO; |
||||
|
import com.elink.esua.epdc.entity.GisGridEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* gis地图网格与平台网格对应关系表 |
||||
|
* |
||||
|
* @author zhy elink@elink-cn.com |
||||
|
* @since v1.0.0 2022-09-05 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface GisGridDao extends BaseDao<GisGridEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 删除历史记录 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return |
||||
|
* @author zhy |
||||
|
* @date 2022/9/5 10:54 |
||||
|
*/ |
||||
|
void deleteByGridName(GisGridDTO dto); |
||||
|
} |
||||
@ -0,0 +1,56 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* gis地图网格与平台网格对应关系表 |
||||
|
* |
||||
|
* @author zhy elink@elink-cn.com |
||||
|
* @since v1.0.0 2022-09-05 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("epdc_gis_grid") |
||||
|
public class GisGridEntity extends BaseEpdcEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private Long gridId; |
||||
|
|
||||
|
/** |
||||
|
* 网格名称 |
||||
|
*/ |
||||
|
private String gridName; |
||||
|
|
||||
|
/** |
||||
|
* gis地图网格名称 |
||||
|
*/ |
||||
|
private String gisGridName; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,47 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.redis; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* gis地图网格与平台网格对应关系表 |
||||
|
* |
||||
|
* @author zhy elink@elink-cn.com |
||||
|
* @since v1.0.0 2022-09-05 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class GisGridRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,126 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.service; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.dto.GisGridDTO; |
||||
|
import com.elink.esua.epdc.dto.SysDeptDTO; |
||||
|
import com.elink.esua.epdc.entity.GisGridEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* gis地图网格与平台网格对应关系表 |
||||
|
* |
||||
|
* @author zhy elink@elink-cn.com |
||||
|
* @since v1.0.0 2022-09-05 |
||||
|
*/ |
||||
|
public interface GisGridService extends BaseService<GisGridEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<GisGridDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-09-05 |
||||
|
*/ |
||||
|
PageData<GisGridDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<GisGridDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-09-05 |
||||
|
*/ |
||||
|
List<GisGridDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return GisGridDTO |
||||
|
* @author generator |
||||
|
* @date 2022-09-05 |
||||
|
*/ |
||||
|
GisGridDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param gridName |
||||
|
* @return GisGridDTO |
||||
|
* @author generator |
||||
|
* @date 2022-09-05 |
||||
|
*/ |
||||
|
GisGridDTO getByGridName(String gridName); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param gisGridName |
||||
|
* @return GisGridDTO |
||||
|
* @author generator |
||||
|
* @date 2022-09-05 |
||||
|
*/ |
||||
|
GisGridDTO getByGisGridName(String gisGridName); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-09-05 |
||||
|
*/ |
||||
|
void save(GisGridDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-09-05 |
||||
|
*/ |
||||
|
void update(GisGridDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-09-05 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
|
||||
|
/** |
||||
|
* 系统网格与gis网格关系存储 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author zhy |
||||
|
* @date 2022/9/5 10:47 |
||||
|
*/ |
||||
|
void saveRelation(SysDeptDTO dto); |
||||
|
} |
||||
@ -0,0 +1,145 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
||||
|
import com.elink.esua.epdc.dao.GisGridDao; |
||||
|
import com.elink.esua.epdc.dto.GisGridDTO; |
||||
|
import com.elink.esua.epdc.dto.SysDeptDTO; |
||||
|
import com.elink.esua.epdc.entity.GisGridEntity; |
||||
|
import com.elink.esua.epdc.redis.GisGridRedis; |
||||
|
import com.elink.esua.epdc.service.GisGridService; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* gis地图网格与平台网格对应关系表 |
||||
|
* |
||||
|
* @author zhy elink@elink-cn.com |
||||
|
* @since v1.0.0 2022-09-05 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class GisGridServiceImpl extends BaseServiceImpl<GisGridDao, GisGridEntity> implements GisGridService { |
||||
|
|
||||
|
@Autowired |
||||
|
private GisGridRedis gisGridRedis; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<GisGridDTO> page(Map<String, Object> params) { |
||||
|
IPage<GisGridEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, GisGridDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<GisGridDTO> list(Map<String, Object> params) { |
||||
|
List<GisGridEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, GisGridDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<GisGridEntity> getWrapper(Map<String, Object> params) { |
||||
|
String id = (String) params.get(FieldConstant.ID_HUMP); |
||||
|
String gridId = (String) params.get("gridId"); |
||||
|
String gridName = (String) params.get("gridName"); |
||||
|
String gisGridId = (String) params.get("gisGridId"); |
||||
|
String gisGridName = (String) params.get("gisGridName"); |
||||
|
|
||||
|
QueryWrapper<GisGridEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
wrapper.eq(StringUtils.isNotBlank(gridId), "GRID_ID", gridId); |
||||
|
wrapper.eq(StringUtils.isNotBlank(gridName), "GRID_NAME", gridName); |
||||
|
wrapper.eq(StringUtils.isNotBlank(gisGridId), "GIS_GRID_ID", gisGridId); |
||||
|
wrapper.eq(StringUtils.isNotBlank(gisGridName), "GIS_GRID_NAME", gisGridName); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public GisGridDTO get(String id) { |
||||
|
GisGridEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, GisGridDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public GisGridDTO getByGridName(String gridName) { |
||||
|
Map<String, Object> params = new HashMap<>(2); |
||||
|
params.put("gridName", gridName); |
||||
|
GisGridEntity entity = baseDao.selectOne(getWrapper(params)); |
||||
|
return ConvertUtils.sourceToTarget(entity, GisGridDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public GisGridDTO getByGisGridName(String gisGridName) { |
||||
|
Map<String, Object> params = new HashMap<>(2); |
||||
|
params.put("gisGridName", gisGridName); |
||||
|
GisGridEntity entity = baseDao.selectOne(getWrapper(params)); |
||||
|
return ConvertUtils.sourceToTarget(entity, GisGridDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(GisGridDTO dto) { |
||||
|
GisGridEntity entity = ConvertUtils.sourceToTarget(dto, GisGridEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(GisGridDTO dto) { |
||||
|
GisGridEntity entity = ConvertUtils.sourceToTarget(dto, GisGridEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void saveRelation(SysDeptDTO dto) { |
||||
|
if (StringUtils.isNotBlank(dto.getGisGridName())) { |
||||
|
GisGridDTO gisGridDTO = new GisGridDTO(); |
||||
|
gisGridDTO.setGridId(dto.getId()); |
||||
|
gisGridDTO.setGridName(dto.getName()); |
||||
|
gisGridDTO.setGisGridName(dto.getGisGridName()); |
||||
|
baseDao.deleteByGridName(gisGridDTO); |
||||
|
|
||||
|
GisGridEntity entity = ConvertUtils.sourceToTarget(gisGridDTO, GisGridEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.elink.esua.epdc.dao.GisGridDao"> |
||||
|
|
||||
|
<resultMap type="com.elink.esua.epdc.entity.GisGridEntity" id="gisGridMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="gridId" column="GRID_ID"/> |
||||
|
<result property="gridName" column="GRID_NAME"/> |
||||
|
<result property="gisGridName" column="GIS_GRID_NAME"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<delete id="deleteByGridName"> |
||||
|
DELETE |
||||
|
FROM |
||||
|
epdc_gis_grid |
||||
|
WHERE |
||||
|
GRID_NAME = '2' |
||||
|
OR GIS_GRID_NAME = '1' |
||||
|
<if test="gridId != null and gridId != '' "> |
||||
|
OR GRID_ID = '1' |
||||
|
</if> |
||||
|
</delete> |
||||
|
</mapper> |
||||
Loading…
Reference in new issue