INSERT INTO
  #{dynamic_securityFlow}.tlk_managementlayer (
    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_topId,
    ITEM_name,
    ITEM_sex,
    ITEM_documentType,
    ITEM_documentID,
    ITEM_DeptID,
    ITEM_DeptName,
    ITEM_jobType,
    ITEM_isVeteran,
    ITEM_nation,
    ITEM_household,
    ITEM_education,
    ITEM_skillLevel,
    ITEM_phone,
    ITEM_address,
    ITEM_domain_id,
    ID,
    ITEM_department,
    ITEM_departmentName,
    AUTHORDEPTID,
    AUTHOR_USER_INDEX,
    SUBFORMIDS,
    INITIATOR
  )
VALUES
  (
    '#{PARENT}',
    '#{LASTMODIFIED}',
    '#{FORMNAME}',
    '#{STATE}',
    '#{AUDITUSER}',
    '#{AUDITDATE}',
    '#{AUTHOR}',
    '#{AUTHOR_DEPT_INDEX}',
    '#{CREATED}',
    '__pBoYCpGFR2fbXySQ9d8',
    0,
    1,
    '__wGomeHJBz6CpLFCCl4y',
    '#{STATEINT}',
    '#{STATELABEL}',
    '#{AUDITORNAMES}',
    '#{LASTFLOWOPERATION}',
    '#{LASTMODIFIER}',
    '#{dynamic_domain_id}',
    '#{AUDITORLIST}',
    '#{COAUDITORLIST}',
    '#{STATELABELINFO}',
    '#{PREVAUDITNODE}',
    '#{PREVAUDITUSER}',
    '#{OPTIONITEM}',
    '#{SIGN}',
    '#{KINGGRIDSIGNATURE}',
    '#{ITEM_topId}',
    '#{ITEM_name}',
    '#{ITEM_sex}',
    '#{ITEM_documentType}',
    '#{ITEM_documentID}',
    '#{ITEM_DeptID}',
    '#{ITEM_DeptName}',
    '#{ITEM_jobType}',
    '#{ITEM_isVeteran}',
    '#{ITEM_nation}',
    '#{ITEM_household}',
    '#{ITEM_education}',
    '#{ITEM_skillLevel}',
    '#{ITEM_phone}',
    '#{ITEM_address}',
    '#{ITEM_domain_id}',
    '#{ID}',
    '#{ITEM_department}',
    '#{ITEM_departmentName}',
    '#{AUTHORDEPTID}',
    '#{AUTHOR_USER_INDEX}',
    '#{SUBFORMIDS}',
    '#{INITIATOR}'
  ) ON DUPLICATE KEY
UPDATE APPLICATIONID='__wGomeHJBz6CpLFCCl4y';
UPDATE tlk_managementlayer set 
  LASTMODIFIED = '#{LASTMODIFIED}',
  ITEM_topId = '#{ITEM_topId}',
  ITEM_name = '#{ITEM_name}',
  ITEM_sex = '#{ITEM_sex}',
  ITEM_documentType = '#{ITEM_documentType}',
  ITEM_documentID = '#{ITEM_documentID}',
  ITEM_DeptID = '#{ITEM_DeptID}',
  ITEM_DeptName = '#{ITEM_DeptName}',
  ITEM_jobType = '#{ITEM_jobType}',
  ITEM_isVeteran = '#{ITEM_isVeteran}',
  ITEM_nation = '#{ITEM_nation}',
  ITEM_household = '#{ITEM_household}',
  ITEM_education = '#{ITEM_education}',
  ITEM_skillLevel = '#{ITEM_skillLevel}',
  ITEM_phone = '#{ITEM_phone}',
  ITEM_address = '#{ITEM_address}',
  ITEM_domain_id = '#{ITEM_domain_id}',
  ITEM_department = '#{ITEM_department}',
  ITEM_departmentName = '#{ITEM_departmentName}'
WHERE ID='#{ID}' and LASTMODIFIED< '#{LASTMODIFIED}'