1
1

2 Коммиты 607d735c02 ... c78cfdc1ab

Автор SHA1 Сообщение Дата
  bc_zhang c78cfdc1ab experimrentkg 4 лет назад
  bc_zhang d3702f3c39 experimrentkg 4 лет назад
44 измененных файлов с 585 добавлено и 470 удалено
  1. 10 0
      src/main/java/com/zglc/kg/controller/AlgorithmCallController.java
  2. 9 0
      src/main/java/com/zglc/kg/controller/ExperimentController.java
  3. 151 151
      src/main/java/com/zglc/kg/controller/MovieController.java
  4. 29 0
      src/main/java/com/zglc/kg/dao/AlgorithmCall1Dao.java
  5. 3 0
      src/main/java/com/zglc/kg/dao/AlgorithmCallDao.java
  6. 12 0
      src/main/java/com/zglc/kg/dao/AlgorithmResultsRelationDao.java
  7. 16 0
      src/main/java/com/zglc/kg/dao/Experiment1Dao.java
  8. 12 0
      src/main/java/com/zglc/kg/dao/ExperimentAlgorithmRelationDao.java
  9. 3 0
      src/main/java/com/zglc/kg/dao/ExperimentDao.java
  10. 6 239
      src/main/java/com/zglc/kg/entity/Algorithm1Entity.java
  11. 43 0
      src/main/java/com/zglc/kg/entity/AlgorithmCall1Entity.java
  12. 4 4
      src/main/java/com/zglc/kg/entity/AlgorithmCallEntity.java
  13. 41 50
      src/main/java/com/zglc/kg/entity/AlgorithmEntity.java
  14. 26 0
      src/main/java/com/zglc/kg/entity/AlgorithmResultsRelationEntity.java
  15. 58 0
      src/main/java/com/zglc/kg/entity/Experiment1Entity.java
  16. 26 0
      src/main/java/com/zglc/kg/entity/ExperimentAlgorithmRelationEntity.java
  17. 64 7
      src/main/java/com/zglc/kg/service/AlgorithmCallService.java
  18. 14 18
      src/main/java/com/zglc/kg/service/AlgorithmService.java
  19. 42 1
      src/main/java/com/zglc/kg/service/ExperimentService.java
  20. 4 0
      src/main/resources/mapping/AlgorithmCallDao.xml
  21. 4 0
      src/main/resources/mapping/ExperimentDao.xml
  22. BIN
      target/classes/com/zglc/kg/controller/AlgorithmCallController.class
  23. BIN
      target/classes/com/zglc/kg/controller/ExperimentController.class
  24. BIN
      target/classes/com/zglc/kg/controller/MovieController.class
  25. BIN
      target/classes/com/zglc/kg/dao/AlgorithmCall1Dao.class
  26. BIN
      target/classes/com/zglc/kg/dao/AlgorithmCallDao.class
  27. BIN
      target/classes/com/zglc/kg/dao/AlgorithmResultsRelationDao.class
  28. BIN
      target/classes/com/zglc/kg/dao/Experiment1Dao.class
  29. BIN
      target/classes/com/zglc/kg/dao/ExperimentAlgorithmRelationDao.class
  30. BIN
      target/classes/com/zglc/kg/dao/ExperimentDao.class
  31. BIN
      target/classes/com/zglc/kg/entity/Algorithm1Entity.class
  32. BIN
      target/classes/com/zglc/kg/entity/AlgorithmCall1Entity.class
  33. BIN
      target/classes/com/zglc/kg/entity/AlgorithmCallEntity.class
  34. BIN
      target/classes/com/zglc/kg/entity/AlgorithmEntity.class
  35. BIN
      target/classes/com/zglc/kg/entity/AlgorithmResultsRelationEntity.class
  36. BIN
      target/classes/com/zglc/kg/entity/Experiment1Entity.class
  37. BIN
      target/classes/com/zglc/kg/entity/ExperimentAlgorithmRelationEntity.class
  38. BIN
      target/classes/com/zglc/kg/service/AlgorithmCallService.class
  39. BIN
      target/classes/com/zglc/kg/service/AlgorithmService.class
  40. BIN
      target/classes/com/zglc/kg/service/ExperimentService.class
  41. 4 0
      target/classes/mapping/AlgorithmCallDao.xml
  42. 4 0
      target/classes/mapping/ExperimentDao.xml
  43. BIN
      target/kg-1.0.jar
  44. BIN
      target/kg-1.0.jar.original

+ 10 - 0
src/main/java/com/zglc/kg/controller/AlgorithmCallController.java

@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import java.util.List;
+import java.util.Map;
 
 @Api(tags = "算法调用记录管理接口")
 @RequestMapping("api/algorithmCall")
@@ -101,4 +102,13 @@ public class AlgorithmCallController {
     @PostMapping("edit")
     public Result<String> edit( @RequestBody AlgorithmCallEntity data){return  algorithmCallService.edit(data);}
 
+    @ApiOperation("按实验id查看图谱")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("findExperimentKg")
+    public Result<Map<String, Object>> findExperimentKg(Integer experimentId){
+        return algorithmCallService.findExperimentKg(experimentId);
+    }
+
 }

+ 9 - 0
src/main/java/com/zglc/kg/controller/ExperimentController.java

@@ -83,4 +83,13 @@ public class ExperimentController {
     @PostMapping("edit")
     public Result<String> edit( @RequestBody ExperimentEntity data){return  experimentService.edit(data);}
 
+    @ApiOperation("删除实验节点")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("deleteExperiment")
+    public Result<String> deleteExperiment(@RequestParam Long id){
+        return  experimentService.deleteExperiment(id);
+    }
+
 }

+ 151 - 151
src/main/java/com/zglc/kg/controller/MovieController.java

