Browse Source

format

pull/15/head
RuoYi 6 years ago
parent
commit
9f8cb8759b
  1. 16
      src/main/resources/templates/vm/xml/Mapper.xml.vm

16
src/main/resources/templates/vm/xml/Mapper.xml.vm

@ -49,19 +49,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="update${className}" parameterType="${className}">
update ${tableName}
<trim prefix="SET" suffixOverrides=",">
#foreach($column in $columns)
#if($column.columnName != $primaryKey.columnName)
<if test="$column.attrname != null #if($column.attrType == 'String' ) and $column.attrname != '' #end ">
$column.columnName = #{$column.attrname},
</if>
#end
#end
#foreach($column in $columns)
#if($column.columnName != $primaryKey.columnName)
<if test="$column.attrname != null #if($column.attrType == 'String' ) and $column.attrname != '' #end ">$column.columnName = #{$column.attrname},</if>
#end
#end
</trim>
where ${primaryKey.columnName} = #{${primaryKey.attrname}}
where ${primaryKey.columnName} = #{${primaryKey.attrname}}
</update>
<delete id="delete${className}ById" parameterType="${primaryKey.attrType}">
delete from ${tableName} where ${primaryKey.columnName} = #{${primaryKey.attrname}}
</delete>

Loading…
Cancel
Save