mirror of
https://gitee.com/best_handsome/mybatis-plus-join
synced 2025-07-11 00:02:22 +08:00
关系映射条件处理
This commit is contained in:
parent
7a0179953a
commit
6452cb26ac
@ -498,8 +498,16 @@ public interface MPJDeepMapper<T> extends BaseMapper<T> {
|
|||||||
MPJMappingWrapper infoWrapper = fieldInfo.getWrapper();
|
MPJMappingWrapper infoWrapper = fieldInfo.getWrapper();
|
||||||
MappingQuery<T> wrapper = new MappingQuery<>();
|
MappingQuery<T> wrapper = new MappingQuery<>();
|
||||||
if (infoWrapper.isHasCondition()) {
|
if (infoWrapper.isHasCondition()) {
|
||||||
infoWrapper.getConditionList().forEach(c -> wrapper.addCondition(true, c.getColumn(),
|
infoWrapper.getConditionList().forEach(c -> {
|
||||||
c.getKeyword(), c.getVal()));
|
if (c.getKeyword() == SqlKeyword.BETWEEN) {
|
||||||
|
wrapper.between(c.getColumn(), c.getVal()[0], c.getVal()[1]);
|
||||||
|
} else if (c.getKeyword() == SqlKeyword.IN) {
|
||||||
|
wrapper.in(c.getColumn(), (Object[]) c.getVal());
|
||||||
|
} else {
|
||||||
|
wrapper.addCondition(true, c.getColumn(),
|
||||||
|
c.getKeyword(), c.getVal()[0]);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
wrapper.eq(SqlKeyword.EQ == keyword, column, val);
|
wrapper.eq(SqlKeyword.EQ == keyword, column, val);
|
||||||
//此处不用链式调用,提高效率
|
//此处不用链式调用,提高效率
|
||||||
|
Loading…
x
Reference in New Issue
Block a user