INSERT INTO
  baibaodunflow.tlk_SendSmsToPolice (
    PARENT,
    LASTMODIFIED,
    FORMNAME,
    STATE,
    AUDITUSER,
    AUDITDATE,
    AUTHOR,
    AUTHOR_DEPT_INDEX,
    CREATED,
    FORMID,
    ISTMP,
    VERSIONS,
    APPLICATIONID,
    STATEINT,
    STATELABEL,
    AUDITORNAMES,
    LASTFLOWOPERATION,
    LASTMODIFIER,
    DOMAINID,
    AUDITORLIST,
    COAUDITORLIST,
    STATELABELINFO,
    PREVAUDITNODE,
    PREVAUDITUSER,
    OPTIONITEM,
    SIGN,
    KINGGRIDSIGNATURE,
    ITEM_theme,
    ITEM_messageContent,
    ITEM_uploadFile,
    ITEM_IsReplayFile,
    ITEM_receiverID,
    ITEM_messageID,
    ITEM_toFrom,
    ITEM_fromMan,
    ITEM_sendDate,
    ITEM_departmentName,
    ITEM_departmentID,
    ITEM_status,
    ITEM_IsToAll,
    ITEM_receiverName,
    ITEM_replyContent,
    ITEM_replyFile,
    ITEM_replyCompany,
    ITEM_replyStatus,
    ITEM_readStatus,
    ITEM_readDate,
    ITEM_domain_id,
    ITEM_replyName,
    ITEM_replyDate,
    ID,
    AUTHORDEPTID,
    AUTHOR_USER_INDEX,
    SUBFORMIDS,
    INITIATOR
  )
VALUES
  (
    '#{PARENT}',
    '#{LASTMODIFIED}',
    '#{FORMNAME}',
    '#{STATE}',
    '#{AUDITUSER}',
    '#{AUDITDATE}',
    '#{AUTHOR}',
    '#{AUTHOR_DEPT_INDEX}',
    '#{CREATED}',
    '__1s1CEOcmoHo8sZRNEYh',
    '#{ISTMP}',
    '#{VERSIONS}',
    '__DXZvc8mnEmDqMARhK7G',
    '#{STATEINT}',
    '#{STATELABEL}',
    '#{AUDITORNAMES}',
    '#{LASTFLOWOPERATION}',
    '#{LASTMODIFIER}',
    '#{ITEM_domain_id}',
    '#{AUDITORLIST}',
    '#{COAUDITORLIST}',
    '#{STATELABELINFO}',
    '#{PREVAUDITNODE}',
    '#{PREVAUDITUSER}',
    '#{OPTIONITEM}',
    '#{SIGN}',
    '#{KINGGRIDSIGNATURE}',
    '#{ITEM_theme}',
    '#{ITEM_messageContent}',
    '#{ITEM_uploadFile}',
    '#{ITEM_IsReplayFile}',
    '#{ITEM_receiverID}',
    '#{ITEM_messageID}',
    '#{ITEM_toFrom}',
    '#{ITEM_fromMan}',
    '#{ITEM_sendDate}',
    '#{ITEM_departmentName}',
    '#{ITEM_departmentID}',
    '#{ITEM_status}',
    '#{ITEM_IsToAll}',
    '#{ITEM_receiverName}',
    '#{ITEM_replyContent}',
    '#{ITEM_replyFile}',
    '#{ITEM_replyCompany}',
    '#{ITEM_replyStatus}',
    '#{ITEM_readStatus}',
    '#{ITEM_readDate}',
    '#{ITEM_domain_id}',
    '#{ITEM_replyName}',
    '#{ITEM_replyDate}',
    '#{ID}',
    '#{AUTHORDEPTID}',
    '#{AUTHOR_USER_INDEX}',
    '#{SUBFORMIDS}',
    '#{INITIATOR}'
  ) ON DUPLICATE KEY
UPDATE  APPLICATIONID='__DXZvc8mnEmDqMARhK7G';
UPDATE baibaodunflow.tlk_SendSmsToPolice set
  LASTMODIFIED = '#{LASTMODIFIED}',
  ITEM_theme = '#{ITEM_theme}',
  ITEM_messageContent = '#{ITEM_messageContent}',
  ITEM_uploadFile = '#{ITEM_uploadFile}',
  ITEM_IsReplayFile = '#{ITEM_IsReplayFile}',
  ITEM_receiverID = '#{ITEM_receiverID}',
  ITEM_messageID = '#{ITEM_messageID}',
  ITEM_toFrom = '#{ITEM_toFrom}',
  ITEM_fromMan = '#{ITEM_fromMan}',
  ITEM_sendDate = '#{ITEM_sendDate}',
  ITEM_departmentName = '#{ITEM_departmentName}',
  ITEM_departmentID = '#{ITEM_departmentID}',
  ITEM_status = '#{ITEM_status}',
  ITEM_IsToAll = '#{ITEM_IsToAll}',
  ITEM_receiverName = '#{ITEM_receiverName}',
  ITEM_domain_id = '#{ITEM_domain_id}'
WHERE ID='#{ID}' and LASTMODIFIED< '#{LASTMODIFIED}'