small fix

This commit is contained in:
moshowgame@126.com
2018-09-26 14:05:11 +08:00
parent bc5e93860d
commit 5c65251c6c
6 changed files with 3 additions and 3 deletions

View File

@@ -30,7 +30,7 @@
<div class="jumbotron">
<div class="container">
<h1>Spring Boot Code Generator!</h1>
基于<code>SpringBoot2</code>+<code>Freemarker</code>的代码生成器,用<code>DDL SQL</code>语句生成<code>JPA</code>/<code>JdbcTemplate</code>/<code>Mybatis</code>相关代码,支持<code>mysql</code>/<code>oracle</code>/<code>pgsql</code>三大数据库。目前以<code>JPA</code>的为主各大模板也在陆续优化。欢迎大家提交模板和交流想法如果发现有SQL语句不能识别请<a href="https://github.com/moshowgame/SpringBootCodeGenerator/issues">留言</a>给我分析,谢谢!
基于<code>SpringBoot2</code>+<code>Freemarker</code>的代码生成器,用<code>DDL SQL</code>语句生成<code>JPA</code>/<code>JdbcTemplate</code>/<code>Mybatis</code>/<code>BeetlSQL</code>相关代码,支持<code>mysql</code>/<code>oracle</code>/<code>pgsql</code>三大数据库。目前以<code>JPA</code>的为主各大模板也在陆续优化。欢迎大家提交模板和交流想法如果发现有SQL语句不能识别请<a href="https://github.com/moshowgame/SpringBootCodeGenerator/issues">留言</a>给我分析,谢谢!
</p>
<div class="input-group mb-3">
<div class="input-group-prepend">

View File

@@ -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 ></#if></#list></#if> = ?", 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 ></#if></#list></#if>", 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};