From fb4fb6ad2e8215274fc2513d42fcf20b93a09438 Mon Sep 17 00:00:00 2001 From: inotgaoshou Date: Tue, 24 Jul 2018 00:20:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=E4=B8=AD?= =?UTF-8?q?=20=E6=9D=A1=E4=BB=B6=20=EF=BC=81=3D=20=E2=80=9C=E2=80=9D?= =?UTF-8?q?=E7=9A=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/templates/vm/xml/Mapper.xml.vm | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/main/resources/templates/vm/xml/Mapper.xml.vm b/src/main/resources/templates/vm/xml/Mapper.xml.vm index fa8a855b..60ba37dd 100644 --- a/src/main/resources/templates/vm/xml/Mapper.xml.vm +++ b/src/main/resources/templates/vm/xml/Mapper.xml.vm @@ -45,16 +45,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update ${tableName} - -#foreach($column in $columns) -#if($column.columnName != $primaryKey.columnName) - $column.columnName = #{$column.attrname}#if($velocityCount != $columns.size()), #end -#end -#end - - where ${primaryKey.columnName} = #{${primaryKey.attrname}} + update ${tableName} + + #foreach($column in $columns) + #if($column.columnName != $primaryKey.columnName) + + $column.columnName = #{$column.attrname}, + + #end + #end + + where ${primaryKey.columnName} = #{${primaryKey.attrname}} + + delete from ${tableName} where ${primaryKey.columnName} = #{${primaryKey.attrname}}