mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-08 01:28:24 +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());
|
||||
if (operator == null) {
|
||||
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) {
|
||||
condition = cond;
|
||||
} else {
|
||||
|
||||
@ -990,9 +990,11 @@ public class TableInfo {
|
||||
.filter(e -> e.getName().equals(column))
|
||||
.findFirst()
|
||||
.orElse(QueryMethods.column(getTableNameWithSchema(), column));
|
||||
if (operators != null && operators.containsKey(property)) {
|
||||
if (operators != null) {
|
||||
SqlOperator operator = operators.get(property);
|
||||
if (operator == SqlOperator.IGNORE) {
|
||||
if (operator == null) {
|
||||
operator = SqlOperator.EQUALS;
|
||||
} else if (operator == SqlOperator.IGNORE) {
|
||||
return;
|
||||
}
|
||||
if (operator == SqlOperator.LIKE || operator == SqlOperator.NOT_LIKE) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user