INSERT INTO
  #{dynamic_kaopei}.tlk_lesson_auth_base_info(
    LASTMODIFIED,
    CREATED,
    FORMID,
    APPLICATIONID,
    DOMAINID,
    ITEM_authLessonName,
    ITEM_authLessonId,
    ITEM_authUserId,
    ITEM_authUserName,
    ITEM_authRecordId,
    ITEM_validityDate,
    ITEM_progress,
    ITEM_learnPermission,
    ITEM_authLessonCover,
    ITEM_domain_id,
    ID,
    ITEM_STUDIED,
    ITEM_ISNEXTC,
    ITEM_ISNEXTS,
    ITEM_LEARNSTYLE,
    ITEM_DOID,
    ITEM_ISDELETE,
    ITEM_REMARK,
    ITEM_AUTYPE,
    ITEM_AGREE,
    ITEM_PHONE,
    ITEM_CONFIRMTIME,
    ITEM_NEW_ISEND,
    ITEM_ISPROGRESS,
    ITEM_LEARNID,
    ITEM_LEARNNAME,
    ITEM_TRAINNAME,
    ITEM_TRAINID
  )
VALUES
  (
    '#{LASTMODIFIED}',
    '#{CREATED}',
    '__8RTcMdJa46MmD2LS8hs',
    '__ebVTJ4Qkg61oQ2jlCCL',
    '#{dynamic_domain_id}',
    '#{ITEM_authLessonName}',
    '#{ITEM_authLessonId}',
    '#{ITEM_authUserId}',
    '#{ITEM_authUserName}',
    replace(
      '#{ITEM_authRecordId}',
      '__3p4Ro0NJIbAnbx6tmEc',
      '__btCmLDlw8qaZvjlKLf4'
    ),
    '#{ITEM_validityDate}',
    '#{ITEM_progress}',
    '#{ITEM_learnPermission}',
    '#{ITEM_authLessonCover}',
    '#{dynamic_domain_id}',
    replace(
      '#{ID}',
      '__t8b3WI9MCRgmpSycGIZ',
      '__8RTcMdJa46MmD2LS8hs'
    ),
    '#{ITEM_STUDIED}',
    '#{ITEM_ISNEXTC}',
    '#{ITEM_ISNEXTS}',
    '#{ITEM_LEARNSTYLE}',
    '#{ITEM_DOID}',
    '#{ITEM_ISDELETE}',
    '#{ITEM_REMARK}',
    '#{ITEM_AUTYPE}',
    '#{ITEM_AGREE}',
    '#{ITEM_PHONE}',
    '#{ITEM_CONFIRMTIME}',
    '#{ITEM_NEW_ISEND}',
    '#{ITEM_ISPROGRESS}',
    '#{ITEM_LEARNID}',
    '#{ITEM_LEARNNAME}',
    '#{ITEM_TRAINNAME}',
    '#{ITEM_TRAINID}'
  ) ON DUPLICATE KEY
UPDATE
  LASTMODIFIED = '#{LASTMODIFIED}',
  ITEM_authLessonName = '#{ITEM_authLessonName}',
  ITEM_authLessonName = '#{ITEM_authLessonName}',
  ITEM_authLessonId = '#{ITEM_authLessonId}',
  ITEM_authUserId = '#{ITEM_authUserId}',
  ITEM_authUserName = '#{ITEM_authUserName}',
  ITEM_validityDate = '#{ITEM_validityDate}',
  ITEM_progress = '#{ITEM_progress}',
  ITEM_learnPermission = '#{ITEM_learnPermission}',
  ITEM_ISDELETE = '#{ITEM_ISDELETE}',
  ITEM_NEW_ISEND = '#{ITEM_NEW_ISEND}',
  ITEM_ISPROGRESS = '#{ITEM_ISPROGRESS}',
  ITEM_LEARNID = '#{ITEM_LEARNID}',
  ITEM_LEARNNAME = '#{ITEM_LEARNNAME}',
  ITEM_TRAINNAME = '#{ITEM_TRAINNAME}',
  ITEM_TRAINID = '#{ITEM_TRAINID}';