diff --git a/README.md b/README.md index 2482b86..05aa373 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ SpringBootCodeGenerator ---- -基于SpringBoot2+Freemarker的代码生成器,用DDL SQL语句生成JPA/JdbcTemplate/Mybatis相关代码,支持mysql/oracle/pgsql三大数据库。目前以JPA的为主,各大模板也在陆续优化。欢迎大家提交模板和交流想法! +基于SpringBoot2+Freemarker的代码生成器,用DDL SQL语句生成JPA/JdbcTemplate/Mybatis/BeetlSQL相关代码,支持mysql/oracle/pgsql三大数据库。目前以JPA的为主,各大模板也在陆续优化。欢迎大家提交模板和交流想法!

另外,感谢bejson三叔将他部署在http://java.bejson.com/generator上

diff --git a/codegenerator1.png b/codegenerator1.png index 02206a5..3860835 100644 Binary files a/codegenerator1.png and b/codegenerator1.png differ diff --git a/codegenerator3.png b/codegenerator3.png index 365ab6e..82f88f0 100644 Binary files a/codegenerator3.png and b/codegenerator3.png differ diff --git a/codegenerator4.png b/codegenerator4.png index eca1b07..b77ec46 100644 Binary files a/codegenerator4.png and b/codegenerator4.png differ diff --git a/generator-web/src/main/resources/templates/index.ftl b/generator-web/src/main/resources/templates/index.ftl index 0ec6124..2185dbd 100644 --- a/generator-web/src/main/resources/templates/index.ftl +++ b/generator-web/src/main/resources/templates/index.ftl @@ -30,7 +30,7 @@

Spring Boot Code Generator!

- 基于SpringBoot2+Freemarker的代码生成器,用DDL SQL语句生成JPA/JdbcTemplate/Mybatis相关代码,支持mysql/oracle/pgsql三大数据库。目前以JPA的为主,各大模板也在陆续优化。欢迎大家提交模板和交流想法,如果发现有SQL语句不能识别,请留言给我分析,谢谢! + 基于SpringBoot2+Freemarker的代码生成器,用DDL SQL语句生成JPA/JdbcTemplate/Mybatis/BeetlSQL相关代码,支持mysql/oracle/pgsql三大数据库。目前以JPA的为主,各大模板也在陆续优化。欢迎大家提交模板和交流想法,如果发现有SQL语句不能识别,请留言给我分析,谢谢!

diff --git a/generator-web/src/main/resources/templates/xxl-code-generator/jtdaoimpl.ftl b/generator-web/src/main/resources/templates/xxl-code-generator/jtdaoimpl.ftl index 95e1211..fa7833d 100644 --- a/generator-web/src/main/resources/templates/xxl-code-generator/jtdaoimpl.ftl +++ b/generator-web/src/main/resources/templates/xxl-code-generator/jtdaoimpl.ftl @@ -39,7 +39,7 @@ public class ${classInfo.className}DaoImpl implements I${classInfo.className}Dao @Override public ${classInfo.className} findById(int id) { - List<${classInfo.className}> list = jdbcTemplate.query("select * from ${classInfo.tableName} where <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0><#list classInfo.fieldList as fieldItem ><#if fieldItem_index = 0>${fieldItem.columnName}=?<#break > = ?", new Object[]{id}, new BeanPropertyRowMapper<${classInfo.className}>(${classInfo.className}.class)); + List<${classInfo.className}> list = jdbcTemplate.query("select * from ${classInfo.tableName} where <#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0><#list classInfo.fieldList as fieldItem ><#if fieldItem_index = 0>${fieldItem.columnName}=?<#break >", new Object[]{id}, new BeanPropertyRowMapper<${classInfo.className}>(${classInfo.className}.class)); if(list!=null && list.size()>0){ ${classInfo.className} ${classInfo.className?uncap_first} = list.get(0); return ${classInfo.className?uncap_first};