{
  //注意事项：不可使用ID字段判断是否存在，变更多租户后现场将全部使用全新GUID作为主键，与开发环境不一致；
  "Tables": [
    {
      "TableName": "TmplDialysisRecord",
      "Insert": ["Name"], //先判断是否存在
      "Update": [],
      "UpdateFiled": [],
      "Delete": [],
      "CleanRubbish": [],
      "Filter": "",
      "HaveTenant": "true",
      "ParentMapper": {},
      "ForeignMapper": []
    },
    {
      "TableName": "TmplCustomScript",
      "Insert": ["Name"], //先判断是否存在
      "Update": ["Name"],
      "UpdateFiled": [],
      "Delete": [],
      "CleanRubbish": [],
      "Filter": "",
      "HaveTenant": "true",
      "ParentMapper": {},
      "ForeignMapper": []
    },
    {
      "TableName": "SystemTodayCard",
      "Insert": ["Code"], //先判断是否存在
      "Update": [],
      "UpdateFiled": [],
      "Delete": [],
      "CleanRubbish": [],
      "Filter": "",
      "HaveTenant": "true",
      "ParentMapper": {},
      "ForeignMapper": []
    },
    {
      "TableName": "SystemTodayCardCustom",
      "Insert": ["Code"], //先判断是否存在
      "Update": [],
      "UpdateFiled": [],
      "Delete": [],
      "CleanRubbish": [],
      "Filter": "",
      "HaveTenant": "true",
      "ParentMapper": {},
      "ForeignMapper": []
    },
    {
      "TableName": "SystemTaskItem",
      "Insert": ["Code"], //先判断是否存在
      "Update": ["Code"],
      "UpdateFiled": ["Type", "Name"],
      "Delete": ["Code"],
      "CleanRubbish": [],
      "Filter": "",
      "HaveTenant": "false",
      "ParentMapper": {},
      "ForeignMapper": []
    },
    {
      "TableName": "SystemLisItemBuiltin",
      "Insert": ["CodeBuiltin"], //先判断是否存在
      "Update": [],
      "UpdateFiled": [],
      "Delete": [],
      "CleanRubbish": [],
      "Filter": "",
      "HaveTenant": "true",
      "ParentMapper": {},
      "ForeignMapper": []
    },
    {
      "TableName": "DeptProjectType",
      "Insert": ["Code"], //先判断是否存在
      "Update": ["Code"],
      "UpdateFiled": ["Name"], //  FK/PK/PatientId将不支持比对，因hdIs库是新生成的
      "Delete": [],
      "CleanRubbish": [],
      "Filter": "",
      "HaveTenant": "true",
      "ParentMapper": {
        //有父节点需配置映射关系
        "ParentFiled": "ParentId",
        "SearchFiled": "Code"
      },
      "ForeignMapper": []
    },
    {
      "TableName": "SystemDicType",
      "Insert": ["Code"],
      "Update": ["Code"],
      "UpdateFiled": [],
      "CleanRubbish": [],
      "Delete": [],
      "Filter": "",
      "HaveTenant": "true",
      "ParentMapper": {
        "ParentFiled": "ParentId",
        "SearchFiled": "Code"
      },
      "ForeignMapper": []
    },
    {
      "TableName": "SystemDicItem",
      "Insert": ["Value", "SystemDicTypeCode"],
      "Update": ["Value", "SystemDicTypeCode"],
      "UpdateFiled": [],
      "Delete": [],
      "CleanRubbish": [
        //需要清理数据时配置映射而关系
        {
          "CleanRubbishFiled": "SystemDicTypeCode", //根据字段清理
          "CleanRubbishTable": "SystemDicType", //字段关联关系表
          "CleanRubbishTableFiled": "Code" //字段关联关系字段
        }
      ],
      "Filter": "",
      "HaveTenant": "true",
      "ParentMapper": {},
      "ForeignMapper": [
        //有外键需配置映射关系
        {
          "ForeignTable": "SystemDicType", //外键表表名
          "ForeignKey": "SystemDicTypeId", //主表外键字段名
          "SearchFiled": "Code" //匹配查找字段名（根据表名到Compare库查Code，在到HdIs库根据Code查ID ）
        }
      ]
    },
    {
      "TableName": "SystemMenu",
      "Insert": ["Code"],
      "Update": ["Code"],
      "UpdateFiled": ["Name", "Url", "PageUrl", "Sequence"],
      "Delete": ["Code"],
      "CleanRubbish": [],
      "Filter": "",
      "HaveTenant": "false",
      "ParentMapper": {
        "ParentFiled": "ParentId",
        "SearchFiled": "Code"
      },
      "ForeignMapper": []
    },
    {
      "TableName": "SystemMessageType",
      "Insert": ["Type", "OperationType"],
      "Update": [], //Key没有就不更新
      "UpdateFiled": [],
      "Delete": ["Type", "OperationType"],
      "CleanRubbish": [],
      "Filter": "",
      "HaveTenant": "true",
      "ParentMapper": {},
      "ForeignMapper": []
    },
    {
      "TableName": "SystemMessageReceiver",
      "Insert": ["Code", "SystemMessageTypeOperationType"],
      "Update": ["Code", "SystemMessageTypeOperationType"],
      "UpdateFiled": [], //check不更新
      "Delete": ["Code", "SystemMessageTypeOperationType"],
      "CleanRubbish": [],
      "Filter": "",
      "HaveTenant": "true",
      "ParentMapper": {},
      "ForeignMapper": [
        {
          "ForeignTable": "SystemMessageType",
          "ForeignKey": "SystemMessageTypeId",
          "SearchFiled": "OperationType"
        }
      ]
    },
    {
      "TableName": "SystemRole",
      "Insert": ["Code"],
      "Update": [],
      "UpdateFiled": [],
      "Delete": [],
      "CleanRubbish": [],
      "Filter": "",
      "HaveTenant": "true",
      "ParentMapper": {},
      "ForeignMapper": []
    },
    {
      "TableName": "SystemRight",
      "Insert": ["Code"],
      "Update": ["Code"],
      "UpdateFiled": [
        "Name"
      ], // value不更新
      "Delete": ["Code"],
      "CleanRubbish": [],
      "Filter": "",
      "HaveTenant": "false",
      "ParentMapper": {},
      "ForeignMapper": [
        {
          "ForeignTable": "SystemMenu",
          "ForeignKey": "SystemMenuId",
          "SearchFiled": "Code"
        }
      ]
    },
    {
      "TableName": "SystemSettingGroup",
      "Insert": ["Name"],
      "Update": ["Name"],
      "UpdateFiled": ["Type"],
      "Delete": ["Name"], // 同理sys_setting_group 和sys_setting
      "CleanRubbish": [],
      "Filter": "",
      "HaveTenant": "true",
      "ParentMapper": {
        "ParentFiled": "ParentId",
        "SearchFiled": "Name"
      },
      "ForeignMapper": []
    },
    {
      "TableName": "SystemSettingItem",
      "Insert": ["Code"],
      "Update": ["Code"],
      "UpdateFiled": [
        "Name",
        "Remark",
        "Sequence",
        "InputType",
        "AvailableValue",
        "DicTypeCode"
      ], // value不更新
      "Delete": ["Code"],
      "CleanRubbish": [],
      "Filter": "",
      "HaveTenant": "true",
      "ParentMapper": {},
      "ForeignMapper": [
        {
          "ForeignTable": "SystemSettingGroup",
          "ForeignKey": "SystemSettingGroupId",
          "SearchFiled": "Name"
        }
      ]
    },
    // {
    //   "TableName": "SystemPadVersion",
    //   "Insert": [ "Version" ],
    //   "Update": [],
    //   "UpdateFiled": [],
    //   "Delete": [],
    //   "CleanRubbish": [],
    //   "Filter": "",
    //   "HaveTenant": "false",
    //   "ParentMapper": {},
    //   "ForeignMapper": []
    // },
    {
      "TableName": "SystemPatientTagsType",
      "Insert": ["Type", "Source"],
      "Update": [],
      "UpdateFiled": [],
      "Delete": ["Type", "Source"],
      "CleanRubbish": [],
      "Filter": "",
      "HaveTenant": "true",
      "ParentMapper": {},
      "ForeignMapper": []
    },
    {
      "TableName": "SystemPatientTags",
      "Insert": ["SystemPatientTagsTypeName", "Name"],
      "Update": [],
      "UpdateFiled": [],
      "Delete": [],
      "CleanRubbish": [],
      "Filter": "",
      "HaveTenant": "true",
      "ParentMapper": {},
      "ForeignMapper": [
        {
          "ForeignTable": "SystemPatientTagsType",
          "ForeignKey": "SystemPatientTagsTypeId",
          "SearchFiled": "Name"
        }
      ]
    },
    {
      "TableName": "SystemEventType",
      "Insert": ["Code"],
      "Update": ["Code"],
      "UpdateFiled": [],
      "Delete": [],
      "CleanRubbish": [],
      "Filter": "",
      "HaveTenant": "true",
      "ParentMapper": {
        "ParentFiled": "ParentId",
        "SearchFiled": "Name"
      },
      "ForeignMapper": []
    }
    //{ todo:现场拿www租主更名当做租户用，导致每次比对工具比对出www租户的新增语句，故暂去除租户比对
    //  "TableName": "SystemTenant",
    //  "Insert": [ "TenantCode" ],
    //  "Update": [ "TenantCode" ],
    //  "UpdateFiled": [],
    //  "Delete": [],
    //  "CleanRubbish": [],
    //  "Filter": "",
    //  "HaveTenant": "false",
    //  "ParentMapper": {},
    //  "ForeignMapper": []
    //},
    // {
    //   "TableName": "TmplLabelPrint",
    //   "Insert": [ "Type" ],
    //   "Update": [],
    //   "UpdateFiled": [],
    //   "CleanRubbish": [],
    //   "Delete": [],
    //   "Filter": "",
    //   "HaveTenant": "true",
    //   "ParentMapper": {},
    //   "ForeignMapper": []
    // },
    // {
    //   "TableName": "TmplLabelPrintParams",
    //   "Insert": [ "Name", "TmplLabelPrintType" ],
    //   "Update": [],
    //   "UpdateFiled": [],
    //   "Delete": [],
    //   "CleanRubbish": [ //需要清理数据时配置映射而关系
    //     {
    //       "CleanRubbishFiled": "TmplLabelPrintType", //根据字段清理
    //       "CleanRubbishTable": "TmplLabelPrint", //字段关联关系表
    //       "CleanRubbishTableFiled": "Type" //字段关联关系字段
    //     }
    //   ],
    //   "Filter": "",
    //   "HaveTenant": "true",
    //   "ParentMapper": {},
    //   "ForeignMapper": [ //有外键需配置映射关系
    //     {
    //       "ForeignTable": "TmplLabelPrint", //外键表表名
    //       "ForeignKey": "TmplLabelPrintId", //主表外键字段名
    //       "SearchFiled": "Type" //匹配查找字段名（根据表名到Compare库查Code，在到HdIs库根据Code查ID ）
    //     }
    //   ]
    // }
  ]
}
