mirror of
https://github.com/moshowgame/SpringBootCodeGenerator.git
synced 2026-03-22 07:28:25 +08:00
修改日期 : 2021-10-01
背景 : 当使用 mybatis组件生成代码时,各个组件之间对于实体类使用名称不一致,需要手动修改部分代码
修改 :
1 mybatis.ftl 统一使用 不带 Entity 的 实体类,保证 mybatis所有组件功能保持一致,避免手动修改
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="${packageName}.dao.${classInfo.className}Dao">
|
||||
|
||||
<resultMap id="BaseResultMap" type="${packageName}.entity.${classInfo.className}Entity" >
|
||||
<resultMap id="BaseResultMap" type="${packageName}.entity.${classInfo.className}" >
|
||||
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
|
||||
<#list classInfo.fieldList as fieldItem >
|
||||
<result column="${fieldItem.columnName}" property="${fieldItem.fieldName}" />
|
||||
@@ -19,7 +19,7 @@
|
||||
</#if>
|
||||
</sql>
|
||||
|
||||
<insert id="insert" useGeneratedKeys="true" keyColumn="id" keyProperty="id" parameterType="${packageName}.entity.${classInfo.className}Entity">
|
||||
<insert id="insert" useGeneratedKeys="true" keyColumn="id" keyProperty="id" parameterType="${packageName}.entity.${classInfo.className}">
|
||||
INSERT INTO ${classInfo.tableName}
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
|
||||
@@ -56,7 +56,7 @@
|
||||
WHERE id = ${r"#{id}"}
|
||||
</delete>
|
||||
|
||||
<update id="update" parameterType="${packageName}.entity.${classInfo.className}Entity">
|
||||
<update id="update" parameterType="${packageName}.entity.${classInfo.className}">
|
||||
UPDATE ${classInfo.tableName}
|
||||
<set>
|
||||
<#list classInfo.fieldList as fieldItem >
|
||||
|
||||
Reference in New Issue
Block a user