Browse Source

update 通用条件查询/woniu-web-master/src/main/java/com/woniu/util/AggregateQueriesUtil.java.

当请求参数为空字符串时不拼接进查询语句
pull/2/head
blackchoice 10 months ago
committed by Gitee
parent
commit
8ec4351429
No known key found for this signature in database GPG Key ID: 173E9B9CA92EEF8F
  1. 4
      通用条件查询/woniu-web-master/src/main/java/com/woniu/util/AggregateQueriesUtil.java

4
通用条件查询/woniu-web-master/src/main/java/com/woniu/util/AggregateQueriesUtil.java

@ -46,7 +46,7 @@ public class AggregateQueriesUtil {
field.setAccessible(true); field.setAccessible(true);
String underlineCase = StrUtil.toUnderlineCase(field.getName()); String underlineCase = StrUtil.toUnderlineCase(field.getName());
try { try {
if (field.get(obj) != null) { if (field.get(obj) != null && field.get(obj) != "") {
queries.eq(underlineCase, field.get(obj)); queries.eq(underlineCase, field.get(obj));
} }
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
@ -69,7 +69,7 @@ public class AggregateQueriesUtil {
field.setAccessible(true); field.setAccessible(true);
String underlineCase = StrUtil.toUnderlineCase(field.getName()); String underlineCase = StrUtil.toUnderlineCase(field.getName());
try { try {
if (field.get(obj) != null) { if (field.get(obj) != null && field.get(obj) != "") {
queries.like(underlineCase, field.get(obj)); queries.like(underlineCase, field.get(obj));
} }
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {

Loading…
Cancel
Save