insert into #{dynamic_securityFlow}.tlk_selfepunish (LASTMODIFIED,FORMNAME,STATE,CREATED,FORMID,ISTMP,VERSIONS,APPLICATIONID,DOMAINID,ITEM_isInSystem,ITEM_companyName,ITEM_dataSoure,ITEM_code,ITEM_commendationRewardTime,ITEM_punishReason,ITEM_punishContent,ITEM_handleRegulatory,ITEM_handleOtherRegulatory,ID,ITEM_DOMAIN,ITEM_PUNISHBASIS) VALUES ('#{LASTMODIFIED}','#{FORMNAME}','#{STATE}','#{CREATED}','#{FORMID}',0,1,'#{APPLICATIONID}','#{dynamic_domain_id}','#{ITEM_isInSystem}','#{ITEM_companyName}','#{ITEM_dataSoure}','#{ITEM_code}','#{ITEM_commendationRewardTime}','#{ITEM_punishReason}','#{ITEM_punishContent}','#{ITEM_handleRegulatory}','#{ITEM_handleOtherRegulatory}','#{ID}','#{ITEM_DOMAIN}','#{ITEM_PUNISHBASIS}') ON DUPLICATE KEY UPDATE domainid='#{dynamic_domain_id}';

update #{dynamic_securityFlow}.tlk_selfepunish set LASTMODIFIED = '#{LASTMODIFIED}',FORMNAME = '#{FORMNAME}',STATE = '#{STATE}',CREATED = '#{CREATED}',FORMID = '#{FORMID}',ISTMP = 0,VERSIONS = 1,APPLICATIONID = '#{APPLICATIONID}',ITEM_isInSystem = '#{ITEM_isInSystem}',ITEM_companyName = '#{ITEM_companyName}',ITEM_dataSoure = '#{ITEM_dataSoure}',ITEM_code = '#{ITEM_code}',ITEM_commendationRewardTime = '#{ITEM_commendationRewardTime}',ITEM_punishReason = '#{ITEM_punishReason}',ITEM_punishContent = '#{ITEM_punishContent}',ITEM_handleRegulatory = '#{ITEM_handleRegulatory}',ITEM_handleOtherRegulatory = '#{ITEM_handleOtherRegulatory}',ITEM_PUNISHBASIS = '#{ITEM_PUNISHBASIS}' where id = '#{ID}' and LASTMODIFIED > '#{LASTMODIFIED}';