Browse Source

厂内导航

liyg 3 years ago
parent
commit
9b988ab7a6
23 changed files with 1688 additions and 10 deletions
  1. 4 1
      pom.xml
  2. 1 1
      src/main/java/com/steerinfo/DilApplicationMain.java
  3. 32 4
      src/main/java/com/steerinfo/inPlantNavigation/controller/IPMMSVertexController.java
  4. 68 0
      src/main/java/com/steerinfo/inPlantNavigation/controller/MapVertexController.java
  5. 46 0
      src/main/java/com/steerinfo/inPlantNavigation/controller/MapVertexEdgeController.java
  6. 17 0
      src/main/java/com/steerinfo/inPlantNavigation/mapper/MapVertexEdgeMapper.java
  7. 16 0
      src/main/java/com/steerinfo/inPlantNavigation/mapper/MapVertexMapper.java
  8. 1 0
      src/main/java/com/steerinfo/inPlantNavigation/model/IPMMSVertex.java
  9. 0 2
      src/main/java/com/steerinfo/inPlantNavigation/model/IPMMSVertexEdge.java
  10. 184 0
      src/main/java/com/steerinfo/inPlantNavigation/model/MapVertex.java
  11. 169 0
      src/main/java/com/steerinfo/inPlantNavigation/model/MapVertexEdge.java
  12. 3 0
      src/main/java/com/steerinfo/inPlantNavigation/service/IIPMMSVertexEdgeService.java
  13. 2 0
      src/main/java/com/steerinfo/inPlantNavigation/service/IIPMMSVertexService.java
  14. 34 0
      src/main/java/com/steerinfo/inPlantNavigation/service/IMapVertexEdgeService.java
  15. 36 0
      src/main/java/com/steerinfo/inPlantNavigation/service/IMapVertexService.java
  16. 47 0
      src/main/java/com/steerinfo/inPlantNavigation/service/impl/IPMMSVertexEdgeServiceImpl.java
  17. 91 0
      src/main/java/com/steerinfo/inPlantNavigation/service/impl/MapVertexEdgeServiceImpl.java
  18. 216 0
      src/main/java/com/steerinfo/inPlantNavigation/service/impl/MapVertexServiceImpl.java
  19. 7 0
      src/main/java/com/steerinfo/inPlantNavigation/to/SuboptimalSolution.java
  20. 50 0
      src/main/java/com/steerinfo/inPlantNavigation/util/ExcelIOUtil.java
  21. 0 2
      src/main/resources/application-prod.yml
  22. 320 0
      src/main/resources/com/steerinfo/inPlantNavigation/mapper/MapVertexEdgeMapper.xml
  23. 344 0
      src/main/resources/com/steerinfo/inPlantNavigation/mapper/MapVertexMapper.xml

+ 4 - 1
pom.xml

@@ -156,7 +156,10 @@
                     <!--包名-->
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
-                        <param>DIL_VERSION</param>
+                        <param>MAP_VERTEX</param>
+                        <param>MAP_VERTEX_EDGE</param>
+                       <!-- <param>DIL_VERSION</param>
+                        -->
                     </tables>
                 </configuration>
                 <executions>

+ 1 - 1
src/main/java/com/steerinfo/DilApplicationMain.java

@@ -17,7 +17,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
 @SpringBootApplication
 @ServletComponentScan
 @EnableScheduling
-@MapperScan({"com.steerinfo.dil.mapper","com.steerinfo.route.mapper"})
+@MapperScan({"com.steerinfo.dil.mapper","com.steerinfo.route.mapper","com.steerinfo.inPlantNavigation.mapper"})
 @EnableFeignClients(basePackages = "com.steerinfo.dil.feign")
 @EnableDiscoveryClient
 public class DilApplicationMain {

+ 32 - 4
src/main/java/com/steerinfo/inPlantNavigation/controller/IPMMSVertexController.java

@@ -11,6 +11,7 @@ import com.steerinfo.inPlantNavigation.service.impl.IPMMSVertexServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -34,16 +35,43 @@ public class IPMMSVertexController extends BaseRESTfulController {
         return success(obtainTheOptimalPath);
     }
 
+    /**
+     * 获取路径
+     * @param startPoint
+     * @param endPoint
+     * @return
+     * @throws Exception
+     */
     @GetMapping("/getObtainTheOptimalPathTest")
     public RESTfulResult getObtainTheOptimalPathTest(@RequestParam("startPoint") String startPoint,@RequestParam("endPoint")  String endPoint) throws Exception{
 
-        Map<String, List<IPMMSVertexEdge>> vertexEdgeList= ipmmsVertexEdgeService.initVertexEdgeTest();
-        Map<String, IPMMSVertex> vertexList = ipmmsVertexService.initIPMSVertexTest();
+        Map<String, List<IPMMSVertexEdge>> vertexEdgeList= ipmmsVertexEdgeService.initVertexEdgeTest2();
+        Map<String, IPMMSVertex> vertexList = ipmmsVertexService.initIPMSVertexTest2();
         ArrayList<IPMMSVertex> obtainTheOptimalPath= ipmmsVertexService.getObtainTheOptimalPath(startPoint,endPoint,vertexEdgeList,vertexList);
+//        String path="";
+//        for(IPMMSVertex vertex:obtainTheOptimalPath){
+//            path+=vertex.getAddressName()+"<<";
+//        }
         return success(obtainTheOptimalPath);
     }
+
+    /**
+     * 测试点
+     * @return
+     * @throws IOException
+     */
     @GetMapping("/vertexTest")
-    public RESTfulResult vertexTest(){
-      return success(ipmmsVertexService.initIPMSVertexTest().values());
+    public RESTfulResult vertexTest() throws IOException {
+      return success(ipmmsVertexService.initIPMSVertexTest2().values());
+    }
+
+    /**
+     * 测试边
+     * @return
+     * @throws IOException
+     */
+    @GetMapping("/vertexEdgeTest")
+    public RESTfulResult vertexEdgeTest() throws IOException {
+        return success(ipmmsVertexEdgeService.initVertexEdgeTest2());
     }
 }

+ 68 - 0
src/main/java/com/steerinfo/inPlantNavigation/controller/MapVertexController.java

@@ -0,0 +1,68 @@
+package com.steerinfo.inPlantNavigation.controller;
+
+import com.steerinfo.framework.controller.BaseRESTfulController;
+import com.steerinfo.framework.controller.RESTfulResult;
+
+import com.steerinfo.inPlantNavigation.exception.VertexAngEdgeException;
+import com.steerinfo.inPlantNavigation.model.IPMMSVertex;
+import com.steerinfo.inPlantNavigation.model.IPMMSVertexEdge;
+import com.steerinfo.inPlantNavigation.model.MapVertex;
+import com.steerinfo.inPlantNavigation.model.MapVertexEdge;
+import com.steerinfo.inPlantNavigation.service.IMapVertexEdgeService;
+import com.steerinfo.inPlantNavigation.service.IMapVertexService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * MapVertex RESTful接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2022-04-27 06:36
+ * 类描述
+ * 修订历史:
+ * 日期:2022-04-27
+ * 作者:generator
+ * 参考:
+ * 描述:MapVertex RESTful接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@RestController
+@RequestMapping("/${api.version}/mapvertexs")
+public class MapVertexController extends BaseRESTfulController {
+
+    @Autowired
+    IMapVertexService mapVertexService;
+
+    @Autowired
+    IMapVertexEdgeService mapVertexEdgeService;
+
+    @ApiOperation(value="导入顶点数据,开发用")
+    @GetMapping(value = "/importVertex")
+    public RESTfulResult importVertex() throws IOException {
+        mapVertexService.importVertex("默认文件写死了");
+        return success("导入成功");
+    }
+
+    @ApiOperation(value="查询所有可用地点")
+    @GetMapping(value = "/mapvertexs/findAllAvailableVertex")
+    public RESTfulResult findAllAvailableVertex(){
+        return success(mapVertexService.findAllAvailable());
+    }
+
+    @ApiOperation(value="获取最佳路径")
+    @GetMapping(value = "/mapvertexs/getObtainTheOptimalPath")
+    public RESTfulResult getObtainTheOptimalPath(@RequestParam("startPoint") String startPoint,@RequestParam("endPoint")  String endPoint) throws VertexAngEdgeException {
+        Map<String, List<MapVertexEdge>> vertexEdgeList= mapVertexEdgeService.initVertexEdge();
+        Map<String, MapVertex> vertexList = mapVertexService.initMapVertex();
+        ArrayList<MapVertex> obtainTheOptimalPath= mapVertexService.getObtainTheOptimalPath(startPoint,endPoint,vertexEdgeList,vertexList);
+        Collections.reverse(obtainTheOptimalPath);
+        return success(obtainTheOptimalPath);
+    }
+}

+ 46 - 0
src/main/java/com/steerinfo/inPlantNavigation/controller/MapVertexEdgeController.java

@@ -0,0 +1,46 @@
+package com.steerinfo.inPlantNavigation.controller;
+
+
+import com.steerinfo.framework.controller.BaseRESTfulController;
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.inPlantNavigation.service.IMapVertexEdgeService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.io.IOException;
+
+/**
+ * MapVertexEdge RESTful接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2022-04-28 09:07
+ * 类描述
+ * 修订历史:
+ * 日期:2022-04-28
+ * 作者:generator
+ * 参考:
+ * 描述:MapVertexEdge RESTful接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@RestController
+@RequestMapping("/${api.version}/mapvertexedges")
+public class MapVertexEdgeController extends BaseRESTfulController {
+
+    @Autowired
+    IMapVertexEdgeService mapVertexEdgeService;
+
+    @ApiOperation(value="导入边数据,开发用")
+    @GetMapping(value = "/importVertexEdge")
+    public RESTfulResult importVertex() throws IOException {
+        mapVertexEdgeService.importVertexEdge("默认文件写死了");
+        return success("导入成功");
+    }
+
+    /*@ApiOperation(value="查询所有可用的边")
+    @GetMapping(value = "/importVertexEdge")
+    public RESTfulResult importVertex() throws IOException {
+        mapVertexEdgeService.importVertexEdge("默认文件写死了");
+        return success("导入成功");
+    }*/
+}

