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

update #{dynamic_securityFlow}.tlk_selfempcommend 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_commendationRewardReason = '#{ITEM_commendationRewardReason}',ITEM_commendationRewardContent = '#{ITEM_commendationRewardContent}',ITEM_commendationRewardTime = '#{ITEM_commendationRewardTime}',ITEM_handleRegulatory = '#{ITEM_handleRegulatory}',ITEM_handleOtherRegulatory = '#{ITEM_handleOtherRegulatory}',ITEM_beInspecter = '#{ITEM_beInspecter}' where id = '#{ID}' and LASTMODIFIED > '#{LASTMODIFIED}';