#9885·JeecgBoot

高级查询不为空规则无效

Author: q060831Created Sep 15, 2026Updated Sep 15, 2026
Labelsbug

版本号:3.9.5

分支:main

问题描述:org.jeecg.common.system.query.QueryGenerator里根本就不构建不为空规则,不为空规则传入{rule: 'not_empty', val: ''},直接就被过滤掉了

				// 代码逻辑说明: 【JTC-573】 过滤空条件查询,防止 sql 拼接多余的 and
				List<QueryCondition> filterConditions = conditions.stream().filter(
						rule -> (oConvertUtils.isNotEmpty(rule.getField())
													&& oConvertUtils.isNotEmpty(rule.getRule())
													&& oConvertUtils.isNotEmpty(rule.getVal())
													&& fieldColumnMap.containsKey(rule.getField())
												 )
												|| "empty".equals(rule.getRule())
				).collect(Collectors.toList());
				if (filterConditions.size() == 0) {
					return;
				}