code: private void mainTableInsert(ESSyncConfig config, Dml dml, Map<String, Object> data) {
          ESMapping mapping = config.getEsMapping();
          String sql = mapping.getSql();
          String condition = ESSyncUtil.pkConditionSql(mapping, data);
          sql = ESSyncUtil.appendCondition(sql, condition);
          DataSource ds = DatasourceConfig.DATA_SOURCES.get(config.getDataSourceKey());
          if (logger.isTraceEnabled()) {
              logger.trace("Main table insert to es index by query sql, destination:{}, table: {}, index: {}, sql: {}",
                  config.getDestination(),
                  dml.getTable(),
                  mapping.get_index(),
                  sql.replace("\n", " "));
          }
          Util.sqlRS(ds, sql, rs -> {
              try {
                  while (rs.next()) {
                      Map<String, Object> esFieldData = new LinkedHashMap<>();
                      Object idVal = esTemplate.getESDataFromRS(mapping, rs, esFieldData);
  
                      if (logger.isTraceEnabled()) {
                          logger.trace(
                              "Main table insert to es index by query sql, destination:{}, table: {}, index: {}, id: {}",
                              config.getDestination(),
                              dml.getTable(),
                              mapping.get_index(),
                              idVal);
                      }
                      esTemplate.insert(mapping, idVal, esFieldData);
                  }
              } catch (Exception e) {
                  throw new RuntimeException(e);
              }
              return 0;
          });
      }
docs: 主表(单表)复杂字段insert
  
  @param config es配置
  @param dml dml信息
  @param data 单行dml数据