You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
896 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package DataEx
import (
"dsBaseRpc/Const"
"dsBaseRpc/Utils/DbUtil"
"dsBaseRpc/Utils/LogUtil"
"fmt"
)
var db = DbUtil.Engine
//有同步哪些表
var sqlDict = []string{"t_base_organization", "t_base_class"}
/**
功能:数据上报
作者:黄海
时间2020-07-16
*/
func DataExchange() {
for {
//本轮上报的数量如果是0休息10秒后再继续上传
count:=0
//遍历所有的配置节,进行循环
for i := range sqlDict {
//判断日志目录下的记录是不是存在?
//存在则读取last_updated_time+id_int进行分页获取
paramMap := map[string]interface{}{"last_updated_time": "2020-07-15 00:00:00"}
list, err := db.SqlMapClient(sqlDict[i], &paramMap).Query().List()
if err != nil {
LogUtil.Error(Const.DataBaseActionError, "数据上报时发生了严重错误:"+err.Error())
break
}
fmt.Println(list)
}
}
}