mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-08 09:38:26 +08:00
This commit is contained in:
parent
714e783c0d
commit
79848b304b
@ -376,8 +376,18 @@ public class QueryWrapper extends BaseQueryWrapper<QueryWrapper> {
|
|||||||
SqlOperator operator = operators.get(entry.getKey());
|
SqlOperator operator = operators.get(entry.getKey());
|
||||||
if (operator == null) {
|
if (operator == null) {
|
||||||
operator = SqlOperator.EQUALS;
|
operator = SqlOperator.EQUALS;
|
||||||
|
} else if (operator == SqlOperator.IGNORE) {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
QueryCondition cond = QueryCondition.create(new QueryColumn(entry.getKey()), operator.getValue(), entry.getValue());
|
Object value = entry.getValue();
|
||||||
|
if (operator == SqlOperator.LIKE || operator == SqlOperator.NOT_LIKE) {
|
||||||
|
value = "%" + value + "%";
|
||||||
|
} else if (operator == SqlOperator.LIKE_LEFT || operator == SqlOperator.NOT_LIKE_LEFT) {
|
||||||
|
value = value + "%";
|
||||||
|
} else if (operator == SqlOperator.LIKE_RIGHT || operator == SqlOperator.NOT_LIKE_RIGHT) {
|
||||||
|
value = "%" + value;
|
||||||
|
}
|
||||||
|
QueryCondition cond = QueryCondition.create(new QueryColumn(entry.getKey()), operator, value);
|
||||||
if (condition == null) {
|
if (condition == null) {
|
||||||
condition = cond;
|
condition = cond;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -990,9 +990,11 @@ public class TableInfo {
|
|||||||
.filter(e -> e.getName().equals(column))
|
.filter(e -> e.getName().equals(column))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.orElse(QueryMethods.column(getTableNameWithSchema(), column));
|
.orElse(QueryMethods.column(getTableNameWithSchema(), column));
|
||||||
if (operators != null && operators.containsKey(property)) {
|
if (operators != null) {
|
||||||
SqlOperator operator = operators.get(property);
|
SqlOperator operator = operators.get(property);
|
||||||
if (operator == SqlOperator.IGNORE) {
|
if (operator == null) {
|
||||||
|
operator = SqlOperator.EQUALS;
|
||||||
|
} else if (operator == SqlOperator.IGNORE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (operator == SqlOperator.LIKE || operator == SqlOperator.NOT_LIKE) {
|
if (operator == SqlOperator.LIKE || operator == SqlOperator.NOT_LIKE) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user