소스 검색

1、术语关联映射-分页查询

zhaops 3 년 전
부모
커밋
75082aefa2

+ 12 - 3
src/main/java/com/diagbot/facade/MappingConfigFacade.java

@@ -179,7 +179,8 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
             ConceptVO conceptVO = new ConceptVO();
             conceptVO.setSource(-1);
             conceptVO.setIds(dbConceptIds);
-            conceptVO.setStatus(mappingConfigPageVO.getStatus());
+            //conceptVO.setStatus(mappingConfigPageVO.getStatus());
+            conceptVO.setStatus(StatusEnum.Disable.getKey());
             RespDTO<List<IndexBatchDTO>> conceptRespDTO = null;
             if (ListUtil.isEmpty(conceptIds)
                     && mappingConfigPageVO.getStatus() != null
@@ -189,7 +190,11 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
                     conceptIds = conceptRespDTO.data.stream().map(IndexBatchDTO::getId).collect(Collectors.toList());
                 }
                 if (ListUtil.isNotEmpty(conceptIds)) {
-                    mappingConfigPageVO.setConceptIds(conceptIds);
+                    if (mappingConfigPageVO.getStatus().equals(StatusEnum.Disable.getKey())) {
+                        mappingConfigPageVO.setConceptIds(conceptIds);
+                    } else if (mappingConfigPageVO.getStatus().equals(StatusEnum.Enable.getKey())) {
+                        mappingConfigPageVO.setNotInConceptIds(conceptIds);
+                    }
                 } else {
                     //没有启用禁用记录时返回空而不是全量
                     mappingConfigPageVO.setConceptIds(Arrays.asList(new Long[] { -1L }));
@@ -207,7 +212,11 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
 
                 }
                 if (ListUtil.isNotEmpty(formConceptIds)) {
-                    mappingConfigPageVO.setFormConceptIds(formConceptIds);
+                    if (mappingConfigPageVO.getFormStatus().equals(StatusEnum.Disable.getKey())) {
+                        mappingConfigPageVO.setFormConceptIds(formConceptIds);
+                    } else if (mappingConfigPageVO.getFormStatus().equals(StatusEnum.Enable.getKey())) {
+                        mappingConfigPageVO.setNotInFormConceptIds(formConceptIds);
+                    }
                 } else {
                     //没有启用禁用记录时返回空而不是全量
                     mappingConfigPageVO.setFormConceptIds(Arrays.asList(new Long[] { -1L }));

+ 4 - 0
src/main/java/com/diagbot/vo/MappingConfigPageVO.java

@@ -48,6 +48,8 @@ public class MappingConfigPageVO extends Page {
     private String uniqueName;
     @ApiModelProperty(hidden = true)
     private List<Long> conceptIds;
+    @ApiModelProperty(hidden = true)
+    private List<Long> notInConceptIds;
 
     /**
      * 药品剂型
@@ -55,6 +57,8 @@ public class MappingConfigPageVO extends Page {
     private String form;
     @ApiModelProperty(hidden = true)
     private List<Long> formConceptIds;
+    @ApiModelProperty(hidden = true)
+    private List<Long> notInFormConceptIds;
 
     /**
      * 是否匹配(0-未匹配、1-已匹配、2-多条匹配)

+ 30 - 0
src/main/resources/mapper/MappingConfigMapper.xml

@@ -50,6 +50,13 @@
                 #{conceptId}
             </foreach>
         </if>
+        <if test="mappingConfigPageVO.notInConceptIds!=null and mappingConfigPageVO.notInConceptIds.size()>0">
+            and a.concept_id is not null
+            and a.concept_id not in
+            <foreach item="notInConceptId" collection="mappingConfigPageVO.notInConceptIds" open="(" separator="," close=")">
+                #{notInConceptId}
+            </foreach>
+        </if>
         <if test="mappingConfigPageVO.formConceptIds!=null and mappingConfigPageVO.formConceptIds.size()>0">
             and a.form_concept_id in
             <foreach item="formConceptId" collection="mappingConfigPageVO.formConceptIds" open="(" separator=","
@@ -57,6 +64,14 @@
                 #{formConceptId}
             </foreach>
         </if>
+        <if test="mappingConfigPageVO.notInFormConceptIds!=null and mappingConfigPageVO.notInFormConceptIds.size()>0">
+            and a.form_concept_id is not null
+            and a.form_concept_id in
+            <foreach item="notInFormConceptId" collection="mappingConfigPageVO.notInFormConceptIds" open="(" separator=","
+                     close=")">
+                #{notInFormConceptId}
+            </foreach>
+        </if>
         <if test="mappingConfigPageVO.isMatch!=null">
             and a.is_match=#{mappingConfigPageVO.isMatch}
         </if>
@@ -86,6 +101,13 @@
                     #{conceptId}
                 </foreach>
             </if>
+            <if test="mappingConfigPageVO.notInConceptIds!=null and mappingConfigPageVO.notInConceptIds.size()>0">
+                and a.concept_id is not null
+                and a.concept_id not in
+                <foreach item="notInConceptId" collection="mappingConfigPageVO.notInConceptIds" open="(" separator="," close=")">
+                    #{notInConceptId}
+                </foreach>
+            </if>
             <if test="mappingConfigPageVO.formConceptIds!=null and mappingConfigPageVO.formConceptIds.size()>0">
                 and a.form_concept_id in
                 <foreach item="formConceptId" collection="mappingConfigPageVO.formConceptIds" open="(" separator=","
@@ -93,6 +115,14 @@
                     #{formConceptId}
                 </foreach>
             </if>
+            <if test="mappingConfigPageVO.notInFormConceptIds!=null and mappingConfigPageVO.notInFormConceptIds.size()>0">
+                and a.form_concept_id is not null
+                and a.form_concept_id in
+                <foreach item="notInFormConceptId" collection="mappingConfigPageVO.notInFormConceptIds" open="(" separator=","
+                         close=")">
+                    #{notInFormConceptId}
+                </foreach>
+            </if>
             group by a.his_name
             <if test="mappingConfigPageVO.type!=null and mappingConfigPageVO.type==1">
                 ,a.his_detail_name