@@ -1,157 +1,157 @@
-package com.zglc.kg.controller;
-
-import com.zglc.kg.base.Result;
-import com.zglc.kg.entity.MovieEntity;
-import com.zglc.kg.entity.PersonEntity;
-import com.zglc.kg.entity.BaseRelationEntity;
-import com.zglc.kg.service.MovieService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import org.springframework.http.MediaType;
-import org.springframework.web.bind.annotation.*;
-
-import org.neo4j.driver.Driver;
-import org.neo4j.driver.Session;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-@Api(tags = "电影图谱接口")
-@RequestMapping("api/movie")
-@CrossOrigin(allowCredentials = "true")
-@RestController
-public class MovieController {
-    @Resource
-    private MovieService movieService;
-
-    private final Driver neo4jDriver;
-
-    public MovieController(Driver neo4jDriver) {
-        this.neo4jDriver = neo4jDriver;
-    }
-
-
-
-    @ApiOperation("增加电影节点")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("addMovie")
-    public Result<String> addMovie(@RequestBody MovieEntity movieEntity){
-        return movieService.addMovie(movieEntity);
-    }
-
-    @ApiOperation("增加人物节点")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("addPerson")
-    public Result<String> addPerson(@RequestBody PersonEntity personEntity){
-        return movieService.addPerson(personEntity);
-    }
-
-    @ApiOperation("增加关系")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("addRelation")
-    public Result<String> addRelation(@RequestBody BaseRelationEntity baseRelationEntity){
-        return movieService.addRelation(baseRelationEntity);
-    }
-
-
-    @ApiOperation("删除关系")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("deleteRelation")
-    public Result<String> deleteRelation(@RequestParam Long id){
-        return movieService.deleteRelation(id);
-    }
-
-    @ApiOperation("查看电影节点")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("getMovieById")
-    public Result<MovieEntity> getMovieById(@RequestParam Long id){
-        return  Result.success(movieService.getMovieById(id));
-    }
-
-    @ApiOperation("查看人物节点")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("getPersonById")
-    public Result<PersonEntity> getPersonById(@RequestParam Long id){
-        return  Result.success(movieService.getPersonById(id));
-    }
-
-    @ApiOperation("删除电影节点")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("deleteMovie")
-    public Result<String> deleteMovie(@RequestParam Long id){
-        return  movieService.deleteMovie(id);
-    }
-//    public Result<String> deleteMovie(@RequestBody DeleteEntity deleteEntity){return  movieService.deleteMovie(deleteEntity.getIds());}
-
-    @ApiOperation("删除人物节点")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("deletePerson")
-    public Result<String> deletePerson(@RequestParam Long id){
-        return  movieService.deletePerson(id);
-    }
-
-    @ApiOperation("根据名称查询电影")//完全一致
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("getMovieByTitle")
-    public Result<List<BaseRelationEntity>>  getMovieByTitle(@RequestParam String name){
-        return  movieService.getMovieByPerson(name);
-    }
-
-    @ApiOperation("根据名称查询电影1")//完全一致
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("getMovieByTitle1")
-    public Result<List<BaseRelationEntity>>  getMovieByTitle1(@RequestParam String name){
-        return  movieService.getMovieByPerson1(name);
-    }
-
-//    MATCH (tom:Person {name: "Tom Hanks"})-[:ACTED_IN]->(tomHanksMovies) RETURN tom,tomHanksMovies
-
-
-//    @ApiOperation("查询演员所演电影")//完全一致
+//package com.zglc.kg.controller;
+//
+//import com.zglc.kg.base.Result;
+//import com.zglc.kg.entity.MovieEntity;
+//import com.zglc.kg.entity.PersonEntity;
+//import com.zglc.kg.entity.BaseRelationEntity;
+//import com.zglc.kg.service.MovieService;
+//import io.swagger.annotations.Api;
+//import io.swagger.annotations.ApiOperation;
+//import io.swagger.annotations.ApiResponse;
+//import io.swagger.annotations.ApiResponses;
+//import org.springframework.http.MediaType;
+//import org.springframework.web.bind.annotation.*;
+//
+//import org.neo4j.driver.Driver;
+//import org.neo4j.driver.Session;
+//
+//import javax.annotation.Resource;
+//import java.util.List;
+//
+//@Api(tags = "电影图谱接口")
+//@RequestMapping("api/movie")
+//@CrossOrigin(allowCredentials = "true")
+//@RestController
+//public class MovieController {
+//    @Resource
+//    private MovieService movieService;
+//
+//    private final Driver neo4jDriver;
+//
+//    public MovieController(Driver neo4jDriver) {
+//        this.neo4jDriver = neo4jDriver;
+//    }
+//
+//
+//
+//    @ApiOperation("增加电影节点")
+//    @ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @PostMapping("addMovie")
+//    public Result<String> addMovie(@RequestBody MovieEntity movieEntity){
+//        return movieService.addMovie(movieEntity);
+//    }
+//
+//    @ApiOperation("增加人物节点")
+//    @ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @PostMapping("addPerson")
+//    public Result<String> addPerson(@RequestBody PersonEntity personEntity){
+//        return movieService.addPerson(personEntity);
+//    }
+//
+//    @ApiOperation("增加关系")
+//    @ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @PostMapping("addRelation")
+//    public Result<String> addRelation(@RequestBody BaseRelationEntity baseRelationEntity){
+//        return movieService.addRelation(baseRelationEntity);
+//    }
+//
+//
+//    @ApiOperation("删除关系")
+//    @ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @PostMapping("deleteRelation")
+//    public Result<String> deleteRelation(@RequestParam Long id){
+//        return movieService.deleteRelation(id);
+//    }
+//
+//    @ApiOperation("查看电影节点")
+//    @ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @GetMapping("getMovieById")
+//    public Result<MovieEntity> getMovieById(@RequestParam Long id){
+//        return  Result.success(movieService.getMovieById(id));
+//    }
+//
+//    @ApiOperation("查看人物节点")
 //    @ApiResponses({
 //            @ApiResponse(code = 0, message = "成功")
 //    })
-//    @GetMapping("getMovieByPerson")
-//    public  Result<MovieEntity> getMovieByPerson(@RequestParam String name){
+//    @GetMapping("getPersonById")
+//    public Result<PersonEntity> getPersonById(@RequestParam Long id){
+//        return  Result.success(movieService.getPersonById(id));
+//    }
+//
+//    @ApiOperation("删除电影节点")
+//    @ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @GetMapping("deleteMovie")
+//    public Result<String> deleteMovie(@RequestParam Long id){
+//        return  movieService.deleteMovie(id);
+//    }
+////    public Result<String> deleteMovie(@RequestBody DeleteEntity deleteEntity){return  movieService.deleteMovie(deleteEntity.getIds());}
+//
+//    @ApiOperation("删除人物节点")
+//    @ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @GetMapping("deletePerson")
+//    public Result<String> deletePerson(@RequestParam Long id){
+//        return  movieService.deletePerson(id);
+//    }
+//
+//    @ApiOperation("根据名称查询电影")//完全一致
+//    @ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @GetMapping("getMovieByTitle")
+//    public Result<List<BaseRelationEntity>>  getMovieByTitle(@RequestParam String name){
+//        return  movieService.getMovieByPerson(name);
+//    }
+//
+//    @ApiOperation("根据名称查询电影1")//完全一致
+//    @ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @GetMapping("getMovieByTitle1")
+//    public Result<List<BaseRelationEntity>>  getMovieByTitle1(@RequestParam String name){
+//        return  movieService.getMovieByPerson1(name);
+//    }
+//
+////    MATCH (tom:Person {name: "Tom Hanks"})-[:ACTED_IN]->(tomHanksMovies) RETURN tom,tomHanksMovies
+//
+//
+////    @ApiOperation("查询演员所演电影")//完全一致
+////    @ApiResponses({
+////            @ApiResponse(code = 0, message = "成功")
+////    })
+////    @GetMapping("getMovieByPerson")
+////    public  Result<MovieEntity> getMovieByPerson(@RequestParam String name){
+////        try (Session session = neo4jDriver.session()) {
+////            return session.run("MATCH (tom:Person {name: \"Tom Hanks\"})-[:ACTED_IN]->(tomHanksMovies) RETURN tom,tomHanksMovies");
+////        }
+////
+////        return  Result.success(movieService.getMovieByTitle(name));
+////    }
+//
+//
+//    @GetMapping(path = "/movies", produces = MediaType.APPLICATION_JSON_VALUE)
+//    public List<String> getMovieTitles() {
+////        Driver driver = GraphDatabase.driver( "bolt://localhost:7687", AuthTokens.basic( "neo4j", "neo4j" ) );
 //        try (Session session = neo4jDriver.session()) {
-//            return session.run("MATCH (tom:Person {name: \"Tom Hanks\"})-[:ACTED_IN]->(tomHanksMovies) RETURN tom,tomHanksMovies");
+//            return session.run("MATCH (m:Movie) RETURN m ORDER BY m.name ASC")
+//                    .list(r -> r.get("m").asNode().get("title").asString());
 //        }
-//
-//        return  Result.success(movieService.getMovieByTitle(name));
 //    }
-
-
-    @GetMapping(path = "/movies", produces = MediaType.APPLICATION_JSON_VALUE)
-    public List<String> getMovieTitles() {
-//        Driver driver = GraphDatabase.driver( "bolt://localhost:7687", AuthTokens.basic( "neo4j", "neo4j" ) );
-        try (Session session = neo4jDriver.session()) {
-            return session.run("MATCH (m:Movie) RETURN m ORDER BY m.name ASC")
-                    .list(r -> r.get("m").asNode().get("title").asString());
-        }
-    }
-
-
-
-}
+//
+//
+//
+//}

