#set($jin="#{") #set($dao ="${") #set($newline=" ") #foreach($attr in $attributes) #if($attr.id != "oid") #end #end #foreach($attr in $referAttributes) #end #foreach($attr in $attributes) $attr.idUpper #if($foreach.hasNext),#end #if($velocityCount%5==0) $newline #end #end ${tableName} delete from where OID = $jin oid,jdbcType=VARCHAR} insert into ( #foreach($attr in $attributes) $attr.idUpper #if($foreach.hasNext),#end #if($velocityCount%5==0) $newline #end #end ) values ( #foreach($attr in $attributes) $jin $attr.id,jdbcType=$attr.jdbcType}#if($foreach.hasNext),#end #if($velocityCount%5==0) $newline #end #end ) insert into ( #foreach($attr in $attributes) $attr.idUpper #if($foreach.hasNext),#end #if($velocityCount%5==0) $newline #end #end ) (select #foreach($attr in $attributes) $jin item.$attr.id,jdbcType=$attr.jdbcType}#if($foreach.hasNext),#end #if($velocityCount%5==0) $newline #end #end FROM DUAL) update set #foreach($attr in $attributes) #if($attr.id !="oid") $attr.idUpper = $jin $attr.id,jdbcType=$attr.jdbcType}#if($foreach.hasNext),#end #if($velocityCount%5==0) $newline #end #end #end where OID = $jin oid,jdbcType=VARCHAR} update set #foreach($attr in $attributes) #if($attr.id !="oid") $attr.idUpper = $jin item.$attr.id,jdbcType=$attr.jdbcType}#if($foreach.hasNext),#end #if($velocityCount%5==0) $newline #end #end #end where OID = $jin item.oid,jdbcType=VARCHAR} delete from $jin item,jdbcType=VARCHAR} , #if(${hasEnable}) update set lcstatus = $jin lcStatus,jdbcType=VARCHAR}, ts=sysdate where $jin item,jdbcType=VARCHAR} , update set lcstatus = $jin lcStatus,jdbcType=VARCHAR}, ts=sysdate where oid =$jin oid,jdbcType=VARCHAR} #end #if(${hasParentField}) #end