insert into #{dynamic_securityFlow}.tlk_selfecomplainant (LASTMODIFIED,FORMNAME,STATE,CREATED,FORMID,ISTMP,VERSIONS,APPLICATIONID,DOMAINID,ITEM_isInSystem,ITEM_companyName,ITEM_dataSoure,ITEM_complainant,ITEM_complainantPhone,ITEM_complainantCredentialType,ITEM_投诉人证件号码,ITEM_complainantUnit,ITEM_complainantReason,ITEM_acceptorRegulatory,ITEM_acceptor,ITEM_acceptanceTime,ITEM_handleRegulatory,ITEM_handler,ITEM_handlerTime,ITEM_handlerAdvice,ITEM_rectificationRequire,ITEM_reviewSituation,ID,ITEM_DOMAIN) VALUES ('#{LASTMODIFIED}','#{FORMNAME}','#{STATE}','#{CREATED}','#{FORMID}',0,1,'#{APPLICATIONID}','#{dynamic_domain_id}','#{ITEM_isInSystem}','#{ITEM_companyName}','#{ITEM_dataSoure}','#{ITEM_complainant}','#{ITEM_complainantPhone}','#{ITEM_complainantCredentialType}','#{ITEM_投诉人证件号码}','#{ITEM_complainantUnit}','#{ITEM_complainantReason}','#{ITEM_acceptorRegulatory}','#{ITEM_acceptor}','#{ITEM_acceptanceTime}','#{ITEM_handleRegulatory}','#{ITEM_handler}','#{ITEM_handlerTime}','#{ITEM_handlerAdvice}','#{ITEM_rectificationRequire}','#{ITEM_reviewSituation}','#{ID}','#{ITEM_DOMAIN}') ON DUPLICATE KEY UPDATE domainid='#{dynamic_domain_id}';

update #{dynamic_securityFlow}.tlk_selfecomplainant 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_complainant = '#{ITEM_complainant}',ITEM_complainantPhone = '#{ITEM_complainantPhone}',ITEM_complainantCredentialType = '#{ITEM_complainantCredentialType}',ITEM_投诉人证件号码 = '#{ITEM_投诉人证件号码}',ITEM_complainantUnit = '#{ITEM_complainantUnit}',ITEM_complainantReason = '#{ITEM_complainantReason}',ITEM_acceptorRegulatory = '#{ITEM_acceptorRegulatory}',ITEM_acceptor = '#{ITEM_acceptor}',ITEM_acceptanceTime = '#{ITEM_acceptanceTime}',ITEM_handleRegulatory = '#{ITEM_handleRegulatory}',ITEM_handler = '#{ITEM_handler}',ITEM_handlerTime = '#{ITEM_handlerTime}',ITEM_handlerAdvice = '#{ITEM_handlerAdvice}',ITEM_rectificationRequire = '#{ITEM_rectificationRequire}',ITEM_reviewSituation = '#{ITEM_reviewSituation}' where id = '#{ID}' and LASTMODIFIED > '#{LASTMODIFIED}';