From 65e8823275d3da2872e2e3b50e6f23436e532e77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moshow=E9=83=91=E9=94=B4?= Date: Sun, 15 Sep 2019 21:52:20 +0800 Subject: [PATCH 1/2] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 58f1f4dd..c9d8982f 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ SpringBootCodeGenerator CSDN博客 http://blog.csdn.net/moshowgame 更新日期 更新内容 +201909151.添加对象getset模板 2.添加sql模板 3.启动类添加日志输出,方便项目使用(感谢@gaohanghang 的pull request) 20190910-2优化以及更新Maven依赖,减少打包体积。 20190910-11.修复mapper接口load方法,但是xml中方法不匹配问题 2.移除mapper中CRUD时的@param 注解,会影响xml的解析(感谢@caojiantao的反馈)。3.优化MyBatis的xml文件对Oracle的支持。(感谢@wylove1992的反馈) 4.新增对boolean的处理(感谢@violinxsc的反馈)以及优化tinyint类型生成boolean类型问题(感谢@hahaYhui的反馈) 20190909添加是否下划线转换为驼峰的选择(感谢@youngking28 的pull request)。 From 3172c12a4d73fcd8765bf4a17031e90a81454851 Mon Sep 17 00:00:00 2001 From: "MOSHOW.K.ZHENG" Date: Tue, 15 Oct 2019 23:42:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8DjdbcTemplates=E4=B8=ADins?= =?UTF-8?q?ert=E8=AF=AD=E5=8F=A5=E7=AC=AC=E4=B8=80=E4=B8=AA=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E4=B8=A2=E5=A4=B1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + .../templates/code-generator/jdbc-template/jtdaoimpl.ftl | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c9d8982f..f8d3924a 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ SpringBootCodeGenerator CSDN博客 http://blog.csdn.net/moshowgame 更新日期 更新内容 +20191015修复jdbcTemplates中insert语句第一个字段丢失的问题。 201909151.添加对象getset模板 2.添加sql模板 3.启动类添加日志输出,方便项目使用(感谢@gaohanghang 的pull request) 20190910-2优化以及更新Maven依赖,减少打包体积。 20190910-11.修复mapper接口load方法,但是xml中方法不匹配问题 2.移除mapper中CRUD时的@param 注解,会影响xml的解析(感谢@caojiantao的反馈)。3.优化MyBatis的xml文件对Oracle的支持。(感谢@wylove1992的反馈) 4.新增对boolean的处理(感谢@violinxsc的反馈)以及优化tinyint类型生成boolean类型问题(感谢@hahaYhui的反馈) diff --git a/generator-web/src/main/resources/templates/code-generator/jdbc-template/jtdaoimpl.ftl b/generator-web/src/main/resources/templates/code-generator/jdbc-template/jtdaoimpl.ftl index 1a0d02dd..5e138826 100644 --- a/generator-web/src/main/resources/templates/code-generator/jdbc-template/jtdaoimpl.ftl +++ b/generator-web/src/main/resources/templates/code-generator/jdbc-template/jtdaoimpl.ftl @@ -17,8 +17,8 @@ public class ${classInfo.className}DaoImpl implements I${classInfo.className}Dao @Override public int add(${classInfo.className} ${classInfo.className?uncap_first}) { - return jdbcTemplate.update("insert into ${classInfo.tableName} (<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0><#list classInfo.fieldList as fieldItem ><#if fieldItem_index gt 0>${fieldItem.columnName}<#if fieldItem_has_next>, ) values (<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0><#list classInfo.fieldList as fieldItem >?<#if fieldItem_has_next>, )", - <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0><#list classInfo.fieldList as fieldItem ><#if fieldItem_index gt 0 >${classInfo.className?uncap_first}.get${fieldItem.fieldName?cap_first}()<#if fieldItem_has_next>,); + return jdbcTemplate.update("insert into ${classInfo.tableName} (<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0><#list classInfo.fieldList as fieldItem >${fieldItem.columnName}<#if fieldItem_has_next>, ) values (<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0><#list classInfo.fieldList as fieldItem >?<#if fieldItem_has_next>, )", + <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0><#list classInfo.fieldList as fieldItem >${classInfo.className?uncap_first}.get${fieldItem.fieldName?cap_first}()<#if fieldItem_has_next>,); } @Override