Explorar o código

删掉冗余代码

zhouhao %!s(int64=8) %!d(string=hai) anos
pai
achega
979cb3a686

+ 3 - 8
hsweb-web-dao-impl-mybatis/src/main/java/org/hsweb/web/mybatis/builder/DefaultSqlParamBuilder.java

@@ -89,7 +89,9 @@ public class DefaultSqlParamBuilder {
     protected Map<String, Object> createConfig(String resultMapId) {
         ResultMap resultMaps = ResultMapsUtils.getResultMap(resultMapId);
         Map<String, Object> fieldConfig = new HashMap<>();
-        resultMaps.getResultMappings().forEach(resultMapping -> {
+        List<ResultMapping> resultMappings=new ArrayList<>(resultMaps.getResultMappings());
+        resultMappings.addAll(resultMaps.getIdResultMappings());
+        resultMappings.forEach(resultMapping -> {
             if (resultMapping.getNestedQueryId() == null) {
                 Map<String, Object> config = new HashMap<>();
                 config.put("jdbcType", resultMapping.getJdbcType());
@@ -98,13 +100,6 @@ public class DefaultSqlParamBuilder {
                 fieldConfig.put(resultMapping.getColumn(), config);
             }
         });
-        resultMaps.getIdResultMappings().forEach(resultMapping -> {
-            Map<String, Object> config = new HashMap<>();
-            config.put("jdbcType", resultMapping.getJdbcType());
-            config.put("javaType", getJavaType(resultMapping.getJavaType()));
-            config.put("property", resultMapping.getProperty());
-            fieldConfig.put(resultMapping.getColumn(), config);
-        });
         return fieldConfig;
     }