+ 29 - 0
src/main/java/com/zglc/kg/dao/AlgorithmCall1Dao.java

@@ -0,0 +1,29 @@
+package com.zglc.kg.dao;
+
+import com.zglc.kg.entity.ExperimentAlgorithmRelationEntity;
+import com.zglc.kg.entity.AlgorithmCall1Entity;
+import com.zglc.kg.entity.AlgorithmResultsRelationEntity;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.data.neo4j.annotation.Query;
+import org.springframework.data.neo4j.repository.Neo4jRepository;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface AlgorithmCall1Dao extends Neo4jRepository<AlgorithmCall1Entity,Long> {
+
+    AlgorithmCall1Entity getAlgorithmCall1EntitiesByMysqlId(Integer id);
+
+    @Query("MATCH (n:device)-[r]-() WHERE n.mysql_id={id} DELETE n,r")
+    void deleteNR(@Param("id") Integer id);
+
+    @Query("match p= (ne:experiment)-[re:RelationEA]->(na:algorithm) WHERE ne.mysql_id={name} return p")
+    List<ExperimentAlgorithmRelationEntity> findExperimentAlgorithmReById(@Param("name") Integer name);
+
+    @Query("match p= (na:algorithm)-[re:RelationAR]->(nr:algorithmCall) WHERE nr.experiment_id={name} return p")
+    List<AlgorithmResultsRelationEntity> findAlgorithmResultsReById(@Param("name") Integer name);
+
+
+}
+

+ 3 - 0
src/main/java/com/zglc/kg/dao/AlgorithmCallDao.java

@@ -15,4 +15,7 @@ public interface AlgorithmCallDao extends Mapper<AlgorithmCallEntity> {
 //    Integer getCount();
 
     List<AlgorithmCallEntity> getByResult(@Param("name") String name);
+
+    AlgorithmCallEntity getLastInsert();
+
 }

+ 12 - 0
src/main/java/com/zglc/kg/dao/AlgorithmResultsRelationDao.java

@@ -0,0 +1,12 @@
+package com.zglc.kg.dao;
+
+import com.zglc.kg.entity.AlgorithmResultsRelationEntity;
+import org.springframework.data.neo4j.repository.Neo4jRepository;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface AlgorithmResultsRelationDao extends Neo4jRepository<AlgorithmResultsRelationEntity,Long> {
+
+
+}
+

+ 16 - 0
src/main/java/com/zglc/kg/dao/Experiment1Dao.java

@@ -0,0 +1,16 @@
+package com.zglc.kg.dao;
+
+import com.zglc.kg.entity.Experiment1Entity;
+import org.springframework.data.neo4j.repository.Neo4jRepository;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface Experiment1Dao extends Neo4jRepository<Experiment1Entity,Long> {
+
+    Experiment1Entity getExperiment1EntitiesByMysqlId(Integer id);
+
+
+
+
+}
+

+ 12 - 0
src/main/java/com/zglc/kg/dao/ExperimentAlgorithmRelationDao.java

@@ -0,0 +1,12 @@
+package com.zglc.kg.dao;
+
+import com.zglc.kg.entity.ExperimentAlgorithmRelationEntity;
+import org.springframework.data.neo4j.repository.Neo4jRepository;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface ExperimentAlgorithmRelationDao extends Neo4jRepository<ExperimentAlgorithmRelationEntity,Long> {
+
+
+}
+

+ 3 - 0
src/main/java/com/zglc/kg/dao/ExperimentDao.java

