Browse Source

概念列表查询修改

rgb 6 years ago
parent
commit
0a48d8ff26

+ 16 - 20
knowledgeman-service/src/main/java/com/diagbot/facade/ConceptFacade.java

@@ -238,10 +238,25 @@ public class ConceptFacade extends ConceptServiceImpl {
     public IPage<GetAllInformationDTO> getAllInformation(GetAllInformationVO getAllInformationVO) {
     	Page<GetAllInformationDTO> getAllInformationDTOPage = new Page<>();
     	
+    	int typeId = LexiconTypeEnum.getKey(getAllInformationVO.getType());
+    	
+    	List<Long> conceptIdList = null;
+    	if(StringUtil.isBlank(getAllInformationVO.getLibName())&&StringUtil.isNotBlank(getAllInformationVO.getName())){
+    		getAllInformationVO.setLibName(getAllInformationVO.getName());
+    	}
+    	if(StringUtil.isNotBlank(getAllInformationVO.getLibName())){
+    		QueryWrapper<LibraryInfo> libraryInfoQe = new QueryWrapper<>();
+    		libraryInfoQe.eq("is_deleted", IsDeleteEnum.N.getKey());
+    		libraryInfoQe.like("name", getAllInformationVO.getLibName());
+    		libraryInfoQe.eq(StringUtil.isNotBlank(getAllInformationVO.getType()),"type_id", typeId);
+    		conceptIdList = libraryinfoFacade.list(libraryInfoQe).stream().map(i->i.getConceptId()).distinct().collect(Collectors.toList());
+    	}
+    	
     	Page<Concept> conceptPage = new Page<>(getAllInformationVO.getCurrent(),getAllInformationVO.getSize());
     	QueryWrapper<Concept> conceptQe = new QueryWrapper<>();
+    	conceptQe.in(ListUtil.isNotEmpty(conceptIdList), "id", conceptIdList);
     	conceptQe.like(StringUtil.isNotBlank(getAllInformationVO.getName()),"lib_name", getAllInformationVO.getName());
-    	conceptQe.eq(StringUtil.isNotBlank(getAllInformationVO.getType()),"lib_type", LexiconTypeEnum.getKey(getAllInformationVO.getType()));
+    	conceptQe.eq(StringUtil.isNotBlank(getAllInformationVO.getType()),"lib_type", typeId);
     	conceptQe.eq(StringUtil.isNotBlank(getAllInformationVO.getIsDeleted()),"is_deleted", getAllInformationVO.getIsDeleted());
     	conceptQe.orderByAsc("is_deleted");
     	conceptQe.orderByDesc("gmt_modified");
@@ -280,25 +295,6 @@ public class ConceptFacade extends ConceptServiceImpl {
         return getAllInformationDTOPage;
     }
     
-    
-    public static void main(String[] args){
-    	LibraryInfo libraryInfo1 = new LibraryInfo();
-    	libraryInfo1.setIsConcept(1);
-    	libraryInfo1.setName("rgb");
-    	
-    	LibraryInfo libraryInfo2 = new LibraryInfo();
-    	libraryInfo2.setIsConcept(0);
-    	libraryInfo2.setName("zsj");
-    	
-    	List<LibraryInfo> list = Lists.newArrayList();
-    	list.add(libraryInfo1);
-    	list.add(libraryInfo2);
-    	
-    	String ss = list.stream().sorted((a,b)->b.getIsConcept()-a.getIsConcept()).map(k->k.getName()).collect(Collectors.joining("、"));
-    
-    	System.out.println(ss);
-    }
-
     /**
      * 医学术语命名删除或者恢复
      *

+ 8 - 2
knowledgeman-service/src/main/java/com/diagbot/vo/GetAllInformationVO.java

@@ -24,10 +24,16 @@ public class GetAllInformationVO {
     private long current = 1;
     
     /**
-     * 术语名称
+     * 标准术语名称
      */
-    @ApiModelProperty(value="术语名称")
+    @ApiModelProperty(value="标准术语名称")
     private String name;
+    
+    /**
+     * 同义词名称
+     */
+    @ApiModelProperty(value="同义词名称")
+    private String libName;
 
     /**
      * 术语类型