Browse Source

档案查询,多字段

qianxb 1 năm trước cách đây
mục cha
commit
d4f0ef5f1f

+ 5 - 0
blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/vo/ArchivesAutoVO.java

@@ -75,6 +75,11 @@ public class ArchivesAutoVO extends ArchivesAuto {
 	@ApiModelProperty("输入框查询条件")
 	private String queryValue;
 
+	/**
+	 * 输入框查询条件集合
+	 */
+	private List<String> queryList;
+
 	/**
 	 * 节点查询条件
 	 */

+ 14 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/mapper/ArchivesAutoMapper.xml

@@ -467,6 +467,13 @@
         <if test="vo.queryValue != null and vo.queryValue != ''">
             and (uaa.name like concat('%',#{vo.queryValue},'%') or uaa.file_number like concat('%',#{vo.queryValue},'%'))
         </if>
+        <if test="vo.searchType == 1 and vo.queryList != null and vo.queryList.size > 0">
+            and (
+            <foreach collection="vo.queryList" item="query" separator="or" >
+                uaa.name like concat('%',#{query},'%')
+            </foreach>
+            )
+        </if>
         <if test="vo.projectId != null and vo.projectId != ''">
             and matc.project_id = #{vo.projectId}
         </if>
@@ -523,6 +530,13 @@
         <if test="vo.searchType == 1 and vo.queryValue != null and vo.queryValue != ''">
             and uaa.name like concat('%',#{vo.queryValue},'%')
         </if>
+        <if test="vo.searchType == 1 and vo.queryList != null and vo.queryList.size > 0">
+            and (
+            <foreach collection="vo.queryList" item="query" separator="or" >
+                uaa.name like concat('%',#{query},'%')
+            </foreach>
+            )
+        </if>
         <if test="vo.searchType == 2 and vo.queryValue != null and vo.queryValue != ''">
             and uaf.file_name like concat('%',#{vo.queryValue},'%')
         </if>

+ 13 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchivesAutoServiceImpl.java

@@ -155,6 +155,19 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 		if (StringUtils.isNotBlank(vo.getCarrierType())) {
 			vo.setCarrierTypes(Arrays.asList(vo.getCarrierType().split(",")));
 		}
+		//判断是否多字段查询
+		if (StringUtils.isNotBlank(vo.getQueryValue())){
+			String queryValue = vo.getQueryValue();
+			if (queryValue.contains(",") || queryValue.contains(",")){
+				if (queryValue.contains(",")){
+					vo.setQueryList(Func.toStrList(",",queryValue));
+				}else if (queryValue.contains(",")){
+					vo.setQueryList(Func.toStrList(",",queryValue));
+				}
+				vo.setQueryValue(null);
+			}
+		}
+		//新增
 		List<ArchivesAutoVO> archivesAutos = null;
 		//获取合同段类型
 		ContractInfo contractInfo = contractClient.getContractById(vo.getContractId());