allen 2 rokov pred
rodič
commit
9d369c49fe
23 zmenil súbory, kde vykonal 1274 pridanie a 14 odobranie
  1. 6 0
      kgraph-graph/src/main/java/com/kgraph/graph/neo4j/domain/Entity.java
  2. 4 0
      kgraph-graph/src/main/java/com/kgraph/graph/neo4j/service/IKgService.java
  3. 82 0
      kgraph-graph/src/main/java/com/kgraph/graph/neo4j/service/impl/KgServiceImpl.java
  4. 122 0
      kgraph-graph/src/main/java/com/kgraph/graph/suport/controller/ExtractByHandController.java
  5. 104 0
      kgraph-graph/src/main/java/com/kgraph/graph/suport/controller/ExtractByHandDetailController.java
  6. 33 0
      kgraph-graph/src/main/java/com/kgraph/graph/suport/domain/ExtractByHand.java
  7. 83 0
      kgraph-graph/src/main/java/com/kgraph/graph/suport/domain/ExtractByHandDetail.java
  8. 16 0
      kgraph-graph/src/main/java/com/kgraph/graph/suport/dto/ExtractByHandDTO.java
  9. 15 0
      kgraph-graph/src/main/java/com/kgraph/graph/suport/dto/ExtractByHandDetailDTO.java
  10. 61 0
      kgraph-graph/src/main/java/com/kgraph/graph/suport/mapper/ExtractByHandDetailMapper.java
  11. 63 0
      kgraph-graph/src/main/java/com/kgraph/graph/suport/mapper/ExtractByHandMapper.java
  12. 63 0
      kgraph-graph/src/main/java/com/kgraph/graph/suport/service/IExtractByHandDetailService.java
  13. 66 0
      kgraph-graph/src/main/java/com/kgraph/graph/suport/service/IExtractByHandService.java
  14. 2 0
      kgraph-graph/src/main/java/com/kgraph/graph/suport/service/IExtractKnowledgeSubTaskService.java
  15. 96 0
      kgraph-graph/src/main/java/com/kgraph/graph/suport/service/impl/ExtractByHandDetailServiceImpl.java
  16. 142 0
      kgraph-graph/src/main/java/com/kgraph/graph/suport/service/impl/ExtractByHandServiceImpl.java
  17. 1 0
      kgraph-graph/src/main/java/com/kgraph/graph/suport/service/impl/ExtractKnowledgeSubTaskServiceImpl.java
  18. 14 14
      kgraph-graph/src/main/java/com/kgraph/graph/suport/service/impl/TCheckPiontServiceImpl.java
  19. 96 0
      kgraph-graph/src/main/java/com/kgraph/graph/suport/utils/ExtractByHandUtils.java
  20. 7 0
      kgraph-graph/src/main/resources/mapper/neo4j/EntityClassRelationMapper.xml
  21. 82 0
      kgraph-graph/src/main/resources/mapper/suport/ExtractByHandDetailMapper.xml
  22. 92 0
      kgraph-graph/src/main/resources/mapper/suport/ExtractByHandMapper.xml
  23. 24 0
      sql/update20230606.sql

+ 6 - 0
kgraph-graph/src/main/java/com/kgraph/graph/neo4j/domain/Entity.java

