| @@ -10,6 +10,7 @@ import com.ruoyi.platform.domain.kg.dto.KgInfoIdDTO; | |||||
| import com.ruoyi.platform.service.KgInfoService; | import com.ruoyi.platform.service.KgInfoService; | ||||
| import com.ruoyi.system.api.domain.SysDictData; | import com.ruoyi.system.api.domain.SysDictData; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.validation.annotation.Validated; | |||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| @@ -32,7 +33,7 @@ public class KgInfoController extends BaseController { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| @PostMapping() | @PostMapping() | ||||
| public R<String> createKgInfo(@RequestBody KgInfo kgInfo) { | |||||
| public R<String> createKgInfo(@Validated @RequestBody KgInfo kgInfo) { | |||||
| kgInfoService.insertKgInfo(kgInfo); | kgInfoService.insertKgInfo(kgInfo); | ||||
| return R.ok(); | return R.ok(); | ||||
| } | } | ||||
| @@ -44,7 +45,7 @@ public class KgInfoController extends BaseController { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| @PutMapping | @PutMapping | ||||
| public R<String> updateKgInfo(@RequestBody KgInfo kgInfo) { | |||||
| public R<String> updateKgInfo(@Validated @RequestBody KgInfo kgInfo) { | |||||
| kgInfoService.updateKgInfo(kgInfo); | kgInfoService.updateKgInfo(kgInfo); | ||||
| return R.ok(); | return R.ok(); | ||||
| } | } | ||||
| @@ -6,6 +6,8 @@ import com.ruoyi.common.core.web.controller.BaseController; | |||||
| import com.ruoyi.common.core.web.page.TableDataInfo; | import com.ruoyi.common.core.web.page.TableDataInfo; | ||||
| import com.ruoyi.common.security.utils.SecurityUtils; | import com.ruoyi.common.security.utils.SecurityUtils; | ||||
| import com.ruoyi.platform.domain.kg.KgOntologyInfo; | import com.ruoyi.platform.domain.kg.KgOntologyInfo; | ||||
| 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.KgOntologyUpdateDTO; | ||||
| import com.ruoyi.platform.service.KgOntologyInfoService; | import com.ruoyi.platform.service.KgOntologyInfoService; | ||||
| import com.ruoyi.system.api.domain.SysDictData; | import com.ruoyi.system.api.domain.SysDictData; | ||||
| @@ -67,13 +69,22 @@ public class KgOntologyInfoController extends BaseController { | |||||
| * 主体列表 | * 主体列表 | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| @GetMapping("/list") | |||||
| public TableDataInfo getOntologies(@RequestBody KgOntologyInfo ontology) { | |||||
| @PostMapping("/list") | |||||
| public TableDataInfo getOntologies(@RequestBody KgOntologyInfoPageDTO ontology) { | |||||
| startPage(); | startPage(); | ||||
| List<KgOntologyInfo> ontologies = kgOntologyInfoService.getOntologies(ontology); | List<KgOntologyInfo> ontologies = kgOntologyInfoService.getOntologies(ontology); | ||||
| return getDataTable(ontologies); | return getDataTable(ontologies); | ||||
| } | } | ||||
| /** | |||||
| * 新增图谱时关联主体内容 | |||||
| * @return | |||||
| */ | |||||
| @GetMapping("/getBasicInfo") | |||||
| public R<List<KgOntologyNameAndIdDTO>> getNameAndIds() { | |||||
| return R.ok(kgOntologyInfoService.getNameAndIds()); | |||||
| } | |||||
| /** | /** | ||||
| * 主体详情 | * 主体详情 | ||||
| * @param id | * @param id | ||||
| @@ -4,6 +4,8 @@ import java.io.Serializable; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| import javax.validation.constraints.NotNull; | |||||
| /** | /** | ||||
| * kg_entity_info | * kg_entity_info | ||||
| */ | */ | ||||
| @@ -17,6 +19,7 @@ public class KgEntityInfo implements Serializable { | |||||
| /** | /** | ||||
| * 实体名称 | * 实体名称 | ||||
| */ | */ | ||||
| @NotNull(message = "实体名称不能为空") | |||||
| private String name; | private String name; | ||||
| /** | /** | ||||
| @@ -32,11 +35,13 @@ public class KgEntityInfo implements Serializable { | |||||
| /** | /** | ||||
| * 横坐标 | * 横坐标 | ||||
| */ | */ | ||||
| @NotNull(message = "横坐标不能为空") | |||||
| private Integer displayX; | private Integer displayX; | ||||
| /** | /** | ||||
| * 纵坐标 | * 纵坐标 | ||||
| */ | */ | ||||
| @NotNull(message = "纵坐标不能为空") | |||||
| private Integer displayY; | private Integer displayY; | ||||
| /** | /** | ||||
| @@ -47,6 +52,7 @@ public class KgEntityInfo implements Serializable { | |||||
| /** | /** | ||||
| * 主体主键 | * 主体主键 | ||||
| */ | */ | ||||
| @NotNull(message = "主体主键不能为空") | |||||
| private Long ontologyId; | private Long ontologyId; | ||||
| /** | /** | ||||
| @@ -4,6 +4,8 @@ import java.io.Serializable; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| import javax.validation.constraints.NotNull; | |||||
| /** | /** | ||||
| * kg_entity_properties | * kg_entity_properties | ||||
| */ | */ | ||||
| @@ -17,11 +19,13 @@ public class KgEntityProperty implements Serializable { | |||||
| /** | /** | ||||
| * 属性名 | * 属性名 | ||||
| */ | */ | ||||
| @NotNull(message = "属性名不能为空") | |||||
| private String name; | private String name; | ||||
| /** | /** | ||||
| * 属性类型(String/Integer等) | * 属性类型(String/Integer等) | ||||
| */ | */ | ||||
| @NotNull(message = "属性类型不能为空") | |||||
| private String type; | private String type; | ||||
| /** | /** | ||||
| @@ -32,6 +36,7 @@ public class KgEntityProperty implements Serializable { | |||||
| /** | /** | ||||
| * '是否多值(0否/1是) | * '是否多值(0否/1是) | ||||
| */ | */ | ||||
| @NotNull(message = "是否多值不能为空") | |||||
| private Boolean isMultivalued; | private Boolean isMultivalued; | ||||
| /** | /** | ||||
| @@ -4,6 +4,8 @@ import java.io.Serializable; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| import javax.validation.constraints.NotNull; | |||||
| /** | /** | ||||
| * kg_entity_relations | * kg_entity_relations | ||||
| */ | */ | ||||
| @@ -17,6 +19,7 @@ public class KgEntityRelation implements Serializable { | |||||
| /** | /** | ||||
| * 关系名称 | * 关系名称 | ||||
| */ | */ | ||||
| @NotNull(message = "属性名不能为空") | |||||
| private String name; | private String name; | ||||
| /** | /** | ||||
| @@ -27,11 +30,13 @@ public class KgEntityRelation implements Serializable { | |||||
| /** | /** | ||||
| * 终点实体ID | * 终点实体ID | ||||
| */ | */ | ||||
| @NotNull(message = "终点实体ID不能为空") | |||||
| private Long targetId; | private Long targetId; | ||||
| /** | /** | ||||
| * 起点实体ID | * 起点实体ID | ||||
| */ | */ | ||||
| @NotNull(message = "起点实体ID不能为空") | |||||
| private Long sourceId; | private Long sourceId; | ||||
| /** | /** | ||||
| @@ -0,0 +1,30 @@ | |||||
| package com.ruoyi.platform.domain.kg.dto; | |||||
| import lombok.Data; | |||||
| import javax.validation.constraints.NotNull; | |||||
| /** | |||||
| * kg_ontology_info | |||||
| */ | |||||
| @Data | |||||
| public class KgOntologyInfoPageDTO { | |||||
| /** | |||||
| * 主体名称 | |||||
| */ | |||||
| private String name; | |||||
| /** | |||||
| * 每页大小 | |||||
| */ | |||||
| @NotNull(message = "每页大小不能为空") | |||||
| private Integer pageSize; | |||||
| /** | |||||
| * 页码 | |||||
| */ | |||||
| @NotNull(message = "页码不能为空") | |||||
| private Integer pageNum; | |||||
| } | |||||
| @@ -0,0 +1,19 @@ | |||||
| package com.ruoyi.platform.domain.kg.dto; | |||||
| import lombok.Data; | |||||
| import javax.validation.constraints.NotNull; | |||||
| @Data | |||||
| public class KgOntologyNameAndIdDTO { | |||||
| /** | |||||
| * 主体主键 | |||||
| */ | |||||
| private Long id; | |||||
| /** | |||||
| * 主体名称 | |||||
| */ | |||||
| @NotNull(message = "主体名称不能为空") | |||||
| private String name; | |||||
| } | |||||
| @@ -23,5 +23,5 @@ public interface KgEntityPropertiesMapper extends BaseMapper<KgEntityProperty> { | |||||
| List<KgEntityProperty> selectList(KgEntityProperty record); | List<KgEntityProperty> selectList(KgEntityProperty record); | ||||
| List<KgEntityProperty> selectListByEntityIds(@Param("list") List<Long> entityIds); | |||||
| List<KgEntityProperty> selectListByEntityIds( List<Long> entityIds); | |||||
| } | } | ||||
| @@ -2,6 +2,8 @@ package com.ruoyi.platform.mapper.kg; | |||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||||
| import com.ruoyi.platform.domain.kg.KgOntologyInfo; | import com.ruoyi.platform.domain.kg.KgOntologyInfo; | ||||
| 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.KgOntologyUpdateDTO; | ||||
| import org.apache.ibatis.annotations.Mapper; | import org.apache.ibatis.annotations.Mapper; | ||||
| import org.apache.ibatis.annotations.Param; | import org.apache.ibatis.annotations.Param; | ||||
| @@ -25,9 +27,12 @@ public interface KgOntologyInfoMapper extends BaseMapper<KgOntologyInfo> { | |||||
| void deleteByPrimaryKey(@Param("id") Long id); | void deleteByPrimaryKey(@Param("id") Long id); | ||||
| List<KgOntologyInfo> selectList(KgOntologyInfo ontology); | |||||
| void deleteByIds(List<Long> ids); | |||||
| List<KgOntologyInfo> selectList(KgOntologyInfoPageDTO ontology); | |||||
| List<KgOntologyNameAndIdDTO> getNameAndIds(); | |||||
| } | } | ||||
| @@ -2,6 +2,8 @@ package com.ruoyi.platform.service; | |||||
| import com.ruoyi.platform.domain.kg.KgOntologyInfo; | import com.ruoyi.platform.domain.kg.KgOntologyInfo; | ||||
| 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.KgOntologyUpdateDTO; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -17,7 +19,7 @@ public interface KgOntologyInfoService { | |||||
| void updateOntology(KgOntologyUpdateDTO ontology); | void updateOntology(KgOntologyUpdateDTO ontology); | ||||
| List<KgOntologyInfo> getOntologies(KgOntologyInfo ontology); | |||||
| List<KgOntologyInfo> getOntologies(KgOntologyInfoPageDTO ontology); | |||||
| KgOntologyUpdateDTO getOntology(Long id); | KgOntologyUpdateDTO getOntology(Long id); | ||||
| @@ -28,4 +30,6 @@ public interface KgOntologyInfoService { | |||||
| String importOntology(List<KgOntologyInfo> ontologyList, boolean updateSupport, String operName); | String importOntology(List<KgOntologyInfo> ontologyList, boolean updateSupport, String operName); | ||||
| void updateDetail(KgOntologyUpdateDTO ontology); | void updateDetail(KgOntologyUpdateDTO ontology); | ||||
| List<KgOntologyNameAndIdDTO> getNameAndIds(); | |||||
| } | } | ||||
| @@ -1,12 +1,15 @@ | |||||
| package com.ruoyi.platform.service.impl; | package com.ruoyi.platform.service.impl; | ||||
| import cn.hutool.core.collection.CollectionUtil; | |||||
| import cn.hutool.core.util.ObjectUtil; | import cn.hutool.core.util.ObjectUtil; | ||||
| import com.ruoyi.platform.domain.kg.KgEntityProperty; | import com.ruoyi.platform.domain.kg.KgEntityProperty; | ||||
| import com.ruoyi.platform.mapper.kg.KgEntityPropertiesMapper; | import com.ruoyi.platform.mapper.kg.KgEntityPropertiesMapper; | ||||
| import com.ruoyi.platform.service.KgEntityPropertiesService; | import com.ruoyi.platform.service.KgEntityPropertiesService; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | |||||
| import java.util.Collections; | |||||
| import java.util.List; | import java.util.List; | ||||
| /** | /** | ||||
| @@ -30,6 +33,7 @@ public class KgEntityPropertiesServiceImpl implements KgEntityPropertiesService | |||||
| } | } | ||||
| @Override | @Override | ||||
| @Transactional | |||||
| public void batchUpdateByEntityId(Long entityId, List<KgEntityProperty> entityProperties) { | public void batchUpdateByEntityId(Long entityId, List<KgEntityProperty> entityProperties) { | ||||
| entityProperties.forEach(item -> { | entityProperties.forEach(item -> { | ||||
| if (ObjectUtil.isNull(item.getId())) { | if (ObjectUtil.isNull(item.getId())) { | ||||
| @@ -48,6 +52,9 @@ public class KgEntityPropertiesServiceImpl implements KgEntityPropertiesService | |||||
| @Override | @Override | ||||
| public List<KgEntityProperty> getEntityPropertiesByEntityIds(List<Long> ids) { | public List<KgEntityProperty> getEntityPropertiesByEntityIds(List<Long> ids) { | ||||
| if (CollectionUtil.isEmpty(ids)){ | |||||
| return Collections.emptyList(); | |||||
| } | |||||
| return kgEntityPropertiesMapper.selectListByEntityIds(ids); | return kgEntityPropertiesMapper.selectListByEntityIds(ids); | ||||
| } | } | ||||
| @@ -1,12 +1,15 @@ | |||||
| package com.ruoyi.platform.service.impl; | package com.ruoyi.platform.service.impl; | ||||
| import cn.hutool.core.collection.CollectionUtil; | |||||
| import cn.hutool.core.util.ObjectUtil; | import cn.hutool.core.util.ObjectUtil; | ||||
| import com.ruoyi.platform.domain.kg.KgEntityRelation; | import com.ruoyi.platform.domain.kg.KgEntityRelation; | ||||
| import com.ruoyi.platform.mapper.kg.KgEntityRelationsMapper; | import com.ruoyi.platform.mapper.kg.KgEntityRelationsMapper; | ||||
| import com.ruoyi.platform.service.KgEntityRelationsService; | import com.ruoyi.platform.service.KgEntityRelationsService; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | |||||
| import java.util.Collections; | |||||
| import java.util.List; | import java.util.List; | ||||
| /** | /** | ||||
| @@ -30,6 +33,7 @@ public class KgEntityRelationsServiceImpl implements KgEntityRelationsService{ | |||||
| } | } | ||||
| @Override | @Override | ||||
| @Transactional | |||||
| public void batchUpdateByEntityId(Long entityId, List<KgEntityRelation> entityRelations) { | public void batchUpdateByEntityId(Long entityId, List<KgEntityRelation> entityRelations) { | ||||
| entityRelations.forEach(item -> { | entityRelations.forEach(item -> { | ||||
| if (ObjectUtil.isNull(item.getId())) { | if (ObjectUtil.isNull(item.getId())) { | ||||
| @@ -48,6 +52,9 @@ public class KgEntityRelationsServiceImpl implements KgEntityRelationsService{ | |||||
| @Override | @Override | ||||
| public List<KgEntityRelation> getEntityRelationsByEntityIds(List<Long> ids) { | public List<KgEntityRelation> getEntityRelationsByEntityIds(List<Long> ids) { | ||||
| if (CollectionUtil.isEmpty(ids)){ | |||||
| return Collections.emptyList(); | |||||
| } | |||||
| return kgEntityRelationsMapper.selectListByEntityIds(ids); | return kgEntityRelationsMapper.selectListByEntityIds(ids); | ||||
| } | } | ||||
| @@ -4,6 +4,8 @@ import com.ruoyi.platform.domain.kg.KgEntityProperty; | |||||
| import com.ruoyi.platform.domain.kg.KgEntityRelation; | import com.ruoyi.platform.domain.kg.KgEntityRelation; | ||||
| import com.ruoyi.platform.domain.kg.KgOntologyInfo; | import com.ruoyi.platform.domain.kg.KgOntologyInfo; | ||||
| import com.ruoyi.platform.domain.kg.dto.KgEntityInfoDTO; | 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.KgOntologyUpdateDTO; | ||||
| import com.ruoyi.platform.mapper.kg.KgOntologyInfoMapper; | import com.ruoyi.platform.mapper.kg.KgOntologyInfoMapper; | ||||
| import com.ruoyi.platform.service.KgEntityInfoService; | import com.ruoyi.platform.service.KgEntityInfoService; | ||||
| @@ -12,6 +14,7 @@ import com.ruoyi.platform.service.KgEntityRelationsService; | |||||
| import com.ruoyi.platform.service.KgOntologyInfoService; | import com.ruoyi.platform.service.KgOntologyInfoService; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
| @@ -46,7 +49,7 @@ public class KgOntologyInfoServiceImpl implements KgOntologyInfoService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public List<KgOntologyInfo> getOntologies(KgOntologyInfo ontology) { | |||||
| public List<KgOntologyInfo> getOntologies(KgOntologyInfoPageDTO ontology) { | |||||
| List<KgOntologyInfo> kgOntologyInfos = kgOntologyInfoMapper.selectList(ontology); | List<KgOntologyInfo> kgOntologyInfos = kgOntologyInfoMapper.selectList(ontology); | ||||
| kgOntologyInfos.forEach(item -> { | kgOntologyInfos.forEach(item -> { | ||||
| List<KgEntityInfoDTO> kgEntityInfos = kgEntityInfoService.getEntitiesByOntologyId(item.getId()); | List<KgEntityInfoDTO> kgEntityInfos = kgEntityInfoService.getEntitiesByOntologyId(item.getId()); | ||||
| @@ -71,12 +74,13 @@ public class KgOntologyInfoServiceImpl implements KgOntologyInfoService { | |||||
| @Override | @Override | ||||
| public void deleteOntologyById(Long id) { | public void deleteOntologyById(Long id) { | ||||
| kgOntologyInfoMapper.deleteById(id); | |||||
| kgOntologyInfoMapper.deleteByPrimaryKey(id); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @Transactional | |||||
| public void batchDelete(List<Long> ids) { | public void batchDelete(List<Long> ids) { | ||||
| kgOntologyInfoMapper.deleteBatchIds(ids); | |||||
| kgOntologyInfoMapper.deleteByIds(ids); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -85,6 +89,7 @@ public class KgOntologyInfoServiceImpl implements KgOntologyInfoService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| @Transactional | |||||
| public void updateDetail(KgOntologyUpdateDTO ontology) { | public void updateDetail(KgOntologyUpdateDTO ontology) { | ||||
| List<KgEntityInfoDTO> concepts = ontology.getConcepts(); | List<KgEntityInfoDTO> concepts = ontology.getConcepts(); | ||||
| concepts.forEach(item->{ | concepts.forEach(item->{ | ||||
| @@ -95,6 +100,11 @@ public class KgOntologyInfoServiceImpl implements KgOntologyInfoService { | |||||
| kgEntityRelationsService.batchUpdateByEntityId(entityId,relations); | kgEntityRelationsService.batchUpdateByEntityId(entityId,relations); | ||||
| }); | }); | ||||
| } | } | ||||
| @Override | |||||
| public List<KgOntologyNameAndIdDTO> getNameAndIds() { | |||||
| return kgOntologyInfoMapper.getNameAndIds(); | |||||
| } | |||||
| } | } | ||||
| @@ -20,13 +20,13 @@ | |||||
| id, `name`, description, bk_color, display_x, display_y, icon, ontology_id, create_time, | id, `name`, description, bk_color, display_x, display_y, icon, ontology_id, create_time, | ||||
| update_time, del_flag, create_by, update_by | update_time, del_flag, create_by, update_by | ||||
| </sql> | </sql> | ||||
| <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> | |||||
| <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> | |||||
| select | select | ||||
| <include refid="Base_Column_List" /> | <include refid="Base_Column_List" /> | ||||
| from kg_entity_info | from kg_entity_info | ||||
| where id = #{id,jdbcType=INTEGER} | where id = #{id,jdbcType=INTEGER} | ||||
| </select> | </select> | ||||
| <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> | |||||
| <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> | |||||
| delete from kg_entity_info | delete from kg_entity_info | ||||
| where id = #{id,jdbcType=INTEGER} | where id = #{id,jdbcType=INTEGER} | ||||
| </delete> | </delete> | ||||
| @@ -17,13 +17,13 @@ | |||||
| id, `name`, `type`, entity_id, is_multivalued, create_time, update_time, del_flag, | id, `name`, `type`, entity_id, is_multivalued, create_time, update_time, del_flag, | ||||
| create_by, update_by | create_by, update_by | ||||
| </sql> | </sql> | ||||
| <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> | |||||
| <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> | |||||
| select | select | ||||
| <include refid="Base_Column_List" /> | <include refid="Base_Column_List" /> | ||||
| from kg_entity_properties | from kg_entity_properties | ||||
| where id = #{id,jdbcType=INTEGER} | where id = #{id,jdbcType=INTEGER} | ||||
| </select> | </select> | ||||
| <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> | |||||
| <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> | |||||
| delete from kg_entity_properties | delete from kg_entity_properties | ||||
| where id = #{id,jdbcType=INTEGER} | where id = #{id,jdbcType=INTEGER} | ||||
| </delete> | </delete> | ||||
| @@ -163,8 +163,8 @@ | |||||
| select | select | ||||
| <include refid="Base_Column_List" /> | <include refid="Base_Column_List" /> | ||||
| from kg_entity_properties | from kg_entity_properties | ||||
| where entity_id IN | |||||
| <foreach item="id" index="index" collection="list" open="(" separator="," close=")"> | |||||
| where entity_id in | |||||
| <foreach collection="list" item="id" open="(" separator="," close=")"> | |||||
| #{id} | #{id} | ||||
| </foreach> | </foreach> | ||||
| </select> | </select> | ||||
| @@ -18,13 +18,13 @@ | |||||
| id, `name`, target, target_id, source_id, entity_id, create_time, update_time, del_flag, create_by, | id, `name`, target, target_id, source_id, entity_id, create_time, update_time, del_flag, create_by, | ||||
| update_by | update_by | ||||
| </sql> | </sql> | ||||
| <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> | |||||
| <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> | |||||
| select | select | ||||
| <include refid="Base_Column_List" /> | <include refid="Base_Column_List" /> | ||||
| from kg_entity_relations | from kg_entity_relations | ||||
| where id = #{id,jdbcType=INTEGER} | where id = #{id,jdbcType=INTEGER} | ||||
| </select> | </select> | ||||
| <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> | |||||
| <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> | |||||
| delete from kg_entity_relations | delete from kg_entity_relations | ||||
| where id = #{id,jdbcType=INTEGER} | where id = #{id,jdbcType=INTEGER} | ||||
| </delete> | </delete> | ||||
| @@ -17,13 +17,17 @@ | |||||
| id, `name`, description, concepts_count, relations_count, create_time, update_time, | id, `name`, description, concepts_count, relations_count, create_time, update_time, | ||||
| create_by, update_by, del_flag | create_by, update_by, del_flag | ||||
| </sql> | </sql> | ||||
| <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> | |||||
| <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> | |||||
| select | select | ||||
| <include refid="Base_Column_List" /> | <include refid="Base_Column_List" /> | ||||
| from kg_ontology_info | from kg_ontology_info | ||||
| where id = #{id,jdbcType=INTEGER} | where id = #{id,jdbcType=INTEGER} | ||||
| </select> | </select> | ||||
| <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> | |||||
| <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> | |||||
| delete from kg_ontology_info | |||||
| where id = #{id,jdbcType=INTEGER} | |||||
| </delete> | |||||
| <delete id="deleteByIds" parameterType="java.lang.Long"> | |||||
| delete from kg_ontology_info | delete from kg_ontology_info | ||||
| where id = #{id,jdbcType=INTEGER} | where id = #{id,jdbcType=INTEGER} | ||||
| </delete> | </delete> | ||||
| @@ -149,6 +153,15 @@ | |||||
| select | select | ||||
| <include refid="Base_Column_List" /> | <include refid="Base_Column_List" /> | ||||
| from kg_ontology_info | from kg_ontology_info | ||||
| order by update_time desc | |||||
| <!-- where--> | |||||
| <!-- <if test="name != null and name != ''">--> | |||||
| <!-- `name` = #{name}--> | |||||
| <!-- </if>--> | |||||
| <!-- order by update_time desc--> | |||||
| </select> | |||||
| <select id="getNameAndIds" resultType="com.ruoyi.platform.domain.kg.dto.KgOntologyNameAndIdDTO"> | |||||
| select | |||||
| id,name | |||||
| from kg_ontology_info | |||||
| </select> | </select> | ||||
| </mapper> | </mapper> | ||||