#foreach ($column in $columns)
#end
#if($table.sub)
#foreach ($column in $subTable.columns)
#end
#end
select#foreach($column in $columns) $column.columnName#if($foreach.count != $columns.size()),#end#end
from ${tableName}
#if($table.sub)
#end
insert into ${tableName}
#foreach($column in $columns)
#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment)
$column.columnName,
#end
#end
#foreach($column in $columns)
#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment)
#{$column.javaField},
#end
#end
update ${tableName}
#foreach($column in $columns)
#if($column.columnName != $pkColumn.columnName)
$column.columnName =
#{$column.javaField},
#end
#end
where ${pkColumn.columnName} = #{${pkColumn.javaField}}
delete from ${tableName} where ${pkColumn.columnName} = #{${pkColumn.javaField}}
delete from ${tableName} where ${pkColumn.columnName} in
#{${pkColumn.javaField}}
#if($table.sub)
delete from ${subTableName} where ${subTableFkName} in
#{${subTableFkclassName}}
delete from ${subTableName} where ${subTableFkName} = #{${subTableFkclassName}}
insert into ${subTableName}
(#foreach($column in $subTable.columns) $column.columnName#if($foreach.count != $subTable.columns.size())
,#end#end) values
(#foreach($column in $subTable.columns) #{item.$column.javaField
}#if($foreach.count != $subTable.columns.size()),#end#end)
#end