@@ -16,4 +16,7 @@ public interface ExperimentDao extends Mapper<ExperimentEntity> {
 
     List<ExperimentEntity> findByName(@Param("name") String name);
 
+    ExperimentEntity getLastInsert();
+
+
 }

+ 6 - 239
src/main/java/com/zglc/kg/entity/Algorithm1Entity.java

@@ -25,256 +25,23 @@ public class Algorithm1Entity {
     @Property(name = "name")
     private String name;
 
-    @Property(name = "algorithm_method_name")
-    private String algorithmMethodName;
-
     @Property(name = "algorithm_format")
     private String algorithmFormat;
 
-    @Property(name = "algorithm_des")
-    private String algorithmDes;
+    @Property(name = "device_name")
+    private String deviceName;
 
     @Property(name = "create_time")
     private Date createTime;
 
-    @Property(name = "create_user")
-    private String createUser;
-
-    @Property(name = "is_enable")
-    private Integer isEnable;
-
-    @Property(name = "parent_id")
-    private Integer parentId;
-
-    @Property(name = "is_fusion_method")
-    private String isFusionMethod;
-
-    @Property(name = "assess_method")
-    private String assessMethod;
-
-    @Property(name = "assess_model")
-    private String assessModel;
-
-    @Property(name = "environment_load")
-    private String environmentLoad;
-
-    @Property(name = "show_type")
-    private String showType;
-
-    @Property(name = "r_type")
-    private String rType;
-
-    @Property(name = "m_type")
-    private String mType;
-
-    @Property(name = "data_file_path")
-    private String dataFilePath;
-
-    @Property(name = "is_zh")
-    private Integer isZh;
-
-    @Property(name = "apply_type")
-    private String applyType;
-
-    @Property(name = "is_open")
-    private String isOpen;
+    @Property(name = "algorithm_path")
+    private String algorithmPath;
 
-    @Property(name = "is_algorithm_model")
-    private String isAlgorithmModel;
+    @Property(name = "remarks")
+    private String remarks;
 
     @Property(name = "mysql_id")
     private Integer mysqlId;
 
-//    public Algorithm1Entity() {
-//    }
-//
-//    public Algorithm1Entity(Long id,String algorithmType, String algorithmTitle, String algorithmMethodName,String algorithmFormat,String algorithmDes,
-//                            Date createTime,String createUser,Integer isEnable,Integer parentId,String isFusionMethod,String assessMethod,
-//                            String assessModel,String environmentLoad,String showType,String rType,String mType,String dataFilePath,
-//                            Integer isZh,String applyType,String isOpen,String isAlgorithmModel,Integer mysqlId) {
-//        this.id = id;
-//        this.algorithmType = algorithmType;
-//        this.algorithmTitle = algorithmTitle;
-//        this.algorithmMethodName = algorithmMethodName;
-//        this.algorithmFormat = algorithmFormat;
-//        this.algorithmDes = algorithmDes;
-//        this.createTime = createTime;
-//        this.createUser = createUser;
-//        this.isEnable = isEnable;
-//        this.parentId = parentId;
-//        this.isFusionMethod = isFusionMethod;
-//        this.assessMethod = assessMethod;
-//        this.assessModel = assessModel;
-//        this.environmentLoad = environmentLoad;
-//        this.showType = showType;
-//        this.rType = rType;
-//        this.mType = mType;
-//        this.dataFilePath = dataFilePath;
-//        this.isZh = isZh;
-//        this.applyType = applyType;
-//        this.isOpen = isOpen;
-//        this.isAlgorithmModel = isAlgorithmModel;
-//        this.mysqlId = mysqlId;
-//    }
-//
-//    public Long getId() {
-//        return id;
-//    }
-//    public void setId(Long id) {
-//        this.id = id;
-//    }
-//
-//    public String getAlgorithmType() {
-//        return algorithmType;
-//    }
-//    public void setAlgorithmType(String algorithmType) {
-//        this.algorithmType = algorithmType;
-//    }
-//
-//    public String getAlgorithmTitle() {
-//        return algorithmTitle;
-//    }
-//    public void setAlgorithmTitle(String algorithmTitle) {
-//        this.algorithmTitle = algorithmTitle;
-//    }
-//
-//    public String getAlgorithmMethodName() {
-//        return algorithmMethodName;
-//    }
-//    public void setAlgorithmMethodName(String algorithmMethodName) {
-//        this.algorithmMethodName = algorithmMethodName;
-//    }
-//
-//    public String getAlgorithmFormat() {
-//        return algorithmFormat;
-//    }
-//    public void setAlgorithmFormat(String algorithmFormat) {
-//        this.algorithmFormat = algorithmFormat;
-//    }
-//
-//    public void setAlgorithmDes(String algorithmDes) {
-//        this.algorithmDes = algorithmDes;
-//    }
-//    public String getAlgorithmDes() {
-//        return algorithmDes;
-//    }
-//
-//    public void setCreateTime(Date createTime) {
-//        this.createTime = createTime;
-//    }
-//    public Date getCreateTime() {
-//        return createTime;
-//    }
-//
-//    public void setCreateUser(String createUser) {
-//        this.createUser = createUser;
-//    }
-//    public String getCreateUser() {
-//        return createUser;
-//    }
-//
-//    public void setIsEnable(Integer isEnable) {
-//        this.isEnable = isEnable;
-//    }
-//    public Integer getIsEnable() {
-//        return isEnable;
-//    }
-//
-//    public void setParentId(Integer parentId) {
-//        this.parentId = parentId;
-//    }
-//    public Integer getParentId() {
-//        return parentId;
-//    }
-//
-//    public void setIsFusionMethod(String isFusionMethod) {
-//        this.isFusionMethod = isFusionMethod;
-//    }
-//    public String getIsFusionMethod() {
-//        return isFusionMethod;
-//    }
-//
-//    public void setAssessMethod(String assessMethod) {
-//        this.assessMethod = assessMethod;
-//    }
-//    public String getAssessMethod() {
-//        return assessMethod;
-//    }
-//
-//    public void setAssessModel(String assessModel) {
-//        this.assessModel = assessModel;
-//    }
-//    public String getAssessModel() {
-//        return assessModel;
-//    }
-//
-//    public void setEnvironmentLoad(String environmentLoad) {
-//        this.environmentLoad = environmentLoad;
-//    }
-//    public String getEnvironmentLoad() {
-//        return environmentLoad;
-//    }
-//
-//    public void setShowType(String showType) {
-//        this.showType = showType;
-//    }    public String getShowType() {
-//        return showType;
-//    }
-//
-//    public void setrType(String rType) {
-//        this.rType = rType;
-//    }
-//    public String getrType() {
-//        return rType;
-//    }
-//
-//    public void setmType(String mType) {
-//        this.mType = mType;
-//    }
-//    public String getmType() {
-//        return mType;
-//    }
-//
-//    public void setDataFilePath(String dataFilePath) {
-//        this.dataFilePath = dataFilePath;
-//    }
-//    public String getDataFilePath() {
-//        return dataFilePath;
-//    }
-//
-//    public void setIsZh(Integer isZh) {
-//        this.isZh = isZh;
-//    }
-//    public Integer getIsZh() {
-//        return isZh;
-//    }
-//
-//    public void setApplyType(String applyType) {
-//        this.applyType = applyType;
-//    }
-//    public String getApplyType() {
-//        return applyType;
-//    }
-//
-//    public void setIsOpen(String isOpen) {
-//        this.isOpen = isOpen;
-//    }
-//    public String getIsOpen() {
-//        return isOpen;
-//    }
-//
-//    public void setIsAlgorithmModel(String isAlgorithmModel) {
-//        this.isAlgorithmModel = isAlgorithmModel;
-//    }
-//    public String getIsAlgorithmModel() {
-//        return isAlgorithmModel;
-//    }
-//
-//    public Integer getMysqlId() {
-//        return mysqlId;
-//    }
-//    public void setMysqlId(Integer mysqlId) {
-//        this.mysqlId = mysqlId;
-//    }
 
 }