@@ -13,8 +13,14 @@ public class Entity {
     @Id
     @GeneratedValue
     private Long id;
+
+    // foreignId 暂时没用
+    @Deprecated
     @Property("foreignId")
     private String foreignId;
+
+    // code 暂时没用
+    @Deprecated
     @Property("code")
     private String code;
     @Property("name")

+ 4 - 0
kgraph-graph/src/main/java/com/kgraph/graph/neo4j/service/IKgService.java

@@ -3,7 +3,9 @@ package com.kgraph.graph.neo4j.service;
 import com.kgraph.graph.neo4j.DTO.KgDTO;
 import com.kgraph.graph.neo4j.domain.Neo4jRelation;
 import com.kgraph.graph.suport.domain.BuildEntityRelation;
+import com.kgraph.graph.suport.domain.ExtractByHand;
 import com.kgraph.graph.suport.dto.BuildEntityRelationDTO;
+import com.kgraph.graph.suport.dto.ExtractByHandDTO;
 
 import java.util.List;
 
@@ -29,4 +31,6 @@ public interface IKgService {
     void addEntityRelation(BuildEntityRelation buildEntityRelation);
 
     List<Neo4jRelation> getRelationByEntityId(Long id);
+
+    void save2Neo4j(List<ExtractByHandDTO> extractByHands);
 }

+ 82 - 0
kgraph-graph/src/main/java/com/kgraph/graph/neo4j/service/impl/KgServiceImpl.java

@@ -13,8 +13,13 @@ import com.kgraph.graph.neo4j.mapper.EntityRepository;
 import com.kgraph.graph.neo4j.mapper.RelationRepository;
 import com.kgraph.graph.neo4j.service.IKgService;
 import com.kgraph.graph.suport.domain.BuildEntityRelation;
+import com.kgraph.graph.suport.domain.ExtractByHand;
+import com.kgraph.graph.suport.domain.ExtractByHandDetail;
 import com.kgraph.graph.suport.dto.BuildEntityRelationDTO;
+import com.kgraph.graph.suport.dto.ExtractByHandDTO;
+import com.kgraph.graph.suport.dto.ExtractByHandDetailDTO;
 import com.kgraph.system.service.ISysDictDataService;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -326,4 +331,81 @@ public class KgServiceImpl implements IKgService {
         return relationRepository.getRelationByEntityId(id);
     }
 
+    @Override
+    public void save2Neo4j(List<ExtractByHandDTO> extractByHands) {
+
+        // 获取所有Class和ClassRelation
+        List<EntityClass> entityClasses = entityClassMapper.selectEntityClassList(new EntityClass());
+        Map<Long,String> classMap = entityClasses.stream()
+                .collect(Collectors.toMap(EntityClass::getId, EntityClass::getName));
+        List<EntityClassRelation> entityClassRelations = entityClassRelationMapper.selectEntityClassRelationList(new EntityClassRelation());
+
+        //构建entity
+        for (ExtractByHandDTO extractByHand : extractByHands) {
+            List<ExtractByHandDetailDTO> details = extractByHand.getDetails();
+            Map<Long, List<String>> entityMap = new HashMap<>();
+
+            for (ExtractByHandDetailDTO detail : details) {
+                entityMap.put(detail.getEntityClassId(), detail.getEntityList());
+            }
+
+            for (EntityClassRelation entityClassRelation : entityClassRelations) {
+                Long startId = entityClassRelation.getStartId();
+                List<String> startEntityStrList = entityMap.get(startId);
+                List<Entity> startEntityList = null;
+                if(CollectionUtils.isNotEmpty(startEntityStrList)){
+                    startEntityList = new ArrayList<>(startEntityStrList.size());
+                    for (String entityStr : startEntityStrList) {
+                        Entity entity = entityRepository.findByName(entityStr);
+                        if(entity == null){
+                            entity = new Entity();
+                            entity.setName(entityStr);
+
+                        }
+                        if(!entity.getLabels().contains(classMap.get(startId))){
+                            entity.getLabels().add(classMap.get(startId));
+                        }
+                        startEntityList.add(entity);
+                        entityRepository.save(entity);
+                    }
+                }
+
+
+                Long endId = entityClassRelation.getEndId();
+                List<String> endEntityStrList = entityMap.get(endId);
+                List<Entity> endEntityList = null;
+                if(CollectionUtils.isNotEmpty(endEntityStrList)){
+                    endEntityList = new ArrayList<>(endEntityStrList.size());
+                    for (String entityStr : endEntityStrList) {
+                        Entity entity = entityRepository.findByName(entityStr);
+                        if(entity == null){
+                            entity = new Entity();
+                            entity.setName(entityStr);
+
+                        }
+                        if(!entity.getLabels().contains(classMap.get(endId))){
+                            entity.getLabels().add(classMap.get(endId));
+                        }
+                        endEntityList.add(entity);
+                        entityRepository.save(entity);
+                    }
+                }
+                if(CollectionUtils.isNotEmpty(startEntityList) && CollectionUtils.isNotEmpty(endEntityList)){
+                    for (Entity startEntity : startEntityList) {
+                        for (Entity endEntity : endEntityList) {
+                            String relationName = entityClassRelation.getName();
+                            if(!relationExist(startEntity,endEntity, relationName)){
+                                Neo4jRelation relation = new Neo4jRelation();
+                                relation.setName(relationName);
+                                relation.setStartNode(startEntity);
+                                relation.setEndNode(endEntity);
+                                relationRepository.save(relation);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+
 }

+ 122 - 0
kgraph-graph/src/main/java/com/kgraph/graph/suport/controller/ExtractByHandController.java

@@ -0,0 +1,122 @@
+package com.kgraph.graph.suport.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.kgraph.graph.suport.dto.ExtractByHandDTO;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.kgraph.common.annotation.Log;;
+import com.kgraph.common.core.controller.BaseController;;
+import com.kgraph.common.core.domain.AjaxResult;;
+import com.kgraph.common.enums.BusinessType;;
+import com.kgraph.graph.suport.domain.ExtractByHand;
+import com.kgraph.graph.suport.service.IExtractByHandService;
+import com.kgraph.common.utils.poi.ExcelUtil;;
+import com.kgraph.common.core.page.TableDataInfo;;
+
+/**
+ * 手动构建Controller
+ * 
+ * @author Allen
+ * @date 2023-06-06
+ */
+@RestController
+@RequestMapping("/suport/hand")
+public class ExtractByHandController extends BaseController
+{
+    @Autowired
+    private IExtractByHandService extractByHandService;
+
+    /**
+     * 查询手动构建列表
+     */
+    @PreAuthorize("@ss.hasPermi('suport:hand:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(ExtractByHand extractByHand)
+    {
+        startPage();
+        List<ExtractByHand> list = extractByHandService.selectExtractByHandList(extractByHand);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出手动构建列表
+     */
+    @PreAuthorize("@ss.hasPermi('suport:hand:export')")
+    @Log(title = "手动构建", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, ExtractByHand extractByHand)
+    {
+        List<ExtractByHand> list = extractByHandService.selectExtractByHandList(extractByHand);
+        ExcelUtil<ExtractByHand> util = new ExcelUtil<ExtractByHand>(ExtractByHand.class);
+        util.exportExcel(response, list, "手动构建数据");
+    }
+
+    /**
+     * 获取手动构建详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('suport:hand:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(extractByHandService.selectExtractByHandById(id));
+    }
+
+    /**
+     * 新增手动构建
+     */
+    @PreAuthorize("@ss.hasPermi('suport:hand:add')")
+    @Log(title = "手动构建", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ExtractByHand extractByHand)
+    {
+        return toAjax(extractByHandService.insertExtractByHand(extractByHand));
+    }
+
+    /**
+     * 修改手动构建
+     */
+    @PreAuthorize("@ss.hasPermi('suport:hand:edit')")
+    @Log(title = "手动构建", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody ExtractByHand extractByHand)
+    {
+        return toAjax(extractByHandService.updateExtractByHand(extractByHand));
+    }
+
+    /**
+     * 删除手动构建
+     */
+    @PreAuthorize("@ss.hasPermi('suport:hand:remove')")
+    @Log(title = "手动构建", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(extractByHandService.deleteExtractByHandByIds(ids));
+    }
+
+    @PreAuthorize("@ss.hasPermi('suport:hand:add')")
+    @Log(title = "手动构建", businessType = BusinessType.INSERT)
+    @PostMapping("/submitBySubTask")
+    public AjaxResult submitBySubTask(@RequestBody List<ExtractByHandDTO> extractByHandList)
+    {
+        return toAjax(extractByHandService.submitBySubTask(extractByHandList));
+    }
+
+    @PreAuthorize("@ss.hasPermi('suport:hand:add')")
+    @Log(title = "手动构建", businessType = BusinessType.INSERT)
+    @GetMapping("/getExtractByHandBySubtaskId/{subTaskId}")
+    public AjaxResult getExtractByHandBySubtaskId(@PathVariable Long subTaskId)
+    {
+        return success(extractByHandService.getExtractByHandBySubtaskId(subTaskId));
+    }
+}

+ 104 - 0
kgraph-graph/src/main/java/com/kgraph/graph/suport/controller/ExtractByHandDetailController.java

@@ -0,0 +1,104 @@
+package com.kgraph.graph.suport.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.kgraph.common.annotation.Log;;
+import com.kgraph.common.core.controller.BaseController;;
+import com.kgraph.common.core.domain.AjaxResult;;
+import com.kgraph.common.enums.BusinessType;;
+import com.kgraph.graph.suport.domain.ExtractByHandDetail;
+import com.kgraph.graph.suport.service.IExtractByHandDetailService;
+import com.kgraph.common.utils.poi.ExcelUtil;;
+import com.kgraph.common.core.page.TableDataInfo;;
+
+/**
+ * 手动构建详情Controller
+ * 
+ * @author Allen
+ * @date 2023-06-06
+ */
+@RestController
+@RequestMapping("/suport/hand_detail")
+public class ExtractByHandDetailController extends BaseController
+{
+    @Autowired
+    private IExtractByHandDetailService extractByHandDetailService;
+
+    /**
+     * 查询手动构建详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('suport:hand_detail:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(ExtractByHandDetail extractByHandDetail)
+    {
+        startPage();
+        List<ExtractByHandDetail> list = extractByHandDetailService.selectExtractByHandDetailList(extractByHandDetail);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出手动构建详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('suport:hand_detail:export')")
+    @Log(title = "手动构建详情", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, ExtractByHandDetail extractByHandDetail)
+    {
+        List<ExtractByHandDetail> list = extractByHandDetailService.selectExtractByHandDetailList(extractByHandDetail);
+        ExcelUtil<ExtractByHandDetail> util = new ExcelUtil<ExtractByHandDetail>(ExtractByHandDetail.class);
+        util.exportExcel(response, list, "手动构建详情数据");
+    }
+
+    /**
+     * 获取手动构建详情详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('suport:hand_detail:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(extractByHandDetailService.selectExtractByHandDetailById(id));
+    }
+
+    /**
+     * 新增手动构建详情
+     */
+    @PreAuthorize("@ss.hasPermi('suport:hand_detail:add')")
+    @Log(title = "手动构建详情", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ExtractByHandDetail extractByHandDetail)
+    {
+        return toAjax(extractByHandDetailService.insertExtractByHandDetail(extractByHandDetail));
+    }
+
+    /**
+     * 修改手动构建详情
+     */
+    @PreAuthorize("@ss.hasPermi('suport:hand_detail:edit')")
+    @Log(title = "手动构建详情", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody ExtractByHandDetail extractByHandDetail)
+    {
+        return toAjax(extractByHandDetailService.updateExtractByHandDetail(extractByHandDetail));
+    }
+
+    /**
+     * 删除手动构建详情
+     */
+    @PreAuthorize("@ss.hasPermi('suport:hand_detail:remove')")
+    @Log(title = "手动构建详情", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(extractByHandDetailService.deleteExtractByHandDetailByIds(ids));
+    }
+}

+ 33 - 0
kgraph-graph/src/main/java/com/kgraph/graph/suport/domain/ExtractByHand.java

@@ -0,0 +1,33 @@
+package com.kgraph.graph.suport.domain;
+
+import lombok.Data;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.kgraph.common.annotation.Excel;
+import com.kgraph.common.core.domain.BaseEntity;;import java.util.List;
+
+/**
+ * 手动构建对象 t_extract_by_hand
+ * 
+ * @author Allen
+ * @date 2023-06-06
+ */
+@Data
+public class ExtractByHand extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 序号 */
+    private Long id;
+
+    /** 子任务id */
+    @Excel(name = "子任务id")
+    private Long subTaskId;
+
+    /** 页码 */
+    @Excel(name = "页码")
+    private Long pageNo;
+
+    private List<ExtractByHandDetail> details;
+
+}

+ 83 - 0
kgraph-graph/src/main/java/com/kgraph/graph/suport/domain/ExtractByHandDetail.java

@@ -0,0 +1,83 @@
+package com.kgraph.graph.suport.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.kgraph.common.annotation.Excel;
+import com.kgraph.common.core.domain.BaseEntity;;
+
+/**
+ * 手动构建详情对象 t_extract_by_hand_detail
+ * 
+ * @author Allen
+ * @date 2023-06-06
+ */
+public class ExtractByHandDetail extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 序号 */
+    private Long id;
+
+    /** 手动构建id */
+    @Excel(name = "手动构建id")
+    private Long handId;
+
+    /** 实体类id */
+    @Excel(name = "实体类id")
+    private Long entityClassId;
+
+    /** 实体 */
+    @Excel(name = "实体")
+    private String entity;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setHandId(Long handId) 
+    {
+        this.handId = handId;
+    }
+
+    public Long getHandId() 
+    {
+        return handId;
+    }
+    public void setEntityClassId(Long entityClassId) 
+    {
+        this.entityClassId = entityClassId;
+    }
+
+    public Long getEntityClassId() 
+    {
+        return entityClassId;
+    }
+    public void setEntity(String entity) 
+    {
+        this.entity = entity;
+    }
+
+    public String getEntity() 
+    {
+        return entity;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("handId", getHandId())
+            .append("entityClassId", getEntityClassId())
+            .append("entity", getEntity())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 16 - 0
kgraph-graph/src/main/java/com/kgraph/graph/suport/dto/ExtractByHandDTO.java

@@ -0,0 +1,16 @@
+package com.kgraph.graph.suport.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author allen
+ */
+@Data
+public class ExtractByHandDTO {
+    private Long id;
+    private Long subTaskId;
+    private Long pageNo;
+    List<ExtractByHandDetailDTO> details;
+}

+ 15 - 0
kgraph-graph/src/main/java/com/kgraph/graph/suport/dto/ExtractByHandDetailDTO.java

@@ -0,0 +1,15 @@
+package com.kgraph.graph.suport.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author allen
+ */
+@Data
+public class ExtractByHandDetailDTO {
+    private Long handId;
+    private Long entityClassId;
+    private List<String> entityList;
+}

+ 61 - 0
kgraph-graph/src/main/java/com/kgraph/graph/suport/mapper/ExtractByHandDetailMapper.java

@@ -0,0 +1,61 @@
+package com.kgraph.graph.suport.mapper;
+
+import java.util.List;
+import com.kgraph.graph.suport.domain.ExtractByHandDetail;
+
+/**
+ * 手动构建详情Mapper接口
+ * 
+ * @author Allen
+ * @date 2023-06-06
+ */
+public interface ExtractByHandDetailMapper 
+{
+    /**
+     * 查询手动构建详情
+     * 
+     * @param id 手动构建详情主键
+     * @return 手动构建详情
+     */
+    public ExtractByHandDetail selectExtractByHandDetailById(Long id);
+
+    /**
+     * 查询手动构建详情列表
+     * 
+     * @param extractByHandDetail 手动构建详情
+     * @return 手动构建详情集合
+     */
+    public List<ExtractByHandDetail> selectExtractByHandDetailList(ExtractByHandDetail extractByHandDetail);
+
+    /**
+     * 新增手动构建详情
+     * 
+     * @param extractByHandDetail 手动构建详情
+     * @return 结果
+     */
+    public int insertExtractByHandDetail(ExtractByHandDetail extractByHandDetail);
+
+    /**
+     * 修改手动构建详情
+     * 
+     * @param extractByHandDetail 手动构建详情
+     * @return 结果
+     */
+    public int updateExtractByHandDetail(ExtractByHandDetail extractByHandDetail);
+
+    /**
+     * 删除手动构建详情
+     * 
+     * @param id 手动构建详情主键
+     * @return 结果
+     */
+    public int deleteExtractByHandDetailById(Long id);
+
+    /**
+     * 批量删除手动构建详情
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteExtractByHandDetailByIds(Long[] ids);
+}

+ 63 - 0
kgraph-graph/src/main/java/com/kgraph/graph/suport/mapper/ExtractByHandMapper.java

@@ -0,0 +1,63 @@
+package com.kgraph.graph.suport.mapper;
+
+import java.util.List;
+import com.kgraph.graph.suport.domain.ExtractByHand;
+
+/**
+ * 手动构建Mapper接口
+ * 
+ * @author Allen
+ * @date 2023-06-06
+ */
+public interface ExtractByHandMapper 
+{
+    /**
+     * 查询手动构建
+     * 
+     * @param id 手动构建主键
+     * @return 手动构建
+     */
+    public ExtractByHand selectExtractByHandById(Long id);
+
+    /**
+     * 查询手动构建列表
+     * 
+     * @param extractByHand 手动构建
+     * @return 手动构建集合
+     */
+    public List<ExtractByHand> selectExtractByHandList(ExtractByHand extractByHand);
+
+    /**
+     * 新增手动构建
+     * 
+     * @param extractByHand 手动构建
+     * @return 结果
+     */
+    public int insertExtractByHand(ExtractByHand extractByHand);
+
+    /**
+     * 修改手动构建
+     * 
+     * @param extractByHand 手动构建
+     * @return 结果
+     */
+    public int updateExtractByHand(ExtractByHand extractByHand);
+
+    /**
+     * 删除手动构建
+     * 
+     * @param id 手动构建主键
+     * @return 结果
+     */
+    public int deleteExtractByHandById(Long id);
+
+    /**
+     * 批量删除手动构建
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteExtractByHandByIds(Long[] ids);
+
+    List<ExtractByHand> getExtractByHandBySubtaskId(Long subTaskId);
+}

+ 63 - 0
kgraph-graph/src/main/java/com/kgraph/graph/suport/service/IExtractByHandDetailService.java

@@ -0,0 +1,63 @@
+package com.kgraph.graph.suport.service;
+
+import java.util.List;
+import com.kgraph.graph.suport.domain.ExtractByHandDetail;
+import com.kgraph.graph.suport.dto.ExtractByHandDTO;
+
+/**
+ * 手动构建详情Service接口
+ * 
+ * @author Allen
+ * @date 2023-06-06
+ */
+public interface IExtractByHandDetailService 
+{
+    /**
+     * 查询手动构建详情
+     * 
+     * @param id 手动构建详情主键
+     * @return 手动构建详情
+     */
+    public ExtractByHandDetail selectExtractByHandDetailById(Long id);
+
+    /**
+     * 查询手动构建详情列表
+     * 
+     * @param extractByHandDetail 手动构建详情
+     * @return 手动构建详情集合
+     */
+    public List<ExtractByHandDetail> selectExtractByHandDetailList(ExtractByHandDetail extractByHandDetail);
+
+    /**
+     * 新增手动构建详情
+     * 
+     * @param extractByHandDetail 手动构建详情
+     * @return 结果
+     */
+    public int insertExtractByHandDetail(ExtractByHandDetail extractByHandDetail);
+
+    /**
+     * 修改手动构建详情
+     * 
+     * @param extractByHandDetail 手动构建详情
+     * @return 结果
+     */
+    public int updateExtractByHandDetail(ExtractByHandDetail extractByHandDetail);
+
+    /**
+     * 批量删除手动构建详情
+     * 
+     * @param ids 需要删除的手动构建详情主键集合
+     * @return 结果
+     */
+    public int deleteExtractByHandDetailByIds(Long[] ids);
+
+    /**
+     * 删除手动构建详情信息
+     * 
+     * @param id 手动构建详情主键
+     * @return 结果
+     */
+    public int deleteExtractByHandDetailById(Long id);
+
+}

+ 66 - 0
kgraph-graph/src/main/java/com/kgraph/graph/suport/service/IExtractByHandService.java

@@ -0,0 +1,66 @@
+package com.kgraph.graph.suport.service;
+
+import java.util.List;
+import com.kgraph.graph.suport.domain.ExtractByHand;
+import com.kgraph.graph.suport.dto.ExtractByHandDTO;
+
+/**
+ * 手动构建Service接口
+ * 
+ * @author Allen
+ * @date 2023-06-06
+ */
+public interface IExtractByHandService 
+{
+    /**
+     * 查询手动构建
+     * 
+     * @param id 手动构建主键
+     * @return 手动构建
+     */
+    public ExtractByHand selectExtractByHandById(Long id);
+
+    /**
+     * 查询手动构建列表
+     * 
+     * @param extractByHand 手动构建
+     * @return 手动构建集合
+     */
+    public List<ExtractByHand> selectExtractByHandList(ExtractByHand extractByHand);
+
+    /**
+     * 新增手动构建
+     * 
+     * @param extractByHand 手动构建
+     * @return 结果
+     */
+    public int insertExtractByHand(ExtractByHand extractByHand);
+
+    /**
+     * 修改手动构建
+     * 
+     * @param extractByHand 手动构建
+     * @return 结果
+     */
+    public int updateExtractByHand(ExtractByHand extractByHand);
+
+    /**
+     * 批量删除手动构建
+     * 
+     * @param ids 需要删除的手动构建主键集合
+     * @return 结果
+     */
+    public int deleteExtractByHandByIds(Long[] ids);
+
+    /**
+     * 删除手动构建信息
+     * 
+     * @param id 手动构建主键
+     * @return 结果
+     */
+    public int deleteExtractByHandById(Long id);
+
+    int submitBySubTask(List<ExtractByHandDTO> extractByHandList);
+
+    List<ExtractByHandDTO> getExtractByHandBySubtaskId(Long subTaskId);
+}

+ 2 - 0
kgraph-graph/src/main/java/com/kgraph/graph/suport/service/IExtractKnowledgeSubTaskService.java

@@ -77,4 +77,6 @@ public interface IExtractKnowledgeSubTaskService
     void updateTaskStatusBySubTaskId(Long subTaskId);
 
     void saveKnowledge(JSONObject extractResult);
+
+    void updateSubTaskStatusById(Long subTaskId, String status, String msg);
 }

+ 96 - 0
kgraph-graph/src/main/java/com/kgraph/graph/suport/service/impl/ExtractByHandDetailServiceImpl.java

@@ -0,0 +1,96 @@
+package com.kgraph.graph.suport.service.impl;
+
+import java.util.List;
+import com.kgraph.common.utils.DateUtils;;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.kgraph.graph.suport.mapper.ExtractByHandDetailMapper;
+import com.kgraph.graph.suport.domain.ExtractByHandDetail;
+import com.kgraph.graph.suport.service.IExtractByHandDetailService;
+
+/**
+ * 手动构建详情Service业务层处理
+ * 
+ * @author Allen
+ * @date 2023-06-06
+ */
+@Service
+public class ExtractByHandDetailServiceImpl implements IExtractByHandDetailService 
+{
+    @Autowired
+    private ExtractByHandDetailMapper extractByHandDetailMapper;
+
+    /**
+     * 查询手动构建详情
+     * 
+     * @param id 手动构建详情主键
+     * @return 手动构建详情
+     */
+    @Override
+    public ExtractByHandDetail selectExtractByHandDetailById(Long id)
+    {
+        return extractByHandDetailMapper.selectExtractByHandDetailById(id);
+    }
+
+    /**
+     * 查询手动构建详情列表
+     * 
+     * @param extractByHandDetail 手动构建详情
+     * @return 手动构建详情
+     */
+    @Override
+    public List<ExtractByHandDetail> selectExtractByHandDetailList(ExtractByHandDetail extractByHandDetail)
+    {
+        return extractByHandDetailMapper.selectExtractByHandDetailList(extractByHandDetail);
+    }
+
+    /**
+     * 新增手动构建详情
+     * 
+     * @param extractByHandDetail 手动构建详情
+     * @return 结果
+     */
+    @Override
+    public int insertExtractByHandDetail(ExtractByHandDetail extractByHandDetail)
+    {
+        extractByHandDetail.setCreateTime(DateUtils.getNowDate());
+        return extractByHandDetailMapper.insertExtractByHandDetail(extractByHandDetail);
+    }
+
+    /**
+     * 修改手动构建详情
+     * 
+     * @param extractByHandDetail 手动构建详情
+     * @return 结果
+     */
+    @Override
+    public int updateExtractByHandDetail(ExtractByHandDetail extractByHandDetail)
+    {
+        extractByHandDetail.setUpdateTime(DateUtils.getNowDate());
+        return extractByHandDetailMapper.updateExtractByHandDetail(extractByHandDetail);
+    }
+
+    /**
+     * 批量删除手动构建详情
+     * 
+     * @param ids 需要删除的手动构建详情主键
+     * @return 结果
+     */
+    @Override
+    public int deleteExtractByHandDetailByIds(Long[] ids)
+    {
+        return extractByHandDetailMapper.deleteExtractByHandDetailByIds(ids);
+    }
+
+    /**
+     * 删除手动构建详情信息
+     * 
+     * @param id 手动构建详情主键
+     * @return 结果
+     */
+    @Override
+    public int deleteExtractByHandDetailById(Long id)
+    {
+        return extractByHandDetailMapper.deleteExtractByHandDetailById(id);
+    }
+}

+ 142 - 0
kgraph-graph/src/main/java/com/kgraph/graph/suport/service/impl/ExtractByHandServiceImpl.java

@@ -0,0 +1,142 @@
+package com.kgraph.graph.suport.service.impl;
+
+import java.util.List;
+import com.kgraph.common.utils.DateUtils;;
+import com.kgraph.graph.neo4j.service.IKgService;
+import com.kgraph.graph.suport.domain.ExtractByHandDetail;
+import com.kgraph.graph.suport.domain.ExtractKnowledgeSubTask;
+import com.kgraph.graph.suport.dto.ExtractByHandDTO;
+import com.kgraph.graph.suport.service.IExtractByHandDetailService;
+import com.kgraph.graph.suport.service.IExtractKnowledgeSubTaskService;
+import com.kgraph.graph.suport.utils.ExtractByHandUtils;
+import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.kgraph.graph.suport.mapper.ExtractByHandMapper;
+import com.kgraph.graph.suport.domain.ExtractByHand;
+import com.kgraph.graph.suport.service.IExtractByHandService;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 手动构建Service业务层处理
+ * 
+ * @author Allen
+ * @date 2023-06-06
+ */
+@Service
+public class ExtractByHandServiceImpl implements IExtractByHandService 
+{
+    @Autowired
+    private ExtractByHandMapper extractByHandMapper;
+
+    @Autowired
+    private IExtractByHandDetailService extractByHandDetailService;
+
+    @Autowired
+    private IExtractKnowledgeSubTaskService subTaskService;
+    @Autowired
+    private IKgService kgService;
+
+    /**
+     * 查询手动构建
+     * 
+     * @param id 手动构建主键
+     * @return 手动构建
+     */
+    @Override
+    public ExtractByHand selectExtractByHandById(Long id)
+    {
+        return extractByHandMapper.selectExtractByHandById(id);
+    }
+
+    /**
+     * 查询手动构建列表
+     * 
+     * @param extractByHand 手动构建
+     * @return 手动构建
+     */
+    @Override
+    public List<ExtractByHand> selectExtractByHandList(ExtractByHand extractByHand)
+    {
+        return extractByHandMapper.selectExtractByHandList(extractByHand);
+    }
+
+    /**
+     * 新增手动构建
+     * 
+     * @param extractByHand 手动构建
+     * @return 结果
+     */
+    @Override
+    public int insertExtractByHand(ExtractByHand extractByHand)
+    {
+        extractByHand.setCreateTime(DateUtils.getNowDate());
+        return extractByHandMapper.insertExtractByHand(extractByHand);
+    }
+
+    /**
+     * 修改手动构建
+     * 
+     * @param extractByHand 手动构建
+     * @return 结果
+     */
+    @Override
+    public int updateExtractByHand(ExtractByHand extractByHand)
+    {
+        extractByHand.setUpdateTime(DateUtils.getNowDate());
+        return extractByHandMapper.updateExtractByHand(extractByHand);
+    }
+
+    /**
+     * 批量删除手动构建
+     * 
+     * @param ids 需要删除的手动构建主键
+     * @return 结果
+     */
+    @Override
+    public int deleteExtractByHandByIds(Long[] ids)
+    {
+        return extractByHandMapper.deleteExtractByHandByIds(ids);
+    }
+
+    /**
+     * 删除手动构建信息
+     * 
+     * @param id 手动构建主键
+     * @return 结果
+     */
+    @Override
+    public int deleteExtractByHandById(Long id)
+    {
+        return extractByHandMapper.deleteExtractByHandById(id);
+    }
+
+    @Override
+    @Transactional
+    public int submitBySubTask(List<ExtractByHandDTO> extractByHandList) {
+        List<ExtractByHand> extractByHands = ExtractByHandUtils.dto2Domain(extractByHandList);
+        int returnValue = 0;
+        if(CollectionUtils.isNotEmpty(extractByHands)){
+            for (ExtractByHand extractByHand : extractByHands) {
+                returnValue = returnValue + insertExtractByHand(extractByHand);
+                List<ExtractByHandDetail> details = extractByHand.getDetails();
+                if(CollectionUtils.isNotEmpty(details)){
+                    for (ExtractByHandDetail detail : details) {
+                        detail.setHandId(extractByHand.getId());
+                        extractByHandDetailService.insertExtractByHandDetail(detail);
+                    }
+                }
+            }
+        }
+        subTaskService.updateSubTaskStatusById(extractByHands.get(0).getSubTaskId(), ExtractKnowledgeSubTask.DOWN,"");
+        kgService.save2Neo4j(extractByHandList);
+        return returnValue;
+    }
+
+    @Override
+    public List<ExtractByHandDTO> getExtractByHandBySubtaskId(Long subTaskId) {
+        List<ExtractByHand> extractByHandList = extractByHandMapper.getExtractByHandBySubtaskId(subTaskId);
+        List<ExtractByHandDTO> extractByHandDTOS = ExtractByHandUtils.domain2Dto(extractByHandList);
+        return extractByHandDTOS;
+    }
+}

+ 1 - 0
kgraph-graph/src/main/java/com/kgraph/graph/suport/service/impl/ExtractKnowledgeSubTaskServiceImpl.java

@@ -341,6 +341,7 @@ public class ExtractKnowledgeSubTaskServiceImpl implements IExtractKnowledgeSubT
         }
     }
 
+    @Override
     public void updateSubTaskStatusById(Long subTaskId, String status, String msg) {
         extractKnowledgeSubTaskMapper.updateSubTaskStatusById(subTaskId, status, msg, new Date());
         extractKnowledgeSubTaskMapper.updateTaskStatusBySubTaskId(subTaskId);

+ 14 - 14
kgraph-graph/src/main/java/com/kgraph/graph/suport/service/impl/TCheckPiontServiceImpl.java

@@ -82,20 +82,20 @@ public class TCheckPiontServiceImpl implements ITCheckPiontService
         return i;
     }
 
-    private void saveEntity(TCheckPiont checkPoint) {
-        Entity entity = neo4jEntityService.getByForeignId(checkPoint.getForeignId());
-        if (entity == null) {
-            entity = new Entity();
-            entity.setForeignId(checkPoint.getForeignId());
-        }
-        List<String> labels = entity.getLabels();
-        if(!labels.contains(TCheckPiont.ENTITY_LABEL)){
-            entity.getLabels().add(TCheckPiont.ENTITY_LABEL);
-        }
-        entity.setCode(checkPoint.getCode());
-        entity.setName(checkPoint.getCheckPiont());
-        neo4jEntityService.save(entity);
-    }
+//    private void saveEntity(TCheckPiont checkPoint) {
+//        Entity entity = neo4jEntityService.getByForeignId(checkPoint.getForeignId());
+//        if (entity == null) {
+//            entity = new Entity();
+//            entity.setForeignId(checkPoint.getForeignId());
+//        }
+//        List<String> labels = entity.getLabels();
+//        if(!labels.contains(TCheckPiont.ENTITY_LABEL)){
+//            entity.getLabels().add(TCheckPiont.ENTITY_LABEL);
+//        }
+//        entity.setCode(checkPoint.getCode());
+//        entity.setName(checkPoint.getCheckPiont());
+//        neo4jEntityService.save(entity);
+//    }
 
     /**
      * 批量删除检查点管理

+ 96 - 0
kgraph-graph/src/main/java/com/kgraph/graph/suport/utils/ExtractByHandUtils.java

@@ -0,0 +1,96 @@
+package com.kgraph.graph.suport.utils;
+
+import com.kgraph.graph.suport.domain.ExtractByHand;
+import com.kgraph.graph.suport.domain.ExtractByHandDetail;
+import com.kgraph.graph.suport.dto.ExtractByHandDTO;
+import com.kgraph.graph.suport.dto.ExtractByHandDetailDTO;
+import org.apache.commons.collections4.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author allen
+ */
+public class ExtractByHandUtils {
+
+    public static ExtractByHand dto2Domain(ExtractByHandDTO extractByHandDTO) {
+        ExtractByHand extractByHand = new ExtractByHand();
+        extractByHand.setId(extractByHandDTO.getId());
+        extractByHand.setPageNo(extractByHandDTO.getPageNo());
+        extractByHand.setSubTaskId(extractByHandDTO.getSubTaskId());
+        List<ExtractByHandDetailDTO> details = extractByHandDTO.getDetails();
+        if (CollectionUtils.isNotEmpty(details)) {
+            List<ExtractByHandDetail> detailList = new ArrayList<>();
+            for (ExtractByHandDetailDTO detail : details) {
+                detailDto2Domain(extractByHandDTO.getId(), detailList, detail);
+            }
+            extractByHand.setDetails(detailList);
+        }
+        return extractByHand;
+    }
+
+    public static void detailDto2Domain(Long handId, List<ExtractByHandDetail> detailList, ExtractByHandDetailDTO detail) {
+        for (String entity : detail.getEntityList()) {
+            ExtractByHandDetail extractByHandDetail = new ExtractByHandDetail();
+            extractByHandDetail.setHandId(handId);
+            extractByHandDetail.setEntityClassId(detail.getEntityClassId());
+            extractByHandDetail.setEntity(entity);
+            detailList.add(extractByHandDetail);
+        }
+    }
+
+    public static List<ExtractByHand> dto2Domain(List<ExtractByHandDTO> dtoList) {
+        List<ExtractByHand> returnValue = null;
+        if (CollectionUtils.isNotEmpty(dtoList)) {
+            returnValue = new ArrayList<>(dtoList.size());
+            for (ExtractByHandDTO dto : dtoList) {
+                returnValue.add(dto2Domain(dto));
+            }
+        }
+        return returnValue;
+    }
+
+    public static List<ExtractByHandDTO> domain2Dto(List<ExtractByHand> domainList) {
+        List<ExtractByHandDTO> returnValue = null;
+        if (CollectionUtils.isNotEmpty(domainList)) {
+            returnValue = new ArrayList<>(domainList.size());
+            for (ExtractByHand domain : domainList) {
+                returnValue.add(domain2Dto(domain));
+            }
+        }
+        return returnValue;
+    }
+
+    public static ExtractByHandDTO domain2Dto(ExtractByHand domain) {
+        ExtractByHandDTO dto = new ExtractByHandDTO();
+        dto.setId(domain.getId());
+        dto.setPageNo(domain.getPageNo());
+        dto.setSubTaskId(domain.getSubTaskId());
+        List<ExtractByHandDetailDTO> detailDTOList = detailsDomain2Dto(domain.getDetails(), domain.getId());
+        dto.setDetails(detailDTOList);
+        return dto;
+    }
+
+    private static List<ExtractByHandDetailDTO> detailsDomain2Dto(List<ExtractByHandDetail> domainDetails, Long handId) {
+        List<ExtractByHandDetailDTO> detailDtoList = null;
+        if (CollectionUtils.isNotEmpty(domainDetails)) {
+            Map<Long, List<String>> map = new HashMap<>();
+            detailDtoList = new ArrayList<>(domainDetails.size());
+            for (ExtractByHandDetail domainDetail : domainDetails) {
+                List<String> entityList = map.computeIfAbsent(domainDetail.getEntityClassId(), k -> new ArrayList<>());
+                entityList.add(domainDetail.getEntity());
+            }
+            for (Long mapKey : map.keySet()) {
+                ExtractByHandDetailDTO dtoDetail = new ExtractByHandDetailDTO();
+                dtoDetail.setHandId(handId);
+                dtoDetail.setEntityClassId(mapKey);
+                dtoDetail.setEntityList(map.get(mapKey));
+                detailDtoList.add(dtoDetail);
+            }
+        }
+        return detailDtoList;
+    }
+}

+ 7 - 0
kgraph-graph/src/main/resources/mapper/neo4j/EntityClassRelationMapper.xml

@@ -101,6 +101,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         delete from entity_class_relation where id = #{id}
     </delete>
 
+    <delete id="deleteEntityClassRelationByIds" parameterType="String">
+        delete from entity_class_relation where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
     <select id="getClassRelationOptionByClassId" parameterType="Long" resultType="Map">
         SELECT id,name from entity_class_relation WHERE start_id = #{startId} AND end_id = #{endId}
     </select>

+ 82 - 0
kgraph-graph/src/main/resources/mapper/suport/ExtractByHandDetailMapper.xml

@@ -0,0 +1,82 @@
+<?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.kgraph.graph.suport.mapper.ExtractByHandDetailMapper">
+    
+    <resultMap type="ExtractByHandDetail" id="ExtractByHandDetailResult">
+        <result property="id"    column="id"    />
+        <result property="handId"    column="hand_id"    />
+        <result property="entityClassId"    column="entity_class_id"    />
+        <result property="entity"    column="entity"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectExtractByHandDetailVo">
+        select id, hand_id, entity_class_id, entity, create_by, create_time, update_by, update_time from t_extract_by_hand_detail
+    </sql>
+
+    <select id="selectExtractByHandDetailList" parameterType="ExtractByHandDetail" resultMap="ExtractByHandDetailResult">
+        <include refid="selectExtractByHandDetailVo"/>
+        <where>  
+            <if test="handId != null "> and hand_id = #{handId}</if>
+            <if test="entityClassId != null "> and entity_class_id = #{entityClassId}</if>
+            <if test="entity != null  and entity != ''"> and entity = #{entity}</if>
+        </where>
+    </select>
+    
+    <select id="selectExtractByHandDetailById" parameterType="Long" resultMap="ExtractByHandDetailResult">
+        <include refid="selectExtractByHandDetailVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertExtractByHandDetail" parameterType="ExtractByHandDetail" useGeneratedKeys="true" keyProperty="id">
+        insert into t_extract_by_hand_detail
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="handId != null">hand_id,</if>
+            <if test="entityClassId != null">entity_class_id,</if>
+            <if test="entity != null">entity,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="handId != null">#{handId},</if>
+            <if test="entityClassId != null">#{entityClassId},</if>
+            <if test="entity != null">#{entity},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateExtractByHandDetail" parameterType="ExtractByHandDetail">
+        update t_extract_by_hand_detail
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="handId != null">hand_id = #{handId},</if>
+            <if test="entityClassId != null">entity_class_id = #{entityClassId},</if>
+            <if test="entity != null">entity = #{entity},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteExtractByHandDetailById" parameterType="Long">
+        delete from t_extract_by_hand_detail where id = #{id}
+    </delete>
+
+    <delete id="deleteExtractByHandDetailByIds" parameterType="String">
+        delete from t_extract_by_hand_detail where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 92 - 0
kgraph-graph/src/main/resources/mapper/suport/ExtractByHandMapper.xml

@@ -0,0 +1,92 @@
+<?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.kgraph.graph.suport.mapper.ExtractByHandMapper">
+    
+    <resultMap type="ExtractByHand" id="ExtractByHandResult">
+        <result property="id"    column="id"    />
+        <result property="subTaskId"    column="sub_task_id"    />
+        <result property="pageNo"    column="page_no"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <collection property="details" select="selectDetailsByHandId" column="id" javaType="ArrayList" />
+    </resultMap>
+
+    <sql id="selectExtractByHandVo">
+        select id, sub_task_id, page_no, create_by, create_time, update_by, update_time from t_extract_by_hand
+    </sql>
+
+    <select id="selectExtractByHandList" parameterType="ExtractByHand" resultMap="ExtractByHandResult">
+        <include refid="selectExtractByHandVo"/>
+        <where>
+            <if test="subTaskId != null "> and sub_task_id = #{subTaskId}</if>
+            <if test="pageNo != null "> and page_no = #{pageNo}</if>
+        </where>
+    </select>
+
+    <select id="getExtractByHandBySubtaskId" parameterType="Long" resultMap="ExtractByHandResult">
+        <include refid="selectExtractByHandVo"/>
+        where sub_task_id = #{subTaskId}
+    </select>
+
+    <select id="selectExtractByHandById" parameterType="Long" resultMap="ExtractByHandResult">
+        <include refid="selectExtractByHandVo"/>
+        where id = #{id}
+    </select>
+
+    <sql id="selectExtractByHandDetailVo">
+        select id, hand_id as handId, entity_class_id as entityClassId, entity, create_by as createBy, create_time as createTime, update_by as updateBy, update_time as updateTime from t_extract_by_hand_detail
+    </sql>
+
+    <select id="selectDetailsByHandId" resultType="com.kgraph.graph.suport.domain.ExtractByHandDetail">
+        <include refid="selectExtractByHandDetailVo"/>
+        WHERE hand_id = #{id}
+    </select>
+        
+    <insert id="insertExtractByHand" parameterType="ExtractByHand" useGeneratedKeys="true" keyProperty="id">
+        insert into t_extract_by_hand
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="subTaskId != null">sub_task_id,</if>
+            <if test="pageNo != null">page_no,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="subTaskId != null">#{subTaskId},</if>
+            <if test="pageNo != null">#{pageNo},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateExtractByHand" parameterType="ExtractByHand">
+        update t_extract_by_hand
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="subTaskId != null">sub_task_id = #{subTaskId},</if>
+            <if test="pageNo != null">page_no = #{pageNo},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteExtractByHandById" parameterType="Long">
+        delete from t_extract_by_hand where id = #{id}
+    </delete>
+
+    <delete id="deleteExtractByHandByIds" parameterType="String">
+        delete from t_extract_by_hand where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 24 - 0
sql/update20230606.sql

@@ -0,0 +1,24 @@
+DROP TABLE IF EXISTS `t_extract_by_hand`;
+CREATE TABLE `t_extract_by_hand`  (
+  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '序号',
+  `sub_task_id` bigint NULL DEFAULT NULL COMMENT '子任务id',
+  `page_no` bigint NULL DEFAULT NULL COMMENT '页码',
+  `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者',
+  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
+  `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者',
+  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '手动构建' ROW_FORMAT = Dynamic;
+
+DROP TABLE IF EXISTS `t_extract_by_hand_detail`;
+CREATE TABLE `t_extract_by_hand_detail`  (
+  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '序号',
+  `hand_id` bigint NULL DEFAULT NULL COMMENT '手动构建id',
+  `entity_class_id` bigint NULL DEFAULT NULL COMMENT '实体类id',
+  `entity` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '实体',
+  `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者',
+  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
+  `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者',
+  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '手动构建详情' ROW_FORMAT = Dynamic;