@alpha4 #bugfix # mapper文件生成重复

This commit is contained in:
shuzheng 2017-05-18 23:13:55 +08:00 committed by GitHub
parent d7ca2f9606
commit 7637b9502f
1 changed files with 6 additions and 11 deletions

View File

@ -60,21 +60,16 @@
<!-- Mapper接口生成 -->
<javaClientGenerator targetPackage="${generator_javaClientGenerator_targetPackage}" targetProject="${targetProject}/src/main/java" type="XMLMAPPER" />
<!-- 需要映射的表 -->
<!-- 需要映射的表 -->
#foreach($table in $tables)
#if($last_insert_id_tables.size() != 0)
#foreach($last_insert_id_table in $last_insert_id_tables.entrySet())
#if($!last_insert_id_table.key == $!table.table_name)
<table tableName="$!table.table_name" domainObjectName="$!table.model_name">
<generatedKey column="$!last_insert_id_table.value" sqlStatement="MySql" identity="true" />
</table>
#else
<table tableName="$!table.table_name" domainObjectName="$!table.model_name"></table>
#end
#end
#if($last_insert_id_tables.containsKey($!table.table_name) == true)
<table tableName="$!table.table_name" domainObjectName="$!table.model_name">
<generatedKey column="$!last_insert_id_tables.get($!table.table_name)" sqlStatement="MySql" identity="true"/>
</table>
#else
<table tableName="$!table.table_name" domainObjectName="$!table.model_name"></table>
#end
#end
</context>
</generatorConfiguration>
</generatorConfiguration>