| @@ -253,6 +253,10 @@ | |||
| <groupId>org.springframework.boot</groupId> | |||
| <artifactId>spring-boot-starter-data-neo4j</artifactId> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>org.neo4j.driver</groupId> | |||
| <artifactId>neo4j-java-driver</artifactId> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.alibaba</groupId> | |||
| <artifactId>easyexcel</artifactId> | |||
| @@ -25,7 +25,7 @@ public class KgEntityController extends BaseController { | |||
| private KgEntityInfoService kgEntityInfoService; | |||
| /** | |||
| * 新增主体 | |||
| * 新增实体 | |||
| * | |||
| * @param entityInfo | |||
| * @return | |||
| @@ -37,7 +37,7 @@ public class KgEntityController extends BaseController { | |||
| } | |||
| /** | |||
| * 修改主体 | |||
| * 修改实体 | |||
| * | |||
| * @param entityInfo | |||
| * @return | |||
| @@ -49,7 +49,7 @@ public class KgEntityController extends BaseController { | |||
| } | |||
| /** | |||
| * 主体列表 | |||
| * 实体列表 | |||
| * @return | |||
| */ | |||
| @GetMapping("/list") | |||
| @@ -60,7 +60,7 @@ public class KgEntityController extends BaseController { | |||
| } | |||
| /** | |||
| * 主体详情 | |||
| * 实体详情 | |||
| * @param id | |||
| * @return | |||
| */ | |||
| @@ -70,7 +70,7 @@ public class KgEntityController extends BaseController { | |||
| } | |||
| /** | |||
| * 删除主体 | |||
| * 删除实体 | |||
| * @param id | |||
| * @return | |||
| */ | |||
| @@ -81,7 +81,7 @@ public class KgEntityController extends BaseController { | |||
| } | |||
| /** | |||
| * 主体导出 | |||
| * 实体导出 | |||
| * @param response | |||
| * @param id | |||
| */ | |||
| @@ -89,6 +89,6 @@ public class KgEntityController extends BaseController { | |||
| public void export(HttpServletResponse response,@PathVariable Long id) { | |||
| KgEntityInfo Entity = kgEntityInfoService.getEntity(id); | |||
| ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class); | |||
| util.exportExcel(response, null, "主体数据"); | |||
| util.exportExcel(response, null, "实体数据"); | |||
| } | |||
| } | |||
| @@ -24,7 +24,7 @@ public class KgEntityPropertiesController extends BaseController { | |||
| private KgEntityPropertiesService kgEntityPropertiesService; | |||
| /** | |||
| * 新增主体 | |||
| * 新增实体属性 | |||
| * | |||
| * @param entityProperties | |||
| * @return | |||
| @@ -36,7 +36,7 @@ public class KgEntityPropertiesController extends BaseController { | |||
| } | |||
| /** | |||
| * 修改主体 | |||
| * 修改实体属性 | |||
| * | |||
| * @param KgEntityProperty | |||
| * @return | |||
| @@ -48,7 +48,7 @@ public class KgEntityPropertiesController extends BaseController { | |||
| } | |||
| /** | |||
| * 主体列表 | |||
| * 实体属性列表 | |||
| * @return | |||
| */ | |||
| @GetMapping("/list") | |||
| @@ -59,7 +59,7 @@ public class KgEntityPropertiesController extends BaseController { | |||
| } | |||
| /** | |||
| * 主体详情 | |||
| * 实体属性详情 | |||
| * @param id | |||
| * @return | |||
| */ | |||
| @@ -69,7 +69,7 @@ public class KgEntityPropertiesController extends BaseController { | |||
| } | |||
| /** | |||
| * 删除主体 | |||
| * 删除实体属性 | |||
| * @param id | |||
| * @return | |||
| */ | |||
| @@ -80,7 +80,7 @@ public class KgEntityPropertiesController extends BaseController { | |||
| } | |||
| /** | |||
| * 主体导出 | |||
| * 实体属性导出 | |||
| * @param response | |||
| * @param id | |||
| */ | |||
| @@ -88,6 +88,6 @@ public class KgEntityPropertiesController extends BaseController { | |||
| public void export(HttpServletResponse response,@PathVariable Long id) { | |||
| KgEntityProperty EntityProperty = kgEntityPropertiesService.getEntityProperty(id); | |||
| ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class); | |||
| util.exportExcel(response, null, "主体数据"); | |||
| util.exportExcel(response, null, "实体属性数据"); | |||
| } | |||
| } | |||
| @@ -42,7 +42,7 @@ public class KgOntologyInfoController extends BaseController { | |||
| } | |||
| /** | |||
| * 修改主体基本信息 | |||
| * 修改主体信息 | |||
| * | |||
| * @param ontology | |||
| * @return | |||
| @@ -53,18 +53,6 @@ public class KgOntologyInfoController extends BaseController { | |||
| return R.ok("修改成功"); | |||
| } | |||
| /** | |||
| * 修改主体详细信息 | |||
| * | |||
| * @param ontology | |||
| * @return | |||
| */ | |||
| @PutMapping("/info/detail") | |||
| public R<String> updateDetail(@Validated @RequestBody KgOntologyUpdateDTO ontology) { | |||
| kgOntologyInfoService.updateDetail(ontology); | |||
| return R.ok("修改成功"); | |||
| } | |||
| /** | |||
| * 主体列表 | |||
| * @return | |||
| @@ -14,7 +14,7 @@ public class KgEntityRelation implements Serializable { | |||
| /** | |||
| * 关系主键 | |||
| */ | |||
| private Long id; | |||
| private String id; | |||
| /** | |||
| * 关系名称 | |||
| @@ -28,6 +28,11 @@ public class KgOntologyInfo implements Serializable { | |||
| @NotNull(message = "主体描述不能为空") | |||
| private String description; | |||
| /** | |||
| * 图信息 | |||
| */ | |||
| private String dag; | |||
| /** | |||
| * 概念个数 | |||
| */ | |||
| @@ -0,0 +1,15 @@ | |||
| package com.ruoyi.platform.domain.kg.dto; | |||
| import lombok.Data; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| @Data | |||
| public class GraphData { | |||
| private List<KgEntityInfoDTO> nodes; | |||
| private List<KgEntityRelationDTO> edges; | |||
| private List<Map<String, Object>> combos; | |||
| } | |||
| @@ -4,25 +4,61 @@ import com.ruoyi.platform.domain.kg.KgEntityInfo; | |||
| import com.ruoyi.platform.domain.kg.KgEntityProperty; | |||
| import com.ruoyi.platform.domain.kg.KgEntityRelation; | |||
| import lombok.Data; | |||
| import org.springframework.data.neo4j.core.schema.GeneratedValue; | |||
| import org.springframework.data.neo4j.core.schema.Id; | |||
| import org.springframework.data.neo4j.core.schema.Node; | |||
| import org.springframework.data.neo4j.core.schema.Relationship; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import javax.validation.constraints.NotNull; | |||
| import java.util.*; | |||
| /** | |||
| * kg_entity_info | |||
| */ | |||
| @Data | |||
| public class KgEntityInfoDTO extends KgEntityInfo { | |||
| @Node("KgEntity") | |||
| public class KgEntityInfoDTO{ | |||
| /** | |||
| * 实体主键 | |||
| */ | |||
| private List<KgEntityProperty> properties; | |||
| @Id | |||
| private Long id; | |||
| private String label; | |||
| private String type; | |||
| private Map<String,Object> labelCfg; | |||
| private Map<String,Object> style; | |||
| private Integer x; | |||
| private Integer y; | |||
| private Integer depth; | |||
| private String name; | |||
| /** | |||
| * 实体名称 | |||
| * 实体描述 | |||
| */ | |||
| private List<KgEntityRelation> relations; | |||
| private String description; | |||
| /** | |||
| * 背景色 | |||
| */ | |||
| private String bkColor; | |||
| /** | |||
| * 图标路径 | |||
| */ | |||
| private String icon; | |||
| /** | |||
| * 属性集合 | |||
| */ | |||
| private List<KgEntityProperty> properties; | |||
| /** | |||
| * 关系集合 | |||
| */ | |||
| @Relationship(type = "CONNECTS_TO", direction = Relationship.Direction.OUTGOING) | |||
| private List<KgEntityRelationDTO> relations = new ArrayList<>(); | |||
| } | |||
| @@ -0,0 +1,53 @@ | |||
| package com.ruoyi.platform.domain.kg.dto; | |||
| import com.ruoyi.platform.domain.kg.KgEntityRelation; | |||
| import lombok.Data; | |||
| import org.springframework.data.neo4j.core.schema.Id; | |||
| import org.springframework.data.neo4j.core.schema.RelationshipId; | |||
| import org.springframework.data.neo4j.core.schema.RelationshipProperties; | |||
| import org.springframework.data.neo4j.core.schema.TargetNode; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| * kg_entity_relations | |||
| */ | |||
| @Data | |||
| //@RelationshipProperties | |||
| public class KgEntityRelationDTO { | |||
| // @Id | |||
| private String id; | |||
| private String target; | |||
| private String source; | |||
| private Map<String, Object> labelCfg; | |||
| private Map<String, Object> style; | |||
| private Map<String, Object> startPoint; | |||
| private Map<String, Object> endPoint; | |||
| private Integer sourceAnchor; | |||
| private Integer targetAnchor; | |||
| private String type; | |||
| private List<Float> curvePosition; | |||
| private List<Float> minCurveOffset; | |||
| private Integer depth; | |||
| private String name; | |||
| /** | |||
| * 关联实体ID | |||
| */ | |||
| private Long entityId; | |||
| /** | |||
| * 终点实体ID | |||
| */ | |||
| @TargetNode | |||
| private KgEntityInfoDTO targetEntity; | |||
| public KgEntityRelationDTO() { | |||
| } | |||
| public KgEntityRelationDTO(String id) { | |||
| this.id = id; | |||
| } | |||
| } | |||
| @@ -2,6 +2,7 @@ package com.ruoyi.platform.mapper.kg; | |||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
| import com.ruoyi.platform.domain.kg.KgEntityRelation; | |||
| import com.ruoyi.platform.domain.kg.dto.KgEntityRelationDTO; | |||
| import org.apache.ibatis.annotations.Mapper; | |||
| import org.apache.ibatis.annotations.Param; | |||
| @@ -23,5 +24,5 @@ public interface KgEntityRelationsMapper extends BaseMapper<KgEntityRelation> { | |||
| List<KgEntityRelation> selectList(KgEntityRelation record); | |||
| List<KgEntityRelation> selectListByEntityIds(@Param("list") List<Long> ids); | |||
| List<KgEntityRelationDTO> selectListByEntityIds(@Param("list") List<Long> ids); | |||
| } | |||
| @@ -1,6 +1,7 @@ | |||
| package com.ruoyi.platform.service; | |||
| import com.ruoyi.platform.domain.kg.KgEntityRelation; | |||
| import com.ruoyi.platform.domain.kg.dto.KgEntityRelationDTO; | |||
| import java.util.List; | |||
| @@ -19,7 +20,7 @@ public interface KgEntityRelationsService { | |||
| List<KgEntityRelation> getEntityRelations(KgEntityRelation entityRelations); | |||
| List<KgEntityRelation> getEntityRelationsByEntityIds(List<Long> ids); | |||
| List<KgEntityRelationDTO> getEntityRelationsByEntityIds(List<Long> ids); | |||
| KgEntityRelation getEntityRelations(Long id); | |||
| @@ -0,0 +1,7 @@ | |||
| package com.ruoyi.platform.service; | |||
| import com.ruoyi.platform.domain.kg.dto.KgEntityInfoDTO; | |||
| import org.springframework.data.neo4j.repository.Neo4jRepository; | |||
| public interface KgEntityRepository extends Neo4jRepository<KgEntityInfoDTO, String> { | |||
| } | |||
| @@ -2,6 +2,7 @@ package com.ruoyi.platform.service; | |||
| import com.ruoyi.platform.domain.kg.KgOntologyInfo; | |||
| import com.ruoyi.platform.domain.kg.dto.GraphData; | |||
| import com.ruoyi.platform.domain.kg.dto.KgOntologyInfoPageDTO; | |||
| import com.ruoyi.platform.domain.kg.dto.KgOntologyNameAndIdDTO; | |||
| import com.ruoyi.platform.domain.kg.dto.KgOntologyUpdateDTO; | |||
| @@ -27,9 +28,9 @@ public interface KgOntologyInfoService { | |||
| void batchDelete(List<Long> ids); | |||
| String importOntology(List<KgOntologyInfo> ontologyList, boolean updateSupport, String operName); | |||
| void saveGraph(GraphData graphData); | |||
| void updateDetail(KgOntologyUpdateDTO ontology); | |||
| String importOntology(List<KgOntologyInfo> ontologyList, boolean updateSupport, String operName); | |||
| List<KgOntologyNameAndIdDTO> getNameAndIds(); | |||
| } | |||
| @@ -4,6 +4,7 @@ import com.ruoyi.platform.domain.kg.KgEntityInfo; | |||
| import com.ruoyi.platform.domain.kg.KgEntityProperty; | |||
| import com.ruoyi.platform.domain.kg.KgEntityRelation; | |||
| import com.ruoyi.platform.domain.kg.dto.KgEntityInfoDTO; | |||
| import com.ruoyi.platform.domain.kg.dto.KgEntityRelationDTO; | |||
| import com.ruoyi.platform.mapper.kg.KgEntityInfoMapper; | |||
| import com.ruoyi.platform.service.KgEntityInfoService; | |||
| import com.ruoyi.platform.service.KgEntityPropertiesService; | |||
| @@ -58,14 +59,14 @@ public class KgEntityInfoServiceImpl implements KgEntityInfoService{ | |||
| .map(KgEntityInfoDTO::getId) | |||
| .collect(Collectors.toList()); | |||
| List<KgEntityProperty> entityPropertyList = kgEntityPropertiesService.getEntityPropertiesByEntityIds(entityIds); | |||
| List<KgEntityRelation> entityRelationList = kgEntityRelationsService.getEntityRelationsByEntityIds(entityIds); | |||
| List<KgEntityRelationDTO> entityRelationList = kgEntityRelationsService.getEntityRelationsByEntityIds(entityIds); | |||
| // 按实体ID分组 | |||
| Map<Long, List<KgEntityProperty>> propertiesMap = entityPropertyList.stream() | |||
| .collect(Collectors.groupingBy(KgEntityProperty::getEntityId)); | |||
| // 按实体ID分组 | |||
| Map<Long, List<KgEntityRelation>> relationsMap = entityRelationList.stream() | |||
| .collect(Collectors.groupingBy(KgEntityRelation::getEntityId)); | |||
| Map<Long, List<KgEntityRelationDTO>> relationsMap = entityRelationList.stream() | |||
| .collect(Collectors.groupingBy(KgEntityRelationDTO::getEntityId)); | |||
| kgEntityInfos.forEach(item -> { | |||
| item.setProperties(propertiesMap.getOrDefault(item.getId(), Collections.emptyList())); | |||
| @@ -3,6 +3,7 @@ package com.ruoyi.platform.service.impl; | |||
| import cn.hutool.core.collection.CollectionUtil; | |||
| import cn.hutool.core.util.ObjectUtil; | |||
| import com.ruoyi.platform.domain.kg.KgEntityRelation; | |||
| import com.ruoyi.platform.domain.kg.dto.KgEntityRelationDTO; | |||
| import com.ruoyi.platform.mapper.kg.KgEntityRelationsMapper; | |||
| import com.ruoyi.platform.service.KgEntityRelationsService; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| @@ -51,7 +52,7 @@ public class KgEntityRelationsServiceImpl implements KgEntityRelationsService{ | |||
| } | |||
| @Override | |||
| public List<KgEntityRelation> getEntityRelationsByEntityIds(List<Long> ids) { | |||
| public List<KgEntityRelationDTO> getEntityRelationsByEntityIds(List<Long> ids) { | |||
| if (CollectionUtil.isEmpty(ids)){ | |||
| return Collections.emptyList(); | |||
| } | |||
| @@ -1,22 +1,25 @@ | |||
| package com.ruoyi.platform.service.impl; | |||
| import cn.hutool.core.collection.CollectionUtil; | |||
| import cn.hutool.core.map.MapUtil; | |||
| import cn.hutool.json.JSON; | |||
| import cn.hutool.json.JSONUtil; | |||
| import com.ruoyi.common.core.utils.StringUtils; | |||
| import com.ruoyi.platform.domain.kg.KgEntityProperty; | |||
| import com.ruoyi.platform.domain.kg.KgEntityRelation; | |||
| import com.ruoyi.platform.domain.kg.KgOntologyInfo; | |||
| import com.ruoyi.platform.domain.kg.dto.KgEntityInfoDTO; | |||
| import com.ruoyi.platform.domain.kg.dto.KgOntologyInfoPageDTO; | |||
| import com.ruoyi.platform.domain.kg.dto.KgOntologyNameAndIdDTO; | |||
| import com.ruoyi.platform.domain.kg.dto.KgOntologyUpdateDTO; | |||
| import com.ruoyi.platform.domain.kg.dto.*; | |||
| import com.ruoyi.platform.mapper.kg.KgOntologyInfoMapper; | |||
| import com.ruoyi.platform.service.KgEntityInfoService; | |||
| import com.ruoyi.platform.service.KgEntityPropertiesService; | |||
| import com.ruoyi.platform.service.KgEntityRelationsService; | |||
| import com.ruoyi.platform.service.KgOntologyInfoService; | |||
| import com.ruoyi.platform.service.*; | |||
| import com.ruoyi.platform.utils.JsonUtils; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import org.springframework.transaction.annotation.Transactional; | |||
| import java.io.IOException; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import java.util.stream.Collectors; | |||
| /** | |||
| @@ -38,6 +41,9 @@ public class KgOntologyInfoServiceImpl implements KgOntologyInfoService { | |||
| @Autowired | |||
| private KgEntityRelationsService kgEntityRelationsService; | |||
| @Autowired | |||
| private KgEntityRepository graphNodeRepository; | |||
| @Override | |||
| public void insertOntology(KgOntologyInfo ontology) { | |||
| kgOntologyInfoMapper.insertSelective(ontology); | |||
| @@ -45,31 +51,23 @@ public class KgOntologyInfoServiceImpl implements KgOntologyInfoService { | |||
| @Override | |||
| public void updateOntology(KgOntologyUpdateDTO ontology) { | |||
| kgOntologyInfoMapper.updateById(ontology); | |||
| String dag = ontology.getDag(); | |||
| if (StringUtils.isNotEmpty(dag)) { | |||
| GraphData graphData = jsonToBean(dag); | |||
| ontology.setConceptsCount(CollectionUtil.isEmpty(graphData.getNodes())?0:graphData.getNodes().size()); | |||
| ontology.setRelationsCount(CollectionUtil.isEmpty(graphData.getEdges())?0:graphData.getNodes().size()); | |||
| } | |||
| kgOntologyInfoMapper.updateByPrimaryKeySelective(ontology); | |||
| } | |||
| @Override | |||
| public List<KgOntologyInfo> getOntologies(KgOntologyInfoPageDTO ontology) { | |||
| List<KgOntologyInfo> kgOntologyInfos = kgOntologyInfoMapper.selectList(ontology); | |||
| kgOntologyInfos.forEach(item -> { | |||
| List<KgEntityInfoDTO> kgEntityInfos = kgEntityInfoService.getEntitiesByOntologyId(item.getId()); | |||
| List<Long> entityIds = kgEntityInfos.stream() | |||
| .map(KgEntityInfoDTO::getId) | |||
| .collect(Collectors.toList()); | |||
| List<KgEntityProperty> entityPropertyList = kgEntityPropertiesService.getEntityPropertiesByEntityIds(entityIds); | |||
| List<KgEntityRelation> entityRelationList = kgEntityRelationsService.getEntityRelationsByEntityIds(entityIds); | |||
| item.setConceptsCount(entityPropertyList.size()); | |||
| item.setRelationsCount(entityRelationList.size()); | |||
| }); | |||
| return kgOntologyInfos; | |||
| return kgOntologyInfoMapper.selectList(ontology); | |||
| } | |||
| @Override | |||
| public KgOntologyUpdateDTO getOntology(Long id) { | |||
| KgOntologyUpdateDTO kgOntologyUpdateDTO = kgOntologyInfoMapper.selectByPrimaryKey(id); | |||
| List<KgEntityInfoDTO> kgEntityInfoDTOS = kgEntityInfoService.getEntitiesByOntologyId(id); | |||
| kgOntologyUpdateDTO.setConcepts(kgEntityInfoDTOS); | |||
| return kgOntologyUpdateDTO; | |||
| return kgOntologyInfoMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| @@ -88,23 +86,41 @@ public class KgOntologyInfoServiceImpl implements KgOntologyInfoService { | |||
| return null; | |||
| } | |||
| @Override | |||
| @Transactional | |||
| public void updateDetail(KgOntologyUpdateDTO ontology) { | |||
| List<KgEntityInfoDTO> concepts = ontology.getConcepts(); | |||
| concepts.forEach(item->{ | |||
| Long entityId = item.getId(); | |||
| List<KgEntityProperty> properties = item.getProperties(); | |||
| List<KgEntityRelation> relations = item.getRelations(); | |||
| kgEntityPropertiesService.batchUpdateByEntityId(entityId, properties); | |||
| kgEntityRelationsService.batchUpdateByEntityId(entityId,relations); | |||
| }); | |||
| public void saveGraph(GraphData graphData) { | |||
| // 存储节点 | |||
| Map<Long, KgEntityInfoDTO> nodeMap = new HashMap<>(); | |||
| for (KgEntityInfoDTO kgEntityInfoDTO : graphData.getNodes()) { | |||
| nodeMap.put(kgEntityInfoDTO.getId(), kgEntityInfoDTO); | |||
| graphNodeRepository.save(kgEntityInfoDTO); | |||
| } | |||
| // 存储关系 | |||
| for (KgEntityRelationDTO kgEntityRelationDTO : graphData.getEdges()) { | |||
| KgEntityInfoDTO sourceNode = nodeMap.get(kgEntityRelationDTO.getSource()); | |||
| KgEntityInfoDTO targetNode = nodeMap.get(kgEntityRelationDTO.getTarget()); | |||
| if (sourceNode != null && targetNode != null) { | |||
| kgEntityRelationDTO.setTargetEntity(targetNode); | |||
| sourceNode.getRelations().add(kgEntityRelationDTO); | |||
| graphNodeRepository.save(sourceNode); | |||
| } | |||
| } | |||
| } | |||
| @Override | |||
| public List<KgOntologyNameAndIdDTO> getNameAndIds() { | |||
| return kgOntologyInfoMapper.getNameAndIds(); | |||
| } | |||
| private GraphData jsonToBean(String dag) { | |||
| try { | |||
| return JSONUtil.toBean(dag, GraphData.class); | |||
| } catch (Exception e) { | |||
| return new GraphData(); | |||
| } | |||
| } | |||
| } | |||
| @@ -170,7 +170,7 @@ | |||
| order by update_time desc | |||
| </select> | |||
| <select id="selectListByEntityIds" parameterType="list" resultMap="BaseResultMap"> | |||
| <select id="selectListByEntityIds" parameterType="list" resultType="com.ruoyi.platform.domain.kg.dto.KgEntityRelationDTO"> | |||
| select | |||
| <include refid="Base_Column_List" /> | |||
| from kg_entity_relations | |||
| @@ -7,6 +7,7 @@ | |||
| <result column="description" jdbcType="VARCHAR" property="description" /> | |||
| <result column="concepts_count" jdbcType="INTEGER" property="conceptsCount" /> | |||
| <result column="relations_count" jdbcType="INTEGER" property="relationsCount" /> | |||
| <result column="dag" jdbcType="VARCHAR" property="dag" /> | |||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> | |||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> | |||
| <result column="create_by" jdbcType="VARCHAR" property="createBy" /> | |||
| @@ -14,10 +15,10 @@ | |||
| <result column="del_flag" jdbcType="BOOLEAN" property="delFlag" /> | |||
| </resultMap> | |||
| <sql id="Base_Column_List"> | |||
| id, `name`, description, concepts_count, relations_count, create_time, update_time, | |||
| id, `name`, description, concepts_count, relations_count,dag, create_time, update_time, | |||
| create_by, update_by, del_flag | |||
| </sql> | |||
| <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> | |||
| <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultType="com.ruoyi.platform.domain.kg.dto.KgOntologyUpdateDTO"> | |||
| select | |||
| <include refid="Base_Column_List" /> | |||
| from kg_ontology_info | |||
| @@ -33,11 +34,11 @@ | |||
| </delete> | |||
| <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.platform.domain.kg.KgOntologyInfo" useGeneratedKeys="true"> | |||
| insert into kg_ontology_info (`name`, description, concepts_count, | |||
| relations_count, create_time, update_time, | |||
| relations_count,dag, create_time, update_time, | |||
| create_by, update_by, del_flag | |||
| ) | |||
| values (#{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{conceptsCount,jdbcType=INTEGER}, | |||
| #{relationsCount,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, | |||
| #{relationsCount,jdbcType=INTEGER},#{dag,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, | |||
| #{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR}, #{delFlag,jdbcType=BOOLEAN} | |||
| ) | |||
| </insert> | |||
| @@ -56,6 +57,9 @@ | |||
| <if test="relationsCount != null"> | |||
| relations_count, | |||
| </if> | |||
| <if test="dag != null"> | |||
| dag, | |||
| </if> | |||
| <if test="createTime != null"> | |||
| create_time, | |||
| </if> | |||
| @@ -85,6 +89,9 @@ | |||
| <if test="relationsCount != null"> | |||
| #{relationsCount,jdbcType=INTEGER}, | |||
| </if> | |||
| <if test="dag != null"> | |||
| #{dag,jdbcType=VARCHAR}, | |||
| </if> | |||
| <if test="createTime != null"> | |||
| #{createTime,jdbcType=TIMESTAMP}, | |||
| </if> | |||
| @@ -117,6 +124,9 @@ | |||
| <if test="relationsCount != null"> | |||
| relations_count = #{relationsCount,jdbcType=INTEGER}, | |||
| </if> | |||
| <if test="dag != null"> | |||
| dag = #{dag,jdbcType=VARCHAR}, | |||
| </if> | |||
| <if test="createTime != null"> | |||
| create_time = #{createTime,jdbcType=TIMESTAMP}, | |||
| </if> | |||
| @@ -141,6 +151,7 @@ | |||
| description = #{description,jdbcType=VARCHAR}, | |||
| concepts_count = #{conceptsCount,jdbcType=INTEGER}, | |||
| relations_count = #{relationsCount,jdbcType=INTEGER}, | |||
| dag = #{dag,jdbcType=VARCHAR}, | |||
| create_time = #{createTime,jdbcType=TIMESTAMP}, | |||
| update_time = #{updateTime,jdbcType=TIMESTAMP}, | |||
| create_by = #{createBy,jdbcType=VARCHAR}, | |||