+ 43 - 0
src/main/java/com/zglc/kg/entity/AlgorithmCall1Entity.java

@@ -0,0 +1,43 @@
+package com.zglc.kg.entity;
+
+import lombok.Data;
+
+import lombok.Getter;
+import lombok.Setter;
+import org.neo4j.ogm.annotation.NodeEntity;
+import org.neo4j.ogm.annotation.Property;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Getter
+@Setter
+@NodeEntity(label = "algorithmCall")
+public class AlgorithmCall1Entity {
+
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    @Property(name = "experiment_id")
+    private Integer experiment_id;
+
+    @Property(name = "algorithm_id")
+    private Integer algorithm_id;
+
+    @Property(name = "calling_time")
+    private Date calling_time;
+
+    @Property(name = "name")
+    private String name;
+
+    @Property(name = "diagnosis_results")
+    private String diagnosis_results;
+
+    @Property(name = "remarks")
+    private String remarks;
+
+    @Property(name = "mysql_id")
+    private Integer mysqlId;
+
+}

+ 4 - 4
src/main/java/com/zglc/kg/entity/AlgorithmCallEntity.java

@@ -23,11 +23,11 @@ public class AlgorithmCallEntity {
     @Column(name = "calling_time")
     private Date calling_time;
 
-    @Column(name = "param_value")
-    private String param_value;
+    @Column(name = "predict_results")
+    private String predict_results;
 
-    @Column(name = "results")
-    private String results;
+    @Column(name = "diagnosis_results")
+    private String diagnosis_results;
 
     @Column(name = "remarks")
     private String remarks;

+ 41 - 50
src/main/java/com/zglc/kg/entity/AlgorithmEntity.java

@@ -19,63 +19,54 @@ public class AlgorithmEntity {
     @Column(name = "algorithm_type")
     private String algorithm_type;
 
-    @Column(name = "algorithm_title")
-    private String algorithm_title;
+    @Column(name = "algorithm_name")
+    private String algorithm_name;
 
-    @Column(name = "algorithm_method_name")
-    private String algorithm_method_name;
+//    @Column(name = "algorithm_method_name")
+//    private String algorithm_method_name;
 
     @Column(name = "algorithm_format")
     private String algorithm_format;
 
-    @Column(name = "algorithm_des")
-    private String algorithm_des;
+    @Column(name = "device_name")
+    private String device_name;
 
     @Column(name = "create_time")
     private Date create_time;
 
-    @Column(name = "create_user")
-    private String create_user;
-
-    @Column(name = "is_enable")
-    private Integer is_enable;
-
-    @Column(name = "parent_id")
-    private Integer parent_id;
-
-    @Column(name = "is_fusion_method")
-    private String is_fusion_method;
-
-    @Column(name = "assess_method")
-    private String assess_method;
-
-    @Column(name = "assess_model")
-    private String assess_model;
-
-    @Column(name = "environment_load")
-    private String environment_load;
-
-    @Column(name = "show_type")
-    private String show_type;
-
-    @Column(name = "r_type")
-    private String r_type;
-
-    @Column(name = "m_type")
-    private String m_type;
-
-    @Column(name = "data_file_path")
-    private String data_file_path;
-
-    @Column(name = "is_zh")
-    private Integer is_zh;
-
-    @Column(name = "apply_type")
-    private String apply_type;
-
-    @Column(name = "is_open")
-    private String is_open;
-
-    @Column(name = "is_algorithm_model")
-    private String is_algorithm_model;
+//    @Column(name = "create_user")
+//    private String create_user;
+//
+//    @Column(name = "is_enable")
+//    private Integer is_enable;
+//
+//    @Column(name = "parent_id")
+//    private Integer parent_id;
+//
+//    @Column(name = "is_fusion_method")
+//    private String is_fusion_method;
+//
+//    @Column(name = "assess_method")
+//    private String assess_method;
+//
+//    @Column(name = "assess_model")
+//    private String assess_model;
+//
+//    @Column(name = "environment_load")
+//    private String environment_load;
+//
+//    @Column(name = "show_type")
+//    private String show_type;
+//
+//    @Column(name = "r_type")
+//    private String r_type;
+//
+//    @Column(name = "m_type")
+//    private String m_type;
+
+    @Column(name = "algorithm_path")
+    private String algorithm_path;
+
+    @Column(name = "remarks")
+    private String remarks;
 }

+ 26 - 0
src/main/java/com/zglc/kg/entity/AlgorithmResultsRelationEntity.java

@@ -0,0 +1,26 @@
+package com.zglc.kg.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+import org.neo4j.ogm.annotation.EndNode;
+import org.neo4j.ogm.annotation.Property;
+import org.neo4j.ogm.annotation.RelationshipEntity;
+import org.neo4j.ogm.annotation.StartNode;
+
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+@Getter
+@Setter
+@RelationshipEntity(type = "RelationAR")
+public class AlgorithmResultsRelationEntity {
+    @Id
+    @GeneratedValue
+    private Long id;
+    @StartNode
+    private Algorithm1Entity startNode;
+    @EndNode
+    private AlgorithmCall1Entity endNode;
+    @Property
+    private String relation;
+}

+ 58 - 0
src/main/java/com/zglc/kg/entity/Experiment1Entity.java

@@ -0,0 +1,58 @@
+package com.zglc.kg.entity;
+
+import lombok.Data;
+
+import lombok.Getter;
+import lombok.Setter;
+import org.neo4j.ogm.annotation.NodeEntity;
+import org.neo4j.ogm.annotation.Property;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Getter
+@Setter
+@NodeEntity(label = "experiment")
+public class Experiment1Entity {
+
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    @Property(name = "device_id")
+    private Integer device_id;
+
+    @Property(name = "device_name")
+    private String device_name;
+
+    @Property(name = "name")
+    private String name;
+
+    @Property(name = "start_time")
+    private Date start_time;
+
+    @Property(name = "end_time")
+    private Date end_time;
+
+    @Property(name = "data_type")
+    private String data_type;
+
+    @Property(name = "source_id")
+    private Integer source_id;
+
+    @Property(name = "origin_data_path")
+    private String origin_data_path;
+
+    @Property(name = "algorithm_id")
+    private Integer algorithm_id;
+
+    @Property(name = "algorithm_name")
+    private String algorithm_name;
+
+    @Property(name = "process_data_path")
+    private String process_data_path;
+
+    @Property(name = "mysql_id")
+    private Integer mysqlId;
+
+}

+ 26 - 0
src/main/java/com/zglc/kg/entity/ExperimentAlgorithmRelationEntity.java

@@ -0,0 +1,26 @@
+package com.zglc.kg.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+import org.neo4j.ogm.annotation.EndNode;
+import org.neo4j.ogm.annotation.Property;
+import org.neo4j.ogm.annotation.RelationshipEntity;
+import org.neo4j.ogm.annotation.StartNode;
+
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+@Getter
+@Setter
+@RelationshipEntity(type = "RelationEA")
+public class ExperimentAlgorithmRelationEntity {
+    @Id
+    @GeneratedValue
+    private Long id;
+    @StartNode
+    private Experiment1Entity startNode;
+    @EndNode
+    private Algorithm1Entity endNode;
+    @Property
+    private String relation;
+}

+ 64 - 7
src/main/java/com/zglc/kg/service/AlgorithmCallService.java

@@ -1,22 +1,35 @@
 package com.zglc.kg.service;
 
 import com.zglc.kg.base.Result;
-import com.zglc.kg.dao.AlgorithmCallDao;
-import com.zglc.kg.entity.AlgorithmCallEntity;
+import com.zglc.kg.dao.*;
+import com.zglc.kg.entity.*;
 import org.springframework.stereotype.Service;
 import tk.mybatis.mapper.entity.Example;
 
+import javax.annotation.Resource;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 
 @Service
 public class AlgorithmCallService {
-
+    @Resource
     private AlgorithmCallDao algorithmCallDao;
-
-    public AlgorithmCallService(AlgorithmCallDao algorithmCallDao) {
-        this.algorithmCallDao = algorithmCallDao;
-    }
+    @Resource
+    private AlgorithmCall1Dao algorithmCall1Dao;
+    @Resource
+    private AlgorithmDao algorithmDao;
+    @Resource
+    private Algorithm1Dao algorithm1Dao;
+    @Resource
+    private ExperimentDao experimentDao;
+    @Resource
+    private Experiment1Dao experiment1Dao;
+    @Resource
+    private ExperimentAlgorithmRelationDao experimentAlgorithmRelationDao;
+    @Resource
+    private AlgorithmResultsRelationDao algorithmResultsRelationDao;
 
     public List<AlgorithmCallEntity> listAll() {
         return algorithmCallDao.listAll();
@@ -31,6 +44,32 @@ public class AlgorithmCallService {
         boolean flag = true;
         String msg = "";
         int index = algorithmCallDao.insertSelective(data);
+//        AlgorithmEntity algorithm = algorithmDao.selectByPrimaryKey(data.getAlgorithm_id());
+//        ExperimentEntity experiment = experimentDao.selectByPrimaryKey(data.getExperiment_id());
+        //添加实验算法关系
+        ExperimentAlgorithmRelationEntity experimentAlgorithmRelation = new ExperimentAlgorithmRelationEntity();
+        Experiment1Entity experiment1 = experiment1Dao.getExperiment1EntitiesByMysqlId(data.getExperiment_id());
+        Algorithm1Entity algorithm1 = algorithm1Dao.getAlgorithm1EntitiesByMysqlId(data.getAlgorithm_id());
+        experimentAlgorithmRelation.setStartNode(experiment1);
+        experimentAlgorithmRelation.setEndNode(algorithm1);
+        experimentAlgorithmRelation.setRelation("调用");
+        experimentAlgorithmRelationDao.save(experimentAlgorithmRelation);
+        //添加算法和结果关系
+        AlgorithmResultsRelationEntity algorithmResultsRelationEntity = new AlgorithmResultsRelationEntity();
+        AlgorithmCallEntity algorithmCall = algorithmCallDao.getLastInsert();
+        AlgorithmCall1Entity algorithmCall1 = new AlgorithmCall1Entity();
+        algorithmCall1.setExperiment_id(algorithmCall.getExperiment_id());
+        algorithmCall1.setAlgorithm_id(algorithmCall.getAlgorithm_id());
+        algorithmCall1.setCalling_time(algorithmCall.getCalling_time());
+        algorithmCall1.setName(algorithmCall.getPredict_results());
+        algorithmCall1.setDiagnosis_results(algorithmCall.getDiagnosis_results());
+        algorithmCall1.setRemarks(algorithmCall.getRemarks());
+        algorithmCall1.setMysqlId(algorithmCall.getId());
+        AlgorithmResultsRelationEntity algorithmResultsRelation = new AlgorithmResultsRelationEntity();
+        algorithmResultsRelation.setStartNode(algorithm1);
+        algorithmResultsRelation.setEndNode(algorithmCall1);
+        algorithmResultsRelation.setRelation("结果");
+        algorithmResultsRelationDao.save(algorithmResultsRelation);
         if (index == 0) {
             flag = false;
             msg = "添加算法记录失败!";
@@ -48,6 +87,8 @@ public class AlgorithmCallService {
         while(iter.hasNext()) {
             Integer id = (Integer)iter.next();
             int index = algorithmCallDao.deleteByPrimaryKey(id);
+//            algorithmCall1Dao.deleteNR(id);
+
             if (index == 0) {
                 flag = false;
                 msg += "算法记录删除失败!" + id + ";";
@@ -64,6 +105,15 @@ public class AlgorithmCallService {
         AlgorithmCallEntity tmpData = algorithmCallDao.selectByPrimaryKey(data.getId());
         if (tmpData != null) {
             int index = algorithmCallDao.updateByPrimaryKeySelective(data);
+            AlgorithmCall1Entity algorithmCall1 = algorithmCall1Dao.getAlgorithmCall1EntitiesByMysqlId(data.getId());
+            algorithmCall1.setExperiment_id(data.getExperiment_id());
+            algorithmCall1.setAlgorithm_id(data.getAlgorithm_id());
+            algorithmCall1.setCalling_time(data.getCalling_time());
+            algorithmCall1.setName(data.getPredict_results());
+            algorithmCall1.setDiagnosis_results(data.getDiagnosis_results());
+            algorithmCall1.setRemarks(data.getRemarks());
+            algorithmCall1.setMysqlId(data.getId());
+            algorithmCall1Dao.save(algorithmCall1);
             if (index == 0) {
                 flag = false;
                 msg = "算法记录修改失败";
@@ -101,4 +151,11 @@ public class AlgorithmCallService {
         return algorithmCallDao.selectByExample(example);
     }
 
+    public Result<Map<String, Object>> findExperimentKg(Integer name){
+        Map<String, Object> map = new HashMap<>();
+//        if (type == null || "".equals(type) || "all".equals(type)){
+        map.put("ExperimentAlgorithmRe", algorithmCall1Dao.findExperimentAlgorithmReById(name));
+        map.put("AlgorithmResultsRe", algorithmCall1Dao.findAlgorithmResultsReById(name));
+        return Result.success(map);
+    }
 }

+ 14 - 18
src/main/java/com/zglc/kg/service/AlgorithmService.java

@@ -38,26 +38,12 @@ public class AlgorithmService {
         //加入机型节点
         Algorithm1Entity algorithm1 = new Algorithm1Entity();
         algorithm1.setAlgorithmType(data.getAlgorithm_type());
-        algorithm1.setName(data.getAlgorithm_title());
-        algorithm1.setAlgorithmMethodName(data.getAlgorithm_method_name());
+        algorithm1.setName(data.getAlgorithm_name());
+        algorithm1.setDeviceName(data.getDevice_name());
         algorithm1.setAlgorithmFormat(data.getAlgorithm_format());
-        algorithm1.setAlgorithmDes(data.getAlgorithm_des());
+        algorithm1.setAlgorithmPath(data.getAlgorithm_path());
         algorithm1.setCreateTime(data.getCreate_time());
-        algorithm1.setCreateUser(data.getCreate_user());
-        algorithm1.setIsEnable(data.getIs_enable());
-        algorithm1.setParentId(data.getParent_id());
-        algorithm1.setIsFusionMethod(data.getIs_fusion_method());
-        algorithm1.setAssessMethod(data.getAssess_method());
-        algorithm1.setAssessModel(data.getAssess_model());
-        algorithm1.setEnvironmentLoad(data.getEnvironment_load());
-        algorithm1.setShowType(data.getShow_type());
-        algorithm1.setRType(data.getR_type());
-        algorithm1.setMType(data.getM_type());
-        algorithm1.setDataFilePath(data.getData_file_path());
-        algorithm1.setIsZh(data.getIs_zh());
-        algorithm1.setApplyType(data.getApply_type());
-        algorithm1.setIsOpen(data.getIs_open());
-        algorithm1.setIsAlgorithmModel(data.getIs_algorithm_model());
+        algorithm1.setRemarks(data.getRemarks());
         algorithm1.setMysqlId(Algorithm2.getId());
         algorithm1Dao.save(algorithm1);
         if (index == 0) {
@@ -92,6 +78,16 @@ public class AlgorithmService {
         AlgorithmEntity tmpData = algorithmDao.selectByPrimaryKey(data.getId());
         if (tmpData != null) {
             int index = algorithmDao.updateByPrimaryKeySelective(data);
+            Algorithm1Entity algorithm1 = algorithm1Dao.getAlgorithm1EntitiesByMysqlId(data.getId());
+            algorithm1.setAlgorithmType(data.getAlgorithm_type());
+            algorithm1.setName(data.getAlgorithm_name());
+            algorithm1.setDeviceName(data.getDevice_name());
+            algorithm1.setAlgorithmFormat(data.getAlgorithm_format());
+            algorithm1.setAlgorithmPath(data.getAlgorithm_path());
+            algorithm1.setCreateTime(data.getCreate_time());
+            algorithm1.setRemarks(data.getRemarks());
+            algorithm1.setMysqlId(data.getId());
+            algorithm1Dao.save(algorithm1);
             if (index == 0) {
                 flag = false;
                 msg = "算法信息修改失败";

+ 42 - 1
src/main/java/com/zglc/kg/service/ExperimentService.java

@@ -1,20 +1,25 @@
 package com.zglc.kg.service;
 
 import com.zglc.kg.base.Result;
+import com.zglc.kg.dao.Experiment1Dao;
 import com.zglc.kg.dao.ExperimentDao;
+import com.zglc.kg.entity.Experiment1Entity;
 import com.zglc.kg.entity.ExperimentEntity;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import tk.mybatis.mapper.entity.Example;
 
+import javax.annotation.Resource;
 import java.util.Iterator;
 import java.util.List;
 
 @Service
 public class ExperimentService {
 
-    @Autowired
+    @Resource
     private ExperimentDao experimentDao;
+    @Resource
+    private Experiment1Dao experiment1Dao;
 
     public List<ExperimentEntity> listAll(){
         return experimentDao.listAll();
@@ -30,6 +35,23 @@ public class ExperimentService {
         boolean flag = true;
         String msg = "";
         int index = experimentDao.insertSelective(data);
+        //获取最新实验id
+        ExperimentEntity experiment2 = experimentDao.getLastInsert();
+        //加入实验节点
+        Experiment1Entity experiment1 = new Experiment1Entity();
+        experiment1.setDevice_id(data.getDevice_id());
+        experiment1.setDevice_name(data.getDevice_name());
+        experiment1.setName(data.getExperiment_name());
+        experiment1.setStart_time(data.getStart_time());
+        experiment1.setEnd_time(data.getEnd_time());
+        experiment1.setData_type(data.getData_type());
+        experiment1.setSource_id(data.getSource_id());
+        experiment1.setOrigin_data_path(data.getOrigin_data_path());
+        experiment1.setAlgorithm_id(data.getAlgorithm_id());
+        experiment1.setAlgorithm_name(data.getAlgorithm_name());
+        experiment1.setProcess_data_path(data.getProcess_data_path());
+        experiment1.setMysqlId(experiment2.getId());
+        experiment1Dao.save(experiment1);
         if (index == 0) {
             flag = false;
             msg = "添加实验信息失败!";
@@ -80,10 +102,29 @@ public class ExperimentService {
         return Result.result(flag, msg, msg);
     }
 
+    public Result<String> deleteExperiment(Long id) {
+        experiment1Dao.deleteById(id);
+        return Result.success("删除成功!");
+    }
+
     public Result<String> edit(ExperimentEntity data) {
         boolean flag = true;
         String msg = "";
         ExperimentEntity tmpData = experimentDao.selectByPrimaryKey(data.getId());
+        Experiment1Entity experiment1 = experiment1Dao.getExperiment1EntitiesByMysqlId(data.getId());
+        experiment1.setDevice_id(data.getDevice_id());
+        experiment1.setDevice_name(data.getDevice_name());
+        experiment1.setName(data.getExperiment_name());
+        experiment1.setStart_time(data.getStart_time());
+        experiment1.setEnd_time(data.getEnd_time());
+        experiment1.setData_type(data.getData_type());
+        experiment1.setSource_id(data.getSource_id());
+        experiment1.setOrigin_data_path(data.getOrigin_data_path());
+        experiment1.setAlgorithm_id(data.getAlgorithm_id());
+        experiment1.setAlgorithm_name(data.getAlgorithm_name());
+        experiment1.setProcess_data_path(data.getProcess_data_path());
+        experiment1.setMysqlId(data.getId());
+        experiment1Dao.save(experiment1);
         if (tmpData != null) {
             int index = experimentDao.updateByPrimaryKeySelective(data);
             if (index == 0) {

+ 4 - 0
src/main/resources/mapping/AlgorithmCallDao.xml

@@ -31,6 +31,10 @@
         where id > 1
     </select>
 
+    <select id="getLastInsert" resultMap="algorithmCallMap">
+        SELECT * FROM t_algorithm_call ORDER BY id DESC LIMIT 1
+    </select>
+
 <!--    <insert id="batchAdd" parameterType="java.util.List">-->
 <!--        <foreach collection="list" item="equ" separator=";">-->
 <!--            insert into t_equipment (equipment_type)-->

+ 4 - 0
src/main/resources/mapping/ExperimentDao.xml

@@ -37,4 +37,8 @@
         select min(id) from t_experiment
     </select>
 
+    <select id="getLastInsert" resultMap="experimentMap">
+        SELECT * FROM t_experiment ORDER BY id DESC LIMIT 1
+    </select>
+
 </mapper>

BIN
target/classes/com/zglc/kg/controller/AlgorithmCallController.class


BIN
target/classes/com/zglc/kg/controller/ExperimentController.class


BIN
target/classes/com/zglc/kg/controller/MovieController.class


BIN
target/classes/com/zglc/kg/dao/AlgorithmCall1Dao.class


BIN
target/classes/com/zglc/kg/dao/AlgorithmCallDao.class


BIN
target/classes/com/zglc/kg/dao/AlgorithmResultsRelationDao.class


BIN
target/classes/com/zglc/kg/dao/Experiment1Dao.class


BIN
target/classes/com/zglc/kg/dao/ExperimentAlgorithmRelationDao.class


BIN
target/classes/com/zglc/kg/dao/ExperimentDao.class


BIN
target/classes/com/zglc/kg/entity/Algorithm1Entity.class


BIN
target/classes/com/zglc/kg/entity/AlgorithmCall1Entity.class


BIN
target/classes/com/zglc/kg/entity/AlgorithmCallEntity.class


BIN
target/classes/com/zglc/kg/entity/AlgorithmEntity.class


BIN
target/classes/com/zglc/kg/entity/AlgorithmResultsRelationEntity.class


BIN
target/classes/com/zglc/kg/entity/Experiment1Entity.class


BIN
target/classes/com/zglc/kg/entity/ExperimentAlgorithmRelationEntity.class


BIN
target/classes/com/zglc/kg/service/AlgorithmCallService.class


BIN
target/classes/com/zglc/kg/service/AlgorithmService.class


BIN
target/classes/com/zglc/kg/service/ExperimentService.class


+ 4 - 0
target/classes/mapping/AlgorithmCallDao.xml

@@ -31,6 +31,10 @@
         where id > 1
     </select>
 
+    <select id="getLastInsert" resultMap="algorithmCallMap">
+        SELECT * FROM t_algorithm_call ORDER BY id DESC LIMIT 1
+    </select>
+
 <!--    <insert id="batchAdd" parameterType="java.util.List">-->
 <!--        <foreach collection="list" item="equ" separator=";">-->
 <!--            insert into t_equipment (equipment_type)-->

+ 4 - 0
target/classes/mapping/ExperimentDao.xml

@@ -37,4 +37,8 @@
         select min(id) from t_experiment
     </select>
 
+    <select id="getLastInsert" resultMap="experimentMap">
+        SELECT * FROM t_experiment ORDER BY id DESC LIMIT 1
+    </select>
+
 </mapper>

BIN
target/kg-1.0.jar


BIN
target/kg-1.0.jar.original