insert into #{dynamic_securityFlow}.tlk_emplcommenreward (LASTMODIFIED,FORMNAME,STATE,CREATED,FORMID,ISTMP,VERSIONS,APPLICATIONID,DOMAINID,ITEM_USERNAME,ITEM_USERDOCUMENTID,ITEM_DATASOURE,ITEM_BELONGCOMPANYNAME,ITEM_COMMENDATIONREWARDREASON,ITEM_COMMENDATIONREWARDCONTENT,ITEM_COMMENDATIONREWARDTIME,ITEM_HANDLEREGULATORY,ITEM_HANDLEOTHERREGULATORY,ID,ITEM_DOMAIN) VALUES ('#{LASTMODIFIED}','#{FORMNAME}','#{STATE}','#{CREATED}','#{FORMID}',0,1,'#{APPLICATIONID}','#{dynamic_domain_id}','#{ITEM_USERNAME}','#{ITEM_USERDOCUMENTID}','#{ITEM_DATASOURE}','#{ITEM_BELONGCOMPANYNAME}','#{ITEM_COMMENDATIONREWARDREASON}','#{ITEM_COMMENDATIONREWARDCONTENT}','#{ITEM_COMMENDATIONREWARDTIME}','#{ITEM_HANDLEREGULATORY}','#{ITEM_HANDLEOTHERREGULATORY}','#{ID}','#{ITEM_DOMAIN}') ON DUPLICATE KEY UPDATE domainid='#{dynamic_domain_id}';

update #{dynamic_securityFlow}.tlk_emplcommenreward set LASTMODIFIED = '#{LASTMODIFIED}',FORMNAME = '#{FORMNAME}',STATE = '#{STATE}',CREATED = '#{CREATED}',FORMID = '#{FORMID}',ISTMP = 0,VERSIONS = 1,APPLICATIONID = '#{APPLICATIONID}',ITEM_USERNAME = '#{ITEM_USERNAME}',ITEM_USERDOCUMENTID = '#{ITEM_USERDOCUMENTID}',ITEM_DATASOURE = '#{ITEM_DATASOURE}',ITEM_BELONGCOMPANYNAME = '#{ITEM_BELONGCOMPANYNAME}',ITEM_COMMENDATIONREWARDREASON = '#{ITEM_COMMENDATIONREWARDREASON}',ITEM_COMMENDATIONREWARDCONTENT = '#{ITEM_COMMENDATIONREWARDCONTENT}',ITEM_COMMENDATIONREWARDTIME = '#{ITEM_COMMENDATIONREWARDTIME}',ITEM_HANDLEREGULATORY = '#{ITEM_HANDLEREGULATORY}',ITEM_HANDLEOTHERREGULATORY = '#{ITEM_HANDLEOTHERREGULATORY}' where id = '#{ID}' and LASTMODIFIED > '#{LASTMODIFIED}';