mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
!!! 破坏性更新, likeLeft 和 likeRight 行为替换,使之更加符合查询直觉。
This commit is contained in:
parent
c16c99d72d
commit
6f30da2821
@ -167,14 +167,14 @@ public class QueryColumn implements CloneSupport<QueryColumn> {
|
||||
if (value == null) {
|
||||
return QueryCondition.createEmpty();
|
||||
}
|
||||
return QueryCondition.create(this, QueryCondition.LOGIC_LIKE, "%" + value);
|
||||
return QueryCondition.create(this, QueryCondition.LOGIC_LIKE, value + "%");
|
||||
}
|
||||
|
||||
public <T> QueryCondition likeLeft(Object value, Predicate<T> fn) {
|
||||
if (value == null) {
|
||||
return QueryCondition.createEmpty();
|
||||
}
|
||||
return QueryCondition.create(this, QueryCondition.LOGIC_LIKE, "%" + value).when(fn);
|
||||
return QueryCondition.create(this, QueryCondition.LOGIC_LIKE, value + "%").when(fn);
|
||||
}
|
||||
|
||||
|
||||
@ -182,14 +182,14 @@ public class QueryColumn implements CloneSupport<QueryColumn> {
|
||||
if (value == null) {
|
||||
return QueryCondition.createEmpty();
|
||||
}
|
||||
return QueryCondition.create(this, QueryCondition.LOGIC_LIKE, value + "%");
|
||||
return QueryCondition.create(this, QueryCondition.LOGIC_LIKE, "%" + value);
|
||||
}
|
||||
|
||||
public <T> QueryCondition likeRight(Object value, Predicate<T> fn) {
|
||||
if (value == null) {
|
||||
return QueryCondition.createEmpty();
|
||||
}
|
||||
return QueryCondition.create(this, QueryCondition.LOGIC_LIKE, value + "%").when(fn);
|
||||
return QueryCondition.create(this, QueryCondition.LOGIC_LIKE, "%" + value).when(fn);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user