From 18140630f4547ca157a44de63b4cb7a44efb4566 Mon Sep 17 00:00:00 2001 From: viviman Date: Tue, 7 Dec 2021 00:21:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=A4=84=E7=90=86=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data_office/get_hy_datax/config.go | 16 ++++++ golang_learn/data_office/get_hy_datax/main.go | 7 +++ .../data_office/get_hy_datax/mysql2oracle.go | 52 +++++++++++++++++++ golang_learn/go.mod | 1 + golang_learn/go.sum | 1 + 5 files changed, 77 insertions(+) create mode 100644 golang_learn/data_office/get_hy_datax/config.go create mode 100644 golang_learn/data_office/get_hy_datax/main.go create mode 100644 golang_learn/data_office/get_hy_datax/mysql2oracle.go diff --git a/golang_learn/data_office/get_hy_datax/config.go b/golang_learn/data_office/get_hy_datax/config.go new file mode 100644 index 0000000..2f23f20 --- /dev/null +++ b/golang_learn/data_office/get_hy_datax/config.go @@ -0,0 +1,16 @@ +package main + +var Mysql_Url = "jdbc:mysql://127.0.0.1:35017/hy_qggwy" +var Mysql_Usr = "root" +var Mysql_Pwd = "admin" +var Mysql_TypeReader = "mysqlreader" +var Mysql_TypeWriter = "mysqlwriter" + +var Oracle_Url = "jdbc:oracle:thin:@127.0.0.1:1521:orcl" +var Oracle_Usr = "hy_qggwy" +var Oracle_Pwd = "hy_qggwy" +var Oracle_TypeReader = "oraclereader" +var Oracle_TypeWriter = "oraclewriter" + +var TableInit = []string{"a01_config_init", "a01_sortconfig_init"} +var TableTruncate = []string{"a01", "a01_config", "a01_for_torgid", "a01_sortconfig", "a01searchtemp", "a02", "a05", "a06", "a08", "a11", "a14", "a15", "a17", "a29", "a30", "a31", "a32", "a33", "a36", "a37", "a41", "a53", "a57", "a60", "a61", "a62", "a63", "a64", "a65", "a68", "a69", "a71", "a99z1", "b01", "b01_count_zj", "b01_extand", "competence_userdept", "customquery", "customquerylist", "cx_project", "cx_template", "data_arrange", "datarecord", "expinfo", "exptableinfo", "hzb_report_receive", "imp_record", "inner_check_result", "j0801", "j0802", "j0803", "j0804", "j0805", "j0806", "j0901", "j0902", "j0903", "j0904", "j0905", "j0906", "j1001", "j1002", "j1003", "j1004", "j1005", "j1006", "j1101", "j1102", "j1103", "j1104", "j1105", "j1106", "j1201", "j1202", "j1203", "j1204", "j1205", "j1206", "j1301", "j1302", "j1303", "j1304", "j1305", "j1306", "j1401", "j1402", "j1403", "j1404", "j1405", "j1406", "j1501", "j1502", "j1503", "j1504", "j1505", "j1506", "j1507", "j1601", "j1602", "j1603", "j1604", "j1605", "j1606", "j1607", "j1701", "j1702", "j1703", "j1704", "j1705", "j1706", "j1707", "j1801", "j1802", "j1803", "j1804", "j1805", "j1806", "j1807", "j1901", "j1902", "j1903", "j1904", "j1905", "j1906", "j1907", "j1908", "j2001", "j2002", "j2003", "j2004", "j2005", "j2006", "j2007", "j2008", "j2101", "j2102", "j2103", "j2104", "j2105", "j2106", "j2107", "j2108", "jlast", "listinfo", "log_detail", "log_detail_b", "log_detail_temp", "log_main", "log_main_b", "m_m01", "m_m02", "m_m03", "m_m04", "m_m05", "m_m06", "m_m07", "m_m08", "m_m09", "m_n01", "m_n02", "m_n03", "m_n04", "m_n05", "m_p01", "m_p02", "m_p03", "m_q01", "m_q02", "m_q03", "m_q04", "m_q05", "m_q06", "m_q07", "m_q08", "m_q09", "m_q10", "m_q11", "m_q12", "m_q13", "m_s01", "m_s02", "m_s03", "m_s04", "m_s05", "m_s06", "m_s07", "m_s07_temp", "middleverify_error_list", "middleverify_process", "outer_check_result", "sys_errorlog", "sys_log", "sys_sqllog", "syslogonlog", "tab_datacontrastresult", "table_orglevel", "tableinfo_temp", "tb_set_period", "tb_set_unit", "user_op_code", "verify_error_ignore", "verify_error_list_mirror", "verify_error_list_mirror_imp", "verify_mark"} diff --git a/golang_learn/data_office/get_hy_datax/main.go b/golang_learn/data_office/get_hy_datax/main.go new file mode 100644 index 0000000..5eea80c --- /dev/null +++ b/golang_learn/data_office/get_hy_datax/main.go @@ -0,0 +1,7 @@ +package main + +import "github.com/google/martian/log" + +func main() { + log.Infof("测试 开发控制脚本问题!") +} diff --git a/golang_learn/data_office/get_hy_datax/mysql2oracle.go b/golang_learn/data_office/get_hy_datax/mysql2oracle.go new file mode 100644 index 0000000..4160306 --- /dev/null +++ b/golang_learn/data_office/get_hy_datax/mysql2oracle.go @@ -0,0 +1,52 @@ +package main + +type Mysql2Oracle struct { + Job struct { + Content []struct { + Reader struct { + Name string `json:"name"` + Parameter struct { + Column []string `json:"column"` + Connection []struct { + JdbcUrl []string `json:"jdbcUrl"` + Table []string `json:"table"` + } `json:"connection"` + Password string `json:"password"` + Username string `json:"username"` + Where string `json:"where"` + } `json:"parameter"` + } `json:"reader"` + Writer struct { + Name string `json:"name"` + Parameter struct { + Column []string `json:"column"` + Connection []struct { + JdbcUrl string `json:"jdbcUrl"` + Table []string `json:"table"` + } `json:"connection"` + Password string `json:"password"` + PreSql []string `json:"preSql"` + Username string `json:"username"` + } `json:"parameter"` + } `json:"writer"` + } `json:"content"` + Setting struct { + Speed struct { + Channel string `json:"channel"` + } `json:"speed"` + } `json:"setting"` + } `json:"job"` +} + +type Info struct { + NameReader string + ColumnReader []string + TableReader []string + NameWriter string + ColumnWriter []string + TableWriter []string +} + +func GetMysql2Oracle(info []Info) Mysql2Oracle { + return Mysql2Oracle{} +} diff --git a/golang_learn/go.mod b/golang_learn/go.mod index a56743f..b63fb5c 100644 --- a/golang_learn/go.mod +++ b/golang_learn/go.mod @@ -13,6 +13,7 @@ require ( github.com/go-ole/go-ole v1.2.5 // indirect github.com/go-sql-driver/mysql v1.6.0 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b + github.com/google/martian v2.1.0+incompatible github.com/google/uuid v1.1.2 github.com/joho/godotenv v1.3.0 github.com/lxn/walk v0.0.0-20210112085537-c389da54e794 diff --git a/golang_learn/go.sum b/golang_learn/go.sum index b07b44b..a29ac3d 100644 --- a/golang_learn/go.sum +++ b/golang_learn/go.sum @@ -151,6 +151,7 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=