VIVIMAN 3 years ago
parent
commit
66460c0ac4
  1. 12
      golang_learn/data_office/get_db_excel/only_balance_ms020405/main.go

12
golang_learn/data_office/get_db_excel/only_balance_ms020405/main.go

@ -147,13 +147,13 @@ func wirteExcel(outTE *walk.TextEdit, outPB *walk.ProgressBar) {
runVal(outTE, outPB, 10, "本程序加载中...")
fromDB, _ := sql.Open("mysql", linkStr)
runVal(outTE, outPB, 20, "数据库驱动加载完成...")
fromMap := QuerySQL(fromDB, "select ifnull(s0201,'') a0101,ifnull(s0202,'') a0184,ifnull(s0203,'') a0192a from m_s02 a where RPT=2021 and not exists(select 1 from m_s02 b where b.RPT=2020 and a.S0202=b.S0202) "+
"union all select ifnull(s0401,'') a0101,ifnull(s0402,'') a0184,ifnull(s0403,'') a0192a from m_s04 a where RPT=2021 and not exists(select 1 from m_s04 b where b.RPT=2020 and a.S0402=b.S0402) "+
"union all select ifnull(s0501,'') a0101,ifnull(s0502,'') a0184,ifnull(s0503,'') a0192a from m_s05 a where RPT=2021 and not exists(select 1 from m_s05 b where b.RPT=2020 and a.S0502=b.S0502)")
fromMap := QuerySQL(fromDB, "select ifnull(s0201, '') a0101,ifnull(s0202, '') a0184,ifnull(s0203, '') a0192a from m_s02 a where RPT=2021 and S0208=2 and not exists(select 1 from m_m05 b where b.RPT=2021 and a.S0202=b.M0503 and M0511=2) "+
"union all select ifnull(s0401, '') a0101,ifnull(s0402, '') a0184,ifnull(s0403, '') a0192a from m_s04 a where RPT=2021 and S0408=2 and not exists(select 1 from m_m05 b where b.RPT=2021 and a.S0402=b.M0503 and M0511=2) "+
"union all select ifnull(s0501, '') a0101,ifnull(s0502, '') a0184,ifnull(s0503, '') a0192a from m_s05 a where RPT=2021 and S0508=2 and not exists(select 1 from m_m05 b where b.RPT=2021 and a.S0502=b.M0503 and M0511=2)")
runVal(outTE, outPB, 40, "增加的数据查询...")
toMap := QuerySQL(fromDB, "select ifnull(s0201,'') a0101,ifnull(s0202,'') a0184,ifnull(s0203,'') a0192a from m_s02 a where RPT=2020 and not exists(select 1 from m_s02 b where b.RPT=2021 and a.S0202=b.S0202) "+
"union all select ifnull(s0401,'') a0101,ifnull(s0402,'') a0184,ifnull(s0403,'') a0192a from m_s04 a where RPT=2020 and not exists(select 1 from m_s04 b where b.RPT=2021 and a.S0402=b.S0402) "+
"union all select ifnull(s0501,'') a0101,ifnull(s0502,'') a0184,ifnull(s0503,'') a0192a from m_s05 a where RPT=2020 and not exists(select 1 from m_s05 b where b.RPT=2021 and a.S0502=b.S0502)")
toMap := QuerySQL(fromDB, "select ifnull(m0501, '') a0101,ifnull(m0503, '') a0184,ifnull(m0510, '') a0192a from m_m05 b where b.RPT=2021 and M0511=2 and not exists(select 1 from m_s02 a where RPT=2021 and S0208=2 and a.S0202=b.M0503) "+
"union all select ifnull(m0501, '') a0101,ifnull(m0503, '') a0184,ifnull(m0510, '') a0192a from m_m05 b where b.RPT=2021 and M0511=2 and not exists(select 1 from m_s04 a where RPT=2021 and S0408=2 and a.S0402=b.M0503) "+
"union all select ifnull(m0501, '') a0101,ifnull(m0503, '') a0184,ifnull(m0510, '') a0192a from m_m05 b where b.RPT=2021 and M0511=2 and not exists(select 1 from m_s05 a where RPT=2021 and S0508=2 and a.S0502=b.M0503)")
runVal(outTE, outPB, 60, "减少的数据查询...")

Loading…
Cancel
Save