#foreach ($column in $columns)
#end
#if($table.tree)
#end
#if($table.sub)
#foreach ($column in $subTable.columns)
#end
#end
select#foreach($column in $columns) $column.columnName#if($velocityCount != $columns.size()),#end#end from ${tableName}
#if($pkColumn.increment)
SELECT seq_${tableName}.NEXTVAL as ${pkColumn.javaField} FROM DUAL
#end
insert into ${tableName}
#foreach($column in $columns)
$column.columnName,
#end
#foreach($column in $columns)
#{$column.javaField},
#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 all
into ${subTableName}(#foreach($column in $subTable.columns) $column.columnName#if($velocityCount != $subTable.columns.size()),#end#end) values (#foreach($column in $subTable.columns) #{item.$column.javaField}#if($velocityCount != $subTable.columns.size()),#end#end)
SELECT 1 FROM DUAL
#end