diff --git a/mybatis-flex-annotation/pom.xml b/mybatis-flex-annotation/pom.xml index 0e87224b..b82b9a40 100644 --- a/mybatis-flex-annotation/pom.xml +++ b/mybatis-flex-annotation/pom.xml @@ -5,7 +5,7 @@ parent com.mybatis-flex - 1.7.3 + 1.7.4 4.0.0 diff --git a/mybatis-flex-codegen/pom.xml b/mybatis-flex-codegen/pom.xml index 7d1234e9..ad9c3fd7 100644 --- a/mybatis-flex-codegen/pom.xml +++ b/mybatis-flex-codegen/pom.xml @@ -5,7 +5,7 @@ parent com.mybatis-flex - 1.7.3 + 1.7.4 4.0.0 @@ -23,7 +23,7 @@ com.mybatis-flex mybatis-flex-core - 1.7.3 + 1.7.4 com.mybatis-flex diff --git a/mybatis-flex-core/pom.xml b/mybatis-flex-core/pom.xml index bc745c0d..471d0cf6 100644 --- a/mybatis-flex-core/pom.xml +++ b/mybatis-flex-core/pom.xml @@ -5,7 +5,7 @@ parent com.mybatis-flex - 1.7.3 + 1.7.4 4.0.0 @@ -101,7 +101,7 @@ com.mybatis-flex mybatis-flex-annotation - 1.7.3 + 1.7.4 compile diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/FlexConsts.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/FlexConsts.java index 84778663..a876c1c1 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/FlexConsts.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/FlexConsts.java @@ -27,7 +27,7 @@ public class FlexConsts { } public static final String NAME = "MyBatis-Flex"; - public static final String VERSION = "1.7.3"; + public static final String VERSION = "1.7.4"; public static final String SQL = "$$sql"; diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/mybatis/FlexDefaultResultSetHandler.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/mybatis/FlexDefaultResultSetHandler.java index f57ec50a..f4539599 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/mybatis/FlexDefaultResultSetHandler.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/mybatis/FlexDefaultResultSetHandler.java @@ -768,8 +768,12 @@ public class FlexDefaultResultSetHandler extends DefaultResultSetHandler { List constructorArgs, Constructor constructor, boolean foundValues) throws SQLException { for (int i = 0; i < constructor.getParameterTypes().length; i++) { Class parameterType = constructor.getParameterTypes()[i]; - Parameter parameter = constructor.getParameters()[i]; - String columnName = StringUtil.camelToUnderline(parameter.getName()); + + // https://github.com/mybatis-flex/mybatis-flex/pull/201 + // Parameter parameter = constructor.getParameters()[i]; + // String columnName = StringUtil.camelToUnderline(parameter.getName()); + + String columnName = rsw.getColumnNames().get(i); TypeHandler typeHandler = rsw.getTypeHandler(parameterType, columnName); Object value = typeHandler.getResult(rsw.getResultSet(), columnName); constructorArgTypes.add(parameterType); diff --git a/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/DynamicConditionTest.java b/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/DynamicConditionTest.java index 4f8f2831..26fadb0d 100644 --- a/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/DynamicConditionTest.java +++ b/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/DynamicConditionTest.java @@ -26,6 +26,7 @@ import java.util.List; import java.util.Objects; import static com.mybatisflex.core.query.QueryMethods.bracket; +import static com.mybatisflex.core.query.QueryMethods.raw; import static com.mybatisflex.coretest.table.AccountTableDef.ACCOUNT; import static org.junit.Assert.assertEquals; @@ -203,6 +204,27 @@ public class DynamicConditionTest { "OR `birthday` <= '2023-10-28 22:13:36'", printSql); System.out.println(printSql); + + + QueryWrapper queryWrapper2 = QueryWrapper.create() + .select() + .from(ACCOUNT) + .where(ACCOUNT.IS_DELETE.eq(0)) + .and(ACCOUNT.ID.ge("1").and(ACCOUNT.AGE.ge(18).or(ACCOUNT.USER_NAME.ge("zs")))) + .or(ACCOUNT.BIRTHDAY.le("2023-10-28 22:13:36")); + System.out.println(queryWrapper2.toSQL()); + + assertEquals(printSql,queryWrapper2.toSQL()); + } + + + @Test + public void test12() { + QueryWrapper qw = QueryWrapper.create() + .select().from(ACCOUNT) + .where(ACCOUNT.IS_DELETE.eq(0)) + .or(raw("1 = 1").or(ACCOUNT.ID.eq(123))); + System.out.println(qw.toSQL()); } } diff --git a/mybatis-flex-dependencies/pom.xml b/mybatis-flex-dependencies/pom.xml index be3caaaa..7d1de225 100644 --- a/mybatis-flex-dependencies/pom.xml +++ b/mybatis-flex-dependencies/pom.xml @@ -6,7 +6,7 @@ com.mybatis-flex parent - 1.7.3 + 1.7.4 mybatis-flex-dependencies diff --git a/mybatis-flex-processor/pom.xml b/mybatis-flex-processor/pom.xml index 23b4b073..baae7d20 100644 --- a/mybatis-flex-processor/pom.xml +++ b/mybatis-flex-processor/pom.xml @@ -5,7 +5,7 @@ parent com.mybatis-flex - 1.7.3 + 1.7.4 4.0.0 @@ -22,7 +22,7 @@ com.mybatis-flex mybatis-flex-annotation - 1.7.3 + 1.7.4 diff --git a/mybatis-flex-solon-plugin/pom.xml b/mybatis-flex-solon-plugin/pom.xml index 55a14e1c..b93f8610 100644 --- a/mybatis-flex-solon-plugin/pom.xml +++ b/mybatis-flex-solon-plugin/pom.xml @@ -5,7 +5,7 @@ parent com.mybatis-flex - 1.7.3 + 1.7.4 4.0.0 diff --git a/mybatis-flex-spring-boot-starter/pom.xml b/mybatis-flex-spring-boot-starter/pom.xml index 4d4f80f6..02f51e68 100644 --- a/mybatis-flex-spring-boot-starter/pom.xml +++ b/mybatis-flex-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ parent com.mybatis-flex - 1.7.3 + 1.7.4 4.0.0 @@ -23,7 +23,7 @@ com.mybatis-flex mybatis-flex-spring - 1.7.3 + 1.7.4 @@ -104,7 +104,7 @@ com.mybatis-flex mybatis-flex-core - 1.7.3 + 1.7.4 diff --git a/mybatis-flex-spring/pom.xml b/mybatis-flex-spring/pom.xml index 2d9c43e8..316ad79e 100644 --- a/mybatis-flex-spring/pom.xml +++ b/mybatis-flex-spring/pom.xml @@ -5,7 +5,7 @@ parent com.mybatis-flex - 1.7.3 + 1.7.4 4.0.0 @@ -22,7 +22,7 @@ com.mybatis-flex mybatis-flex-core - 1.7.3 + 1.7.4 @@ -42,7 +42,7 @@ com.mybatis-flex mybatis-flex-annotation - 1.7.3 + 1.7.4 compile diff --git a/mybatis-flex-test/mybatis-flex-native-test/pom.xml b/mybatis-flex-test/mybatis-flex-native-test/pom.xml index ec98d5e4..4d257381 100644 --- a/mybatis-flex-test/mybatis-flex-native-test/pom.xml +++ b/mybatis-flex-test/mybatis-flex-native-test/pom.xml @@ -5,7 +5,7 @@ mybatis-flex-test com.mybatis-flex - 1.7.3 + 1.7.4 4.0.0 diff --git a/mybatis-flex-test/mybatis-flex-seata-test/pom.xml b/mybatis-flex-test/mybatis-flex-seata-test/pom.xml index 56522ed3..f32814f2 100644 --- a/mybatis-flex-test/mybatis-flex-seata-test/pom.xml +++ b/mybatis-flex-test/mybatis-flex-seata-test/pom.xml @@ -4,7 +4,7 @@ mybatis-flex-test com.mybatis-flex - 1.7.3 + 1.7.4 4.0.0 diff --git a/mybatis-flex-test/mybatis-flex-spring-boot-test/pom.xml b/mybatis-flex-test/mybatis-flex-spring-boot-test/pom.xml index 19a40c21..dd584846 100644 --- a/mybatis-flex-test/mybatis-flex-spring-boot-test/pom.xml +++ b/mybatis-flex-test/mybatis-flex-spring-boot-test/pom.xml @@ -5,7 +5,7 @@ mybatis-flex-test com.mybatis-flex - 1.7.3 + 1.7.4 4.0.0 diff --git a/mybatis-flex-test/mybatis-flex-spring-cloud-test/pom.xml b/mybatis-flex-test/mybatis-flex-spring-cloud-test/pom.xml index b456587f..8d97abc1 100644 --- a/mybatis-flex-test/mybatis-flex-spring-cloud-test/pom.xml +++ b/mybatis-flex-test/mybatis-flex-spring-cloud-test/pom.xml @@ -4,7 +4,7 @@ mybatis-flex-test com.mybatis-flex - 1.7.3 + 1.7.4 4.0.0 diff --git a/mybatis-flex-test/mybatis-flex-spring-test/pom.xml b/mybatis-flex-test/mybatis-flex-spring-test/pom.xml index ea943b85..e90b922e 100644 --- a/mybatis-flex-test/mybatis-flex-spring-test/pom.xml +++ b/mybatis-flex-test/mybatis-flex-spring-test/pom.xml @@ -5,7 +5,7 @@ mybatis-flex-test com.mybatis-flex - 1.7.3 + 1.7.4 4.0.0 diff --git a/mybatis-flex-test/pom.xml b/mybatis-flex-test/pom.xml index edbd985c..707dfafa 100644 --- a/mybatis-flex-test/pom.xml +++ b/mybatis-flex-test/pom.xml @@ -5,7 +5,7 @@ parent com.mybatis-flex - 1.7.3 + 1.7.4 4.0.0