+ 17 - 0
src/main/java/com/steerinfo/inPlantNavigation/mapper/MapVertexEdgeMapper.java

@@ -0,0 +1,17 @@
+package com.steerinfo.inPlantNavigation.mapper;
+
+
+import com.steerinfo.framework.mapper.IBaseMapper;
+import com.steerinfo.inPlantNavigation.model.MapVertex;
+import com.steerinfo.inPlantNavigation.model.MapVertexEdge;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+@Mapper
+public interface MapVertexEdgeMapper extends IBaseMapper<MapVertexEdge, BigDecimal> {
+   // @Select("SELECT e.* FROM MAP_VERTEX_EDGE e LEFT JOIN MAP_VERTEX v on e.INVERTEX_ID=v.VERTEX_ID WHERE v.STATUS=0")
+    List<MapVertexEdge> findAllAvailable();
+}

+ 16 - 0
src/main/java/com/steerinfo/inPlantNavigation/mapper/MapVertexMapper.java

@@ -0,0 +1,16 @@
+package com.steerinfo.inPlantNavigation.mapper;
+
+
+import com.steerinfo.framework.mapper.IBaseMapper;
+import com.steerinfo.inPlantNavigation.model.MapVertex;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+@Mapper
+public interface MapVertexMapper extends IBaseMapper<MapVertex, BigDecimal> {
+    //@Select("SELECT * FROM MAP_VERTEX WHERE STATUS=0")
+    List<MapVertex> findAllAvailable();
+}

+ 1 - 0
src/main/java/com/steerinfo/inPlantNavigation/model/IPMMSVertex.java

@@ -43,4 +43,5 @@ public class IPMMSVertex implements Serializable {
 
     @ApiModelProperty(value="记录创建或修改备注",required=false)
     private String insertUpdateRemark;
+
 }

+ 0 - 2
src/main/java/com/steerinfo/inPlantNavigation/model/IPMMSVertexEdge.java

