关系映射条件处理

This commit is contained in:
yulichang 2021-12-03 13:40:56 +08:00
parent 7a0179953a
commit 6452cb26ac

View File

@ -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);
//此处不用链式调用提高效率 //此处不用链式调用提高效率