@@ -18,8 +18,6 @@ public class IPMMSVertexEdge implements Serializable {
     @ApiModelProperty(value="顶点主键(箭头)",required=false)
     private BigDecimal inVertexID;
 
-
-
     @ApiModelProperty(value="权重",required=false)
     private Integer weigh;
 

+ 184 - 0
src/main/java/com/steerinfo/inPlantNavigation/model/MapVertex.java

@@ -0,0 +1,184 @@
+package com.steerinfo.inPlantNavigation.model;
+
+import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@ApiModel(value="地图导航顶点")
+public class MapVertex implements IBasePO<BigDecimal> {
+    /**
+     * 顶点ID(VERTEX_ID,DECIMAL,10)
+     */
+    @ApiModelProperty(value="顶点ID",required=true)
+    private BigDecimal vertexId;
+
+    /**
+     * 地点名(ADDRESsName,VARCHAR,100)
+     */
+    @ApiModelProperty(value="地点名",required=false)
+    private String addressName;
+
+    /**
+     * 经度(LONGITUDE,DECIMAL,10)
+     */
+    @ApiModelProperty(value="经度",required=false)
+    private BigDecimal longitude;
+
+    /**
+     * 纬度(LATITUDE,DECIMAL,10)
+     */
+    @ApiModelProperty(value="纬度",required=false)
+    private BigDecimal latitude;
+
+    /**
+     * 顶点状态(0开放,1关闭)(STATUS,DECIMAL,38)
+     */
+    @ApiModelProperty(value="顶点状态(0开放,1关闭)",required=false)
+    private BigDecimal status;
+
+    /**
+     * 记录创建人(INSERT_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录创建人",required=false)
+    private String insertUsername;
+
+    /**
+     * 记录创建时间(INSERT_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录创建时间",required=false)
+    private Date insertTime;
+
+    /**
+     * 记录修改人(UPDATE_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录修改人",required=false)
+    private String updateUsername;
+
+    /**
+     * 记录修改时间(UPDATE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录修改时间",required=false)
+    private Date updateTime;
+
+    /**
+     * 记录创建或修改备注(INSERT_UPDATE_REMARK,VARCHAR,100)
+     */
+    @ApiModelProperty(value="记录创建或修改备注",required=false)
+    private String insertUpdateRemark;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.vertexId;
+    }
+
+    @Override
+    public void setId(BigDecimal vertexId) {
+        this.vertexId = vertexId;
+    }
+
+    public BigDecimal getVertexId() {
+        return vertexId;
+    }
+
+    public void setVertexId(BigDecimal vertexId) {
+        this.vertexId = vertexId;
+    }
+
+    public String getAddressName() {
+        return addressName;
+    }
+
+    public void setAddressName(String addressName) {
+        this.addressName = addressName == null ? null : addressName.trim();
+    }
+
+    public BigDecimal getLongitude() {
+        return longitude;
+    }
+
+    public void setLongitude(BigDecimal longitude) {
+        this.longitude = longitude;
+    }
+
+    public BigDecimal getLatitude() {
+        return latitude;
+    }
+
+    public void setLatitude(BigDecimal latitude) {
+        this.latitude = latitude;
+    }
+
+    public BigDecimal getStatus() {
+        return status;
+    }
+
+    public void setStatus(BigDecimal status) {
+        this.status = status;
+    }
+
+    public String getInsertUsername() {
+        return insertUsername;
+    }
+
+    public void setInsertUsername(String insertUsername) {
+        this.insertUsername = insertUsername == null ? null : insertUsername.trim();
+    }
+
+    public Date getInsertTime() {
+        return insertTime;
+    }
+
+    public void setInsertTime(Date insertTime) {
+        this.insertTime = insertTime;
+    }
+
+    public String getUpdateUsername() {
+        return updateUsername;
+    }
+
+    public void setUpdateUsername(String updateUsername) {
+        this.updateUsername = updateUsername == null ? null : updateUsername.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getInsertUpdateRemark() {
+        return insertUpdateRemark;
+    }
+
+    public void setInsertUpdateRemark(String insertUpdateRemark) {
+        this.insertUpdateRemark = insertUpdateRemark == null ? null : insertUpdateRemark.trim();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", vertexId=").append(vertexId);
+        sb.append(", addressName=").append(addressName);
+        sb.append(", longitude=").append(longitude);
+        sb.append(", latitude=").append(latitude);
+        sb.append(", status=").append(status);
+        sb.append(", insertUsername=").append(insertUsername);
+        sb.append(", insertTime=").append(insertTime);
+        sb.append(", updateUsername=").append(updateUsername);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 169 - 0
src/main/java/com/steerinfo/inPlantNavigation/model/MapVertexEdge.java

@@ -0,0 +1,169 @@
+package com.steerinfo.inPlantNavigation.model;
+
+import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@ApiModel(value="地图导航中顶点的边")
+public class MapVertexEdge implements IBasePO<BigDecimal> {
+    /**
+     * 边ID(VERTEXEDGE_ID,DECIMAL,10)
+     */
+    @ApiModelProperty(value="边ID",required=true)
+    private BigDecimal vertexedgeId;
+
+    /**
+     * 起始点,出点(OUTVERTEX_ID,DECIMAL,10)
+     */
+    @ApiModelProperty(value="起始点,出点",required=false)
+    private BigDecimal outvertexId;
+
+    /**
+     * 终点,入点(INVERTEX_ID,DECIMAL,10)
+     */
+    @ApiModelProperty(value="终点,入点",required=false)
+    private BigDecimal invertexId;
+
+    /**
+     * 权重(WEIGH,DECIMAL,38)
+     */
+    @ApiModelProperty(value="权重",required=false)
+    private BigDecimal weigh;
+
+    /**
+     * 记录创建人(INSERT_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录创建人",required=false)
+    private String insertUsername;
+
+    /**
+     * 记录创建时间(INSERT_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录创建时间",required=false)
+    private Date insertTime;
+
+    /**
+     * 记录修改人(UPDATE_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录修改人",required=false)
+    private String updateUsername;
+
+    /**
+     * 记录修改时间(UPDATE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录修改时间",required=false)
+    private Date updateTime;
+
+    /**
+     * 记录创建或修改备注(INSERT_UPDATE_REMARK,VARCHAR,100)
+     */
+    @ApiModelProperty(value="记录创建或修改备注",required=false)
+    private String insertUpdateRemark;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.vertexedgeId;
+    }
+
+    @Override
+    public void setId(BigDecimal vertexedgeId) {
+        this.vertexedgeId = vertexedgeId;
+    }
+
+    public BigDecimal getVertexedgeId() {
+        return vertexedgeId;
+    }
+
+    public void setVertexedgeId(BigDecimal vertexedgeId) {
+        this.vertexedgeId = vertexedgeId;
+    }
+
+    public BigDecimal getOutvertexId() {
+        return outvertexId;
+    }
+
+    public void setOutvertexId(BigDecimal outvertexId) {
+        this.outvertexId = outvertexId;
+    }
+
+    public BigDecimal getInvertexId() {
+        return invertexId;
+    }
+
+    public void setInvertexId(BigDecimal invertexId) {
+        this.invertexId = invertexId;
+    }
+
+    public BigDecimal getWeigh() {
+        return weigh;
+    }
+
+    public void setWeigh(BigDecimal weigh) {
+        this.weigh = weigh;
+    }
+
+    public String getInsertUsername() {
+        return insertUsername;
+    }
+
+    public void setInsertUsername(String insertUsername) {
+        this.insertUsername = insertUsername == null ? null : insertUsername.trim();
+    }
+
+    public Date getInsertTime() {
+        return insertTime;
+    }
+
+    public void setInsertTime(Date insertTime) {
+        this.insertTime = insertTime;
+    }
+
+    public String getUpdateUsername() {
+        return updateUsername;
+    }
+
+    public void setUpdateUsername(String updateUsername) {
+        this.updateUsername = updateUsername == null ? null : updateUsername.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getInsertUpdateRemark() {
+        return insertUpdateRemark;
+    }
+
+    public void setInsertUpdateRemark(String insertUpdateRemark) {
+        this.insertUpdateRemark = insertUpdateRemark == null ? null : insertUpdateRemark.trim();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", vertexedgeId=").append(vertexedgeId);
+        sb.append(", outvertexId=").append(outvertexId);
+        sb.append(", invertexId=").append(invertexId);
+        sb.append(", weigh=").append(weigh);
+        sb.append(", insertUsername=").append(insertUsername);
+        sb.append(", insertTime=").append(insertTime);
+        sb.append(", updateUsername=").append(updateUsername);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 3 - 0
src/main/java/com/steerinfo/inPlantNavigation/service/IIPMMSVertexEdgeService.java

@@ -2,6 +2,7 @@ package com.steerinfo.inPlantNavigation.service;
 
 import com.steerinfo.inPlantNavigation.model.IPMMSVertexEdge;
 
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -10,4 +11,6 @@ public interface IIPMMSVertexEdgeService {
     Map<String, List<IPMMSVertexEdge>> initVertexEdge();
 
     Map<String, List<IPMMSVertexEdge>> initVertexEdgeTest();
+
+    Map<String,List<IPMMSVertexEdge>> initVertexEdgeTest2() throws IOException;
 }

+ 2 - 0
src/main/java/com/steerinfo/inPlantNavigation/service/IIPMMSVertexService.java

@@ -4,6 +4,7 @@ import com.steerinfo.inPlantNavigation.exception.VertexAngEdgeException;
 import com.steerinfo.inPlantNavigation.model.IPMMSVertex;
 import com.steerinfo.inPlantNavigation.model.IPMMSVertexEdge;
 
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -14,6 +15,7 @@ public interface IIPMMSVertexService {
 
     Map<String, IPMMSVertex> initIPMSVertexTest();
 
+    Map<String, IPMMSVertex> initIPMSVertexTest2() throws IOException;
 
     ArrayList<IPMMSVertex> getObtainTheOptimalPath(String startpoint,String endPoint,Map<String, List<IPMMSVertexEdge>> vertexEdgeList, Map<String, IPMMSVertex> vertexList) throws VertexAngEdgeException;
 }

+ 34 - 0
src/main/java/com/steerinfo/inPlantNavigation/service/IMapVertexEdgeService.java

@@ -0,0 +1,34 @@
+package com.steerinfo.inPlantNavigation.service;
+
+
+import com.steerinfo.framework.service.IBaseService;
+import com.steerinfo.inPlantNavigation.model.IPMMSVertexEdge;
+import com.steerinfo.inPlantNavigation.model.MapVertex;
+import com.steerinfo.inPlantNavigation.model.MapVertexEdge;
+
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * MapVertexEdge服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2022-04-28 09:07
+ * 类描述
+ * 修订历史:
+ * 日期:2022-04-28
+ * 作者:generator
+ * 参考:
+ * 描述:MapVertexEdge服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+public interface IMapVertexEdgeService {
+    //导入数据
+    int importVertexEdge(String filePath) throws IOException;
+    //查找所有可用的边
+    List<MapVertexEdge> findAllAvailable();
+    //初始化边
+    Map<String, List<MapVertexEdge>> initVertexEdge();
+}

+ 36 - 0
src/main/java/com/steerinfo/inPlantNavigation/service/IMapVertexService.java

@@ -0,0 +1,36 @@
+package com.steerinfo.inPlantNavigation.service;
+
+import com.steerinfo.inPlantNavigation.exception.VertexAngEdgeException;
+import com.steerinfo.inPlantNavigation.model.IPMMSVertex;
+import com.steerinfo.inPlantNavigation.model.IPMMSVertexEdge;
+import com.steerinfo.inPlantNavigation.model.MapVertex;
+import com.steerinfo.inPlantNavigation.model.MapVertexEdge;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * MapVertex服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2022-04-27 06:36
+ * 类描述
+ * 修订历史:
+ * 日期:2022-04-27
+ * 作者:generator
+ * 参考:
+ * 描述:MapVertex服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+public interface IMapVertexService {
+    //导入数据
+    int importVertex(String filePath) throws IOException;
+    //查询所有点
+    List<MapVertex> findAllAvailable();
+    //初始化顶点
+    Map<String, MapVertex> initMapVertex();
+    //获取最短路径
+    ArrayList<MapVertex> getObtainTheOptimalPath(String startpoint, String endPoint, Map<String, List<MapVertexEdge>> vertexEdgeList, Map<String, MapVertex> vertexList) throws VertexAngEdgeException;
+}

+ 47 - 0
src/main/java/com/steerinfo/inPlantNavigation/service/impl/IPMMSVertexEdgeServiceImpl.java

@@ -1,9 +1,13 @@
 package com.steerinfo.inPlantNavigation.service.impl;
 
+import com.steerinfo.inPlantNavigation.model.IPMMSVertex;
 import com.steerinfo.inPlantNavigation.model.IPMMSVertexEdge;
 import com.steerinfo.inPlantNavigation.service.IIPMMSVertexEdgeService;
+import com.steerinfo.inPlantNavigation.util.ExcelIOUtil;
+import org.apache.poi.hssf.usermodel.HSSFRow;
 import org.springframework.stereotype.Service;
 
+import java.io.IOException;
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -408,4 +412,47 @@ public class IPMMSVertexEdgeServiceImpl implements IIPMMSVertexEdgeService {
         vertexEdgeList.put("14",arrayList14);
         return vertexEdgeList;
     }
+
+    /**
+     * Excel导入数据测试边
+     * @return
+     */
+    @Override
+    public Map<String, List<IPMMSVertexEdge>> initVertexEdgeTest2() throws IOException {
+        List<HSSFRow> rows= ExcelIOUtil.getRowsByXls("C://Users//liyunguang//Desktop//达钢测绘边数据.xls",1);
+        System.out.println("读取Excel完成,共"+rows.size()+"行");
+        Map<String, List<IPMMSVertexEdge>> vertexEdgeList=new HashMap<>();
+        ArrayList<IPMMSVertexEdge> arrayList=new ArrayList<>();
+        String nowOutId=null;//现在的起点
+        if(rows.get(0).getCell(1)!=null && !rows.get(0).getCell(1).equals("")){
+            nowOutId=rows.get(0).getCell(1).toString();//初始化第一个起点
+        }else{
+            return null;
+        }
+        for(HSSFRow row: rows){
+            if(row.getCell(0)==null || row.getCell(0).equals("")){
+                continue;
+            }
+            if(!row.getCell(1).toString().equals(nowOutId)){
+                //如果是一个新的起点,那么把现在的list加到输出中去,更新起点和它的ArrayList
+                System.out.println("新的起点,以上加入顶点 "+nowOutId.toString()+" 的边数组");
+                vertexEdgeList.put(nowOutId,arrayList);
+                nowOutId=row.getCell(1).toString();
+                arrayList=new ArrayList<>();
+            }
+            //创建一个边 添加到list中去
+            IPMMSVertexEdge edge=new IPMMSVertexEdge();
+            edge.setVertexEdgeID(new BigDecimal(row.getCell(0).toString()));
+            edge.setOutVertexID(new BigDecimal(row.getCell(1).toString()));
+            edge.setInVertexID(new BigDecimal(row.getCell(3).toString()));
+            edge.setWeigh(new BigDecimal(row.getCell(5).toString()).intValue());//表格中有小数,数据会只保留整数
+            arrayList.add(edge);
+            if(row==rows.get(rows.size()-1)){
+                //如果是最后一个,进行处理
+                vertexEdgeList.put(nowOutId,arrayList);
+            }
+            System.out.println(edge);
+        }
+        return vertexEdgeList;
+    }
 }

+ 91 - 0
src/main/java/com/steerinfo/inPlantNavigation/service/impl/MapVertexEdgeServiceImpl.java

@@ -0,0 +1,91 @@
+package com.steerinfo.inPlantNavigation.service.impl;
+
+
+import com.steerinfo.inPlantNavigation.mapper.MapVertexEdgeMapper;
+import com.steerinfo.inPlantNavigation.model.IPMMSVertexEdge;
+import com.steerinfo.inPlantNavigation.model.MapVertex;
+import com.steerinfo.inPlantNavigation.model.MapVertexEdge;
+import com.steerinfo.inPlantNavigation.service.IMapVertexEdgeService;
+import com.steerinfo.inPlantNavigation.util.ExcelIOUtil;
+import org.apache.poi.hssf.usermodel.HSSFRow;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * MapVertexEdge服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2022-04-28 09:07
+ * 类描述
+ * 修订历史:
+ * 日期:2022-04-28
+ * 作者:generator
+ * 参考:
+ * 描述:MapVertexEdge服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "mapVertexEdgeService")
+public class MapVertexEdgeServiceImpl implements IMapVertexEdgeService {
+
+    @Autowired
+    private MapVertexEdgeMapper mapVertexEdgeMapper;
+
+
+    @Override
+    public int importVertexEdge(String filePath) throws IOException {
+        filePath="C://Users//liyunguang//Desktop//达钢测绘边数据.xls";
+        List<HSSFRow> rows= ExcelIOUtil.getRowsByXls("C://Users//liyunguang//Desktop//达钢测绘边数据.xls",1);
+        System.out.println("读取Excel完成,共"+rows.size()+"行");
+        Map<String, List<IPMMSVertexEdge>> vertexEdgeList=new HashMap<>();
+        ArrayList<MapVertexEdge> arrayList=new ArrayList<>();
+        String nowOutId=null;//现在的起点
+        if(rows.get(0).getCell(1)!=null && !rows.get(0).getCell(1).equals("")){
+            nowOutId=rows.get(0).getCell(1).toString();//初始化第一个起点
+        }else{
+            return 0;
+        }
+        for(HSSFRow row: rows){
+            if(row.getCell(0)==null || row.getCell(0).equals("")){
+                continue;
+            }
+            //创建一个边 添加到list中去
+            MapVertexEdge edge=new MapVertexEdge();
+            edge.setVertexedgeId(new BigDecimal(row.getCell(0).toString()));
+            edge.setOutvertexId(new BigDecimal(row.getCell(1).toString()));
+            edge.setInvertexId(new BigDecimal(row.getCell(3).toString()));
+            edge.setWeigh(new BigDecimal(row.getCell(5).toString()));//表格中有小数,数据会只保留整数
+            arrayList.add(edge);
+            System.out.println(edge);
+        }
+        return mapVertexEdgeMapper.batchInsert(arrayList);
+    }
+
+    @Override
+    public List<MapVertexEdge> findAllAvailable() {
+        return mapVertexEdgeMapper.findAllAvailable();
+    }
+
+    @Override
+    public Map<String, List<MapVertexEdge>> initVertexEdge() {
+        List<MapVertexEdge> edges=mapVertexEdgeMapper.findAllAvailable();//数据库查询所有可用边,不包含不可用顶点为入点的边
+        Map<String,List<MapVertexEdge>> vertexEdgeList=new HashMap<>();
+        for(MapVertexEdge edge:edges){
+           if(vertexEdgeList.containsKey(edge.getOutvertexId().toString())){
+               vertexEdgeList.get(edge.getOutvertexId().toString()).add(edge);
+           }else{
+               List<MapVertexEdge> arrayList= new ArrayList<>();
+               arrayList.add(edge);
+               vertexEdgeList.put(edge.getOutvertexId().toString(),arrayList);
+           }
+        }
+        return vertexEdgeList;
+    }
+
+}

+ 216 - 0
src/main/java/com/steerinfo/inPlantNavigation/service/impl/MapVertexServiceImpl.java

@@ -0,0 +1,216 @@
+package com.steerinfo.inPlantNavigation.service.impl;
+
+import com.steerinfo.inPlantNavigation.exception.VertexAngEdgeException;
+import com.steerinfo.inPlantNavigation.mapper.MapVertexMapper;
+import com.steerinfo.inPlantNavigation.model.IPMMSVertex;
+import com.steerinfo.inPlantNavigation.model.IPMMSVertexEdge;
+import com.steerinfo.inPlantNavigation.model.MapVertexEdge;
+import com.steerinfo.inPlantNavigation.util.ExcelIOUtil;
+import com.steerinfo.inPlantNavigation.model.MapVertex;
+import com.steerinfo.inPlantNavigation.service.IMapVertexService;
+import org.apache.commons.lang.SerializationUtils;
+import org.apache.poi.hssf.usermodel.HSSFRow;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.io.IOException;
+import java.util.*;
+import java.math.BigDecimal;
+
+/**
+ * MapVertex服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2022-04-27 06:36
+ * 类描述
+ * 修订历史:
+ * 日期:2022-04-27
+ * 作者:generator
+ * 参考:
+ * 描述:MapVertex服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "mapVertexService")
+public class MapVertexServiceImpl implements IMapVertexService {
+
+    @Autowired
+    private MapVertexMapper mapVertexMapper;
+
+
+    @Override
+    public int importVertex(String filePath) throws IOException {
+        //清空表,再添加
+        filePath="C://Users//liyunguang//Desktop//达钢测绘地点坐标数据_new.xls";
+        List<MapVertex> vertexList=new ArrayList<>();
+        //现在使用的是自己手动在地图上查询到的坐标
+        List<HSSFRow> rows= ExcelIOUtil.getRowsByXls(filePath,2);
+        System.out.println("读取Excel完成,共"+rows.size()+"行");
+        for(HSSFRow row: rows){
+            if(row.getCell(0)==null || row.getCell(0).equals("")){
+                continue;
+            }
+            MapVertex temp=new MapVertex();
+            try{
+                temp.setVertexId(new BigDecimal(row.getCell(0).toString()));//标点id
+            }catch (NumberFormatException e){
+                System.out.println(row.getCell(0).toString()+"转换成Number失败,跳过这行");
+                continue;
+            }
+            temp.setAddressName(row.getCell(1).toString());//地名
+            String []lonlat=row.getCell(10).toString().split(",");//切割字符串
+            temp.setLongitude(new BigDecimal(lonlat[0]));//经度
+            temp.setLatitude(new BigDecimal(lonlat[1]));//纬度
+            temp.setStatus(new BigDecimal(0));
+            System.out.println(temp.toString());
+            vertexList.add(temp);
+        }
+        return mapVertexMapper.batchInsert(vertexList);
+    }
+
+    @Override
+    public List<MapVertex> findAllAvailable() {
+        return mapVertexMapper.findAllAvailable();
+    }
+
+    @Override
+    public Map<String, MapVertex> initMapVertex() {
+        List<MapVertex> list=mapVertexMapper.findAllAvailable();
+        Map<String,MapVertex> vertexs=new HashMap<>();
+        for (MapVertex vertex:list){
+            vertexs.put(vertex.getVertexId().toString(),vertex);
+        }
+        return vertexs;
+    }
+
+    @Override
+    public ArrayList<MapVertex> getObtainTheOptimalPath(String startpoint, String endPoint, Map<String, List<MapVertexEdge>> vertexEdgeList, Map<String, MapVertex> vertexList) throws VertexAngEdgeException {
+        //初始化数据
+        Integer[] startPoin=new Integer[]{0,-1,0};
+        //创建S战队(放入的是已经遍历过边的顶点)
+        List<String> obtainTheOptimalPath=new ArrayList();
+        //obtainTheOptimalPath.add(statpoint);
+        //创建 dist[]  (起点到集合点中的最短路径) key:指向的点 new int[]{0,-1,0}; {累计权重、中间点、自己权重}
+        HashMap<String,Integer[]> currentBestDinstance=new HashMap<>();
+        currentBestDinstance.put(startpoint,startPoin);
+        while (obtainTheOptimalPath.size()!=vertexList.size()){
+            // dist[]最小值
+            String stringMinimumValue = getStringMinimumValue(currentBestDinstance, obtainTheOptimalPath);
+
+            //加入S战队
+            obtainTheOptimalPath.add(stringMinimumValue);
+
+            //判断是否有进入的边
+            if (island(currentBestDinstance,stringMinimumValue,vertexEdgeList)){
+                continue;
+            }
+
+            //借东风
+            List<MapVertexEdge> ipmmsVertexEdges = vertexEdgeList.get(stringMinimumValue);
+
+            //判断是否存在边
+            if (ipmmsVertexEdges==null){
+                continue;
+            }
+
+            //遍历所有的边
+            for(MapVertexEdge ipmmsVertexEdge :ipmmsVertexEdges){
+                //箭头出发点
+                BigDecimal outVertexID = ipmmsVertexEdge.getOutvertexId();
+                //到该点的最短路径
+                Integer[] starBestPath = currentBestDinstance.get(outVertexID.toString());
+                //被指向的顶点
+                BigDecimal inVertexID= ipmmsVertexEdge.getInvertexId();
+                Integer[] historyBestPaht = currentBestDinstance.get(inVertexID.toString());
+                if (starBestPath==null){
+                    throw new VertexAngEdgeException("这条边不存在!"+outVertexID.toString()+"->"+inVertexID.toString());
+                }else  if (!outVertexID.toString().equals(stringMinimumValue)){
+                    throw new VertexAngEdgeException(outVertexID+"->"+inVertexID+"不是顶点"+stringMinimumValue+"的边!");
+                }
+                //判断是否存在其路线到这个点的距离。如果不存在则将这条线路作为起点到该点最短路径、如果本条路线是最短路径需要替换最短路径
+                if(historyBestPaht==null){
+                    Integer distance=starBestPath[0]+ipmmsVertexEdge.getWeigh().intValue();
+                    Integer outVertex=outVertexID.intValue();
+                    Integer[] bestPath=new Integer[]{distance,outVertex,ipmmsVertexEdge.getWeigh().intValue()};
+                    currentBestDinstance.put(inVertexID.toString(),bestPath);
+                }else if ((starBestPath[0]+ipmmsVertexEdge.getWeigh().intValue())<historyBestPaht[0]){
+                    //更新和此顶点有关的数据
+                    Integer distance=starBestPath[0]+ipmmsVertexEdge.getWeigh().intValue();
+                    Integer outVertex=outVertexID.intValue();
+                    Integer[] bestPath=new Integer[]{distance,outVertex,ipmmsVertexEdge.getWeigh().intValue()};
+                    currentBestDinstance.put(inVertexID.toString(),bestPath);
+                    ArrayList<String> updateList = new ArrayList<>();
+                    updateRelactionVertex(updateList, stringMinimumValue, currentBestDinstance);
+                }
+            }
+        }
+        if (!currentBestDinstance.containsKey(endPoint)){
+            throw new VertexAngEdgeException("没有该条路径,请检查是否缺少边!"+endPoint);
+        }
+        return startPointToEndPointPath(endPoint,currentBestDinstance,vertexList);
+    }
+
+    //获得目前最短距离
+    public String getStringMinimumValue(HashMap<String,Integer[]> currentBestDinstance,List<String> obtainTheOptimalPath){
+
+        HashMap<String,Integer[]> bestDinstance = (HashMap<String, Integer[]>) SerializationUtils.clone(currentBestDinstance);
+
+        for (String item:obtainTheOptimalPath){
+            if (bestDinstance.containsKey(item)){
+                bestDinstance.remove(item);
+            }
+        }
+        Set<String> keys = bestDinstance.keySet();
+        String vertex="";
+        int minimumValue=10000000;
+        for (String key :keys){
+            Integer[] value = currentBestDinstance.get(key);
+            if (minimumValue>value[0]){
+                minimumValue=value[0];
+                vertex=key;
+            }
+        }
+        return vertex;
+    }
+
+    //判断是否有进入这个顶点的边,如果没有这个顶点就是一个孤岛
+    public Boolean island(HashMap<String,Integer[]> currentBestDinstance,String stringMinimumValue,Map<String, List<MapVertexEdge>> vertexEdgeList){
+        if(!currentBestDinstance.containsKey(stringMinimumValue)){
+            Collection<List<MapVertexEdge>> values = vertexEdgeList.values();
+            for (List<MapVertexEdge> vertexEdges : values){
+                for (MapVertexEdge vertexEdge:vertexEdges){
+                    if (vertexEdge.getInvertexId().equals(stringMinimumValue))
+                        return false;
+                }
+            }
+            return  true;
+        }
+        return false;
+    }
+
+    //更新相关的值
+    public void updateRelactionVertex(List<String> result,String currentVertex,HashMap<String,Integer[]> currentBestDinstance){
+        Set<String> keys = currentBestDinstance.keySet();
+        for (String  key:  keys){
+            Integer[] value=currentBestDinstance.get(key);
+            if (new BigDecimal(value[1]).equals(new BigDecimal(currentVertex))){
+                value[0]=value[2]+currentBestDinstance.get(currentVertex)[0];
+                currentBestDinstance.put(key,value);
+                updateRelactionVertex(result,key,currentBestDinstance);
+            }
+        }
+
+    }
+    //通过所有最优解集合选择我们要的路径
+    public ArrayList<MapVertex> startPointToEndPointPath(String point, HashMap<String,Integer[]> currentBestDinstance, Map<String, MapVertex> vertexList){
+        ArrayList<MapVertex> obtainOptimalPath=new ArrayList();
+        Integer beforeDistance=0;
+        do {
+            Integer[] ints = currentBestDinstance.get(point);
+            beforeDistance=ints[1];
+            obtainOptimalPath.add(vertexList.get(point));
+            point=String.valueOf(ints[1]);
+        }
+        while (beforeDistance!=-1);
+        return obtainOptimalPath;
+    }
+}

+ 7 - 0
src/main/java/com/steerinfo/inPlantNavigation/to/SuboptimalSolution.java

@@ -0,0 +1,7 @@
+package com.steerinfo.inPlantNavigation.to;
+
+import lombok.Data;
+
+@Data
+public class SuboptimalSolution {
+}

+ 50 - 0
src/main/java/com/steerinfo/inPlantNavigation/util/ExcelIOUtil.java

@@ -0,0 +1,50 @@
+package com.steerinfo.inPlantNavigation.util;
+
+import org.apache.poi.hssf.usermodel.HSSFRow;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.xssf.usermodel.XSSFRow;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+public class ExcelIOUtil {
+    public  static List<XSSFRow> getRows(String filePath) throws IOException {
+        //返回值
+        List<XSSFRow> rsultList=new ArrayList<>();
+        FileInputStream is = new FileInputStream(filePath);
+        XSSFWorkbook workbook=new XSSFWorkbook(is);
+        int numberOfSheets = workbook.getNumberOfSheets();
+        for (int i=0;i<numberOfSheets;i++){
+            XSSFSheet sheetAt = workbook.getSheetAt(i);
+            int lastRowNum = sheetAt.getLastRowNum();
+            for (int j=1;j<=lastRowNum;j++){
+                XSSFRow row = sheetAt.getRow(j);
+                rsultList.add(row);
+            }
+        }
+        return rsultList;
+    }
+
+    public  static List<HSSFRow> getRowsByXls(String filePath,int ignore) throws IOException {
+        //返回值
+        List<HSSFRow> rsultList=new ArrayList<>();
+        FileInputStream is = new FileInputStream(filePath);
+        HSSFWorkbook workbook=new HSSFWorkbook(is);
+        int numberOfSheets = workbook.getNumberOfSheets();
+        for (int i=0;i<numberOfSheets;i++){
+            HSSFSheet sheetAt = workbook.getSheetAt(i);
+            int lastRowNum = sheetAt.getLastRowNum();//最后一行下标
+            //j=ignore行开始获取数据
+            for (int j=ignore;j<=lastRowNum;j++){
+                HSSFRow row = sheetAt.getRow(j);
+                rsultList.add(row);
+            }
+        }
+        return rsultList;
+    }
+}

+ 0 - 2
src/main/resources/application-prod.yml

@@ -40,7 +40,5 @@ openfeign:
     url: ${QMSFEIGN_URL:172.16.33.166:8047}
   ImFeign:
     url: ${IMFEIGN_URL:172.16.33.166:8055}
-
-
 server:
   port: 8038

+ 320 - 0
src/main/resources/com/steerinfo/inPlantNavigation/mapper/MapVertexEdgeMapper.xml

@@ -0,0 +1,320 @@
+<?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.steerinfo.inPlantNavigation.mapper.MapVertexEdgeMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.inPlantNavigation.model.MapVertexEdge">
+    <id column="VERTEXEDGE_ID" jdbcType="DECIMAL" property="vertexedgeId" />
+    <result column="OUTVERTEX_ID" jdbcType="DECIMAL" property="outvertexId" />
+    <result column="INVERTEX_ID" jdbcType="DECIMAL" property="invertexId" />
+    <result column="WEIGH" jdbcType="DECIMAL" property="weigh" />
+    <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
+    <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
+    <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
+    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
+  </resultMap>
+  <sql id="columns">
+    VERTEXEDGE_ID, OUTVERTEX_ID, INVERTEX_ID, WEIGH, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
+    UPDATE_TIME, INSERT_UPDATE_REMARK
+  </sql>
+  <sql id="columns_alias">
+    t.VERTEXEDGE_ID, t.OUTVERTEX_ID, t.INVERTEX_ID, t.WEIGH, t.INSERT_USERNAME, t.INSERT_TIME, 
+    t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns"/> FROM MAP_VERTEX_EDGE
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias"/> FROM MAP_VERTEX_EDGE t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="vertexedgeId != null">
+        and VERTEXEDGE_ID = #{vertexedgeId}
+      </if>
+      <if test="outvertexId != null">
+        and OUTVERTEX_ID = #{outvertexId}
+      </if>
+      <if test="invertexId != null">
+        and INVERTEX_ID = #{invertexId}
+      </if>
+      <if test="weigh != null">
+        and WEIGH = #{weigh}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="vertexedgeId != null">
+        and VERTEXEDGE_ID = #{vertexedgeId}
+      </if>
+      <if test="outvertexId != null">
+        and OUTVERTEX_ID = #{outvertexId}
+      </if>
+      <if test="invertexId != null">
+        and INVERTEX_ID = #{invertexId}
+      </if>
+      <if test="weigh != null">
+        and WEIGH = #{weigh}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME LIKE '%${insertUsername}%'
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME LIKE '%${updateUsername}%'
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+    delete from MAP_VERTEX_EDGE
+    where VERTEXEDGE_ID = #{vertexedgeId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from MAP_VERTEX_EDGE
+    where 1!=1 
+      <if test="outvertexId != null">
+        or OUTVERTEX_ID = #{outvertexId}
+      </if>
+      <if test="invertexId != null">
+        or INVERTEX_ID = #{invertexId}
+      </if>
+      <if test="weigh != null">
+        or WEIGH = #{weigh}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        or INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        or UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.inPlantNavigation.model.MapVertexEdge">
+    insert into MAP_VERTEX_EDGE (VERTEXEDGE_ID, OUTVERTEX_ID, INVERTEX_ID, 
+      WEIGH, INSERT_USERNAME, INSERT_TIME, 
+      UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK
+      )
+    values (#{vertexedgeId,jdbcType=DECIMAL}, #{outvertexId,jdbcType=DECIMAL}, #{invertexId,jdbcType=DECIMAL}, 
+      #{weigh,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, 
+      #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.inPlantNavigation.model.MapVertexEdge">
+    insert into MAP_VERTEX_EDGE
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="vertexedgeId != null">
+        VERTEXEDGE_ID,
+      </if>
+      <if test="outvertexId != null">
+        OUTVERTEX_ID,
+      </if>
+      <if test="invertexId != null">
+        INVERTEX_ID,
+      </if>
+      <if test="weigh != null">
+        WEIGH,
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME,
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME,
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME,
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME,
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="vertexedgeId != null">
+        #{vertexedgeId,jdbcType=DECIMAL},
+      </if>
+      <if test="outvertexId != null">
+        #{outvertexId,jdbcType=DECIMAL},
+      </if>
+      <if test="invertexId != null">
+        #{invertexId,jdbcType=DECIMAL},
+      </if>
+      <if test="weigh != null">
+        #{weigh,jdbcType=DECIMAL},
+      </if>
+      <if test="insertUsername != null">
+        #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.inPlantNavigation.model.MapVertexEdge">
+    update MAP_VERTEX_EDGE
+    set OUTVERTEX_ID = #{outvertexId,jdbcType=DECIMAL},
+      INVERTEX_ID = #{invertexId,jdbcType=DECIMAL},
+      WEIGH = #{weigh,jdbcType=DECIMAL},
+      INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+      INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+      UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR}
+    where VERTEXEDGE_ID = #{vertexedgeId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.inPlantNavigation.model.MapVertexEdge">
+    update MAP_VERTEX_EDGE
+    <set>
+      <if test="outvertexId != null">
+        OUTVERTEX_ID = #{outvertexId,jdbcType=DECIMAL},
+      </if>
+      <if test="invertexId != null">
+        INVERTEX_ID = #{invertexId,jdbcType=DECIMAL},
+      </if>
+      <if test="weigh != null">
+        WEIGH = #{weigh,jdbcType=DECIMAL},
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where VERTEXEDGE_ID = #{vertexedgeId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <include refid="select"/>
+    where VERTEXEDGE_ID = #{vertexedgeId,jdbcType=DECIMAL}
+  </select>
+  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <include refid="where"/>
+  </select>
+  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <include refid="whereLike"/>
+  </select>
+  <insert id="batchInsert" parameterType="java.util.List">
+    insert into MAP_VERTEX_EDGE 
+      (VERTEXEDGE_ID, 
+      OUTVERTEX_ID, INVERTEX_ID, WEIGH, 
+      INSERT_USERNAME, INSERT_TIME, 
+      UPDATE_USERNAME, UPDATE_TIME, 
+      INSERT_UPDATE_REMARK)
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.vertexedgeId,jdbcType=DECIMAL}, 
+      #{item.outvertexId,jdbcType=DECIMAL}, #{item.invertexId,jdbcType=DECIMAL}, #{item.weigh,jdbcType=DECIMAL}, 
+      #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP}, 
+      #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, 
+      #{item.insertUpdateRemark,jdbcType=VARCHAR} from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update MAP_VERTEX_EDGE
+     set
+       VERTEXEDGE_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case VERTEXEDGE_ID" close="end">
+          when #{item.vertexedgeId,jdbcType=DECIMAL} then #{item.vertexedgeId,jdbcType=DECIMAL}
+       </foreach>
+       ,OUTVERTEX_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case VERTEXEDGE_ID" close="end">
+          when #{item.vertexedgeId,jdbcType=DECIMAL} then #{item.outvertexId,jdbcType=DECIMAL}
+       </foreach>
+       ,INVERTEX_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case VERTEXEDGE_ID" close="end">
+          when #{item.vertexedgeId,jdbcType=DECIMAL} then #{item.invertexId,jdbcType=DECIMAL}
+       </foreach>
+       ,WEIGH=
+       <foreach collection="list" item="item" index="index" separator=" " open="case VERTEXEDGE_ID" close="end">
+          when #{item.vertexedgeId,jdbcType=DECIMAL} then #{item.weigh,jdbcType=DECIMAL}
+       </foreach>
+       ,INSERT_USERNAME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case VERTEXEDGE_ID" close="end">
+          when #{item.vertexedgeId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case VERTEXEDGE_ID" close="end">
+          when #{item.vertexedgeId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,UPDATE_USERNAME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case VERTEXEDGE_ID" close="end">
+          when #{item.vertexedgeId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case VERTEXEDGE_ID" close="end">
+          when #{item.vertexedgeId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_UPDATE_REMARK=
+       <foreach collection="list" item="item" index="index" separator=" " open="case VERTEXEDGE_ID" close="end">
+          when #{item.vertexedgeId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+       </foreach>
+     where VERTEXEDGE_ID in 
+     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+    #{item.vertexedgeId,jdbcType=DECIMAL}
+     </foreach> 
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from MAP_VERTEX_EDGE
+    where VERTEXEDGE_ID in 
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+  <select id="findAllAvailable" resultMap="BaseResultMap">
+    SELECT e.* FROM MAP_VERTEX_EDGE e LEFT JOIN MAP_VERTEX v on e.INVERTEX_ID=v.VERTEX_ID WHERE v.STATUS=0 order by e.OUTVERTEX_ID
+  </select>
+</mapper>

+ 344 - 0
src/main/resources/com/steerinfo/inPlantNavigation/mapper/MapVertexMapper.xml

@@ -0,0 +1,344 @@
+<?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.steerinfo.inPlantNavigation.mapper.MapVertexMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.inPlantNavigation.model.MapVertex">
+    <id column="VERTEX_ID" jdbcType="DECIMAL" property="vertexId" />
+    <result column="ADDRESS_NAME" jdbcType="VARCHAR" property="addressName" />
+    <result column="LONGITUDE" jdbcType="DECIMAL" property="longitude" />
+    <result column="LATITUDE" jdbcType="DECIMAL" property="latitude" />
+    <result column="STATUS" jdbcType="DECIMAL" property="status" />
+    <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
+    <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
+    <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
+    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
+  </resultMap>
+  <sql id="columns">
+    VERTEX_ID, ADDRESS_NAME, LONGITUDE, LATITUDE, STATUS, INSERT_USERNAME, INSERT_TIME,
+    UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK
+  </sql>
+  <sql id="columns_alias">
+    t.VERTEX_ID, t.ADDRESS_NAME, t.LONGITUDE, t.LATITUDE, t.STATUS, t.INSERT_USERNAME,
+    t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns" /> FROM MAP_VERTEX
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias" /> FROM MAP_VERTEX t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="vertexId != null">
+        and VERTEX_ID = #{vertexId}
+      </if>
+      <if test="addressName != null and addressName != ''">
+        and ADDRESS_NAME = #{addressName}
+      </if>
+      <if test="longitude != null">
+        and LONGITUDE = #{longitude}
+      </if>
+      <if test="latitude != null">
+        and LATITUDE = #{latitude}
+      </if>
+      <if test="status != null">
+        and STATUS = #{status}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="vertexId != null">
+        and VERTEX_ID = #{vertexId}
+      </if>
+      <if test="addressName != null and addressName != ''">
+        and ADDRESS_NAME LIKE '%${addressName}%'
+      </if>
+      <if test="longitude != null">
+        and LONGITUDE = #{longitude}
+      </if>
+      <if test="latitude != null">
+        and LATITUDE = #{latitude}
+      </if>
+      <if test="status != null">
+        and STATUS = #{status}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME LIKE '%${insertUsername}%'
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME LIKE '%${updateUsername}%'
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+    delete from MAP_VERTEX
+    where VERTEX_ID = #{vertexId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from MAP_VERTEX
+    where 1!=1 
+      <if test="addressName != null and addressName != ''">
+        or ADDRESS_NAME = #{addressName}
+      </if>
+      <if test="longitude != null">
+        or LONGITUDE = #{longitude}
+      </if>
+      <if test="latitude != null">
+        or LATITUDE = #{latitude}
+      </if>
+      <if test="status != null">
+        or STATUS = #{status}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        or INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        or UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.inPlantNavigation.model.MapVertex">
+    insert into MAP_VERTEX (VERTEX_ID, ADDRESS_NAME, LONGITUDE,
+      LATITUDE, STATUS, INSERT_USERNAME, 
+      INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, 
+      INSERT_UPDATE_REMARK)
+    values (#{vertexId,jdbcType=DECIMAL}, #{addressName,jdbcType=VARCHAR}, #{longitude,jdbcType=DECIMAL},
+      #{latitude,jdbcType=DECIMAL}, #{status,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, 
+      #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, 
+      #{insertUpdateRemark,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.inPlantNavigation.model.MapVertex">
+    insert into MAP_VERTEX
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="vertexId != null">
+        VERTEX_ID,
+      </if>
+      <if test="addressName != null">
+        ADDRESS_NAME,
+      </if>
+      <if test="longitude != null">
+        LONGITUDE,
+      </if>
+      <if test="latitude != null">
+        LATITUDE,
+      </if>
+      <if test="status != null">
+        STATUS,
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME,
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME,
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME,
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME,
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="vertexId != null">
+        #{vertexId,jdbcType=DECIMAL},
+      </if>
+      <if test="addressName != null">
+        #{addressName,jdbcType=VARCHAR},
+      </if>
+      <if test="longitude != null">
+        #{longitude,jdbcType=DECIMAL},
+      </if>
+      <if test="latitude != null">
+        #{latitude,jdbcType=DECIMAL},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=DECIMAL},
+      </if>
+      <if test="insertUsername != null">
+        #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.inPlantNavigation.model.MapVertex">
+    update MAP_VERTEX
+    set ADDRESS_NAME = #{addressName,jdbcType=VARCHAR},
+      LONGITUDE = #{longitude,jdbcType=DECIMAL},
+      LATITUDE = #{latitude,jdbcType=DECIMAL},
+      STATUS = #{status,jdbcType=DECIMAL},
+      INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+      INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+      UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR}
+    where VERTEX_ID = #{vertexId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.inPlantNavigation.model.MapVertex">
+    update MAP_VERTEX
+    <set>
+      <if test="addressName != null">
+        ADDRESS_NAME = #{addressName,jdbcType=VARCHAR},
+      </if>
+      <if test="longitude != null">
+        LONGITUDE = #{longitude,jdbcType=DECIMAL},
+      </if>
+      <if test="latitude != null">
+        LATITUDE = #{latitude,jdbcType=DECIMAL},
+      </if>
+      <if test="status != null">
+        STATUS = #{status,jdbcType=DECIMAL},
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where VERTEX_ID = #{vertexId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <include refid="select" />
+    where VERTEX_ID = #{vertexId,jdbcType=DECIMAL}
+  </select>
+  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select" />
+    <include refid="where" />
+  </select>
+  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select" />
+    <include refid="whereLike" />
+  </select>
+  <insert id="batchInsert" parameterType="java.util.List">
+    insert into MAP_VERTEX 
+      (VERTEX_ID, 
+      ADDRESS_NAME, LONGITUDE, LATITUDE,
+      STATUS, INSERT_USERNAME, INSERT_TIME, 
+      UPDATE_USERNAME, UPDATE_TIME, 
+      INSERT_UPDATE_REMARK)
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.vertexId,jdbcType=DECIMAL}, 
+      #{item.addressName,jdbcType=VARCHAR}, #{item.longitude,jdbcType=DECIMAL}, #{item.latitude,jdbcType=DECIMAL},
+      #{item.status,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP}, 
+      #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, 
+      #{item.insertUpdateRemark,jdbcType=VARCHAR} from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update MAP_VERTEX
+     set
+       VERTEX_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case VERTEX_ID" separator=" ">
+          when #{item.vertexId,jdbcType=DECIMAL} then #{item.vertexId,jdbcType=DECIMAL}
+       </foreach>
+       ,ADDRESS_NAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case VERTEX_ID" separator=" ">
+          when #{item.vertexId,jdbcType=DECIMAL} then #{item.addressName,jdbcType=VARCHAR}
+       </foreach>
+       ,LONGITUDE=
+       <foreach close="end" collection="list" index="index" item="item" open="case VERTEX_ID" separator=" ">
+          when #{item.vertexId,jdbcType=DECIMAL} then #{item.longitude,jdbcType=DECIMAL}
+       </foreach>
+       ,LATITUDE=
+       <foreach close="end" collection="list" index="index" item="item" open="case VERTEX_ID" separator=" ">
+          when #{item.vertexId,jdbcType=DECIMAL} then #{item.latitude,jdbcType=DECIMAL}
+       </foreach>
+       ,STATUS=
+       <foreach close="end" collection="list" index="index" item="item" open="case VERTEX_ID" separator=" ">
+          when #{item.vertexId,jdbcType=DECIMAL} then #{item.status,jdbcType=DECIMAL}
+       </foreach>
+       ,INSERT_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case VERTEX_ID" separator=" ">
+          when #{item.vertexId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case VERTEX_ID" separator=" ">
+          when #{item.vertexId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,UPDATE_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case VERTEX_ID" separator=" ">
+          when #{item.vertexId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case VERTEX_ID" separator=" ">
+          when #{item.vertexId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_UPDATE_REMARK=
+       <foreach close="end" collection="list" index="index" item="item" open="case VERTEX_ID" separator=" ">
+          when #{item.vertexId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+       </foreach>
+     where VERTEX_ID in 
+     <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+    #{item.vertexId,jdbcType=DECIMAL}
+     </foreach> 
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from MAP_VERTEX
+    where VERTEX_ID in 
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+  <select id="findAllAvailable" resultMap="BaseResultMap">
+    SELECT * FROM MAP_VERTEX WHERE STATUS=0
+  </select>
+</mapper>