From ed13a56a674e22558c9fde7fef8d8bd7df80d00b Mon Sep 17 00:00:00 2001 From: wangshuai Date: Thu, 3 Sep 2020 14:10:25 +0800 Subject: [PATCH] 'commit' --- .../DataSource/DatasourceDAO/DatasourceDAO.go | 5 ----- .../DatastatisticService/DatastatisticService.go | 5 +---- .../MyModel/MetaData/MetadataDAO/MetadataDAO.go | 15 --------------- dsSupport/MyModel/MySwagger/Jyt2012Swag.go | 2 +- 4 files changed, 2 insertions(+), 25 deletions(-) diff --git a/dsSupport/MyModel/DataSource/DatasourceDAO/DatasourceDAO.go b/dsSupport/MyModel/DataSource/DatasourceDAO/DatasourceDAO.go index 7ee7a2e1..3e92bf09 100644 --- a/dsSupport/MyModel/DataSource/DatasourceDAO/DatasourceDAO.go +++ b/dsSupport/MyModel/DataSource/DatasourceDAO/DatasourceDAO.go @@ -18,17 +18,12 @@ func GetDatasourceResults(query MySwagger.DatasourceQuery) (bool, string, int, [ //接收传入参数 var limit = 100 var offset = (query.Page - 1) * limit - //var orderby = "create_time DESC" - // 排序查询语句 - //orderBySql := fmt.Sprintf("%s", " order by ? ") //条件查询语句 conditionSql := fmt.Sprintf("%s", " limit ? offset ? ") //分页的语句 pageSql := fmt.Sprintf("%s %s", sql, conditionSql) - fmt.Println(pageSql) //分页数据当前页现存条数 count, _ := DbUtil.Engine.SQL(pageSql, limit, offset).Query().Count() - fmt.Println(count) if count > 0 { //分页数据 list, err := DbUtil.Engine.SQL(pageSql, limit, offset).Query().List() diff --git a/dsSupport/MyModel/DataStatistic/DatastatisticService/DatastatisticService.go b/dsSupport/MyModel/DataStatistic/DatastatisticService/DatastatisticService.go index 91d201e2..4b6e10e6 100644 --- a/dsSupport/MyModel/DataStatistic/DatastatisticService/DatastatisticService.go +++ b/dsSupport/MyModel/DataStatistic/DatastatisticService/DatastatisticService.go @@ -5,7 +5,6 @@ import ( "dsSupport/MyModel/DataSource/DatasourceService" "dsSupport/MyModel/MySwagger" "dsSupport/Utils/ES7Util" - "fmt" ) type ESDataContent struct { @@ -27,18 +26,16 @@ func GetESDocCount() (bool, []map[string]interface{}) { rr, _, _, datasources, _ := DatasourceService.GetDatasourceResults(sw) if rr == true { for _, vv := range datasources { - fmt.Println(vv["datasource_code"]) - fmt.Println(vv["datasource_name"]) result, _ := ES7Util.GetDocCount(vv["datasource_code"].(string)) num += result _, _, esdata := ES7Util.GetLatestDoc(vv["datasource_code"].(string)) - fmt.Println(esdata.BeginTime) data = make(map[string]interface{}) data["system_name"] = v["app_name"] data["system_id"] = v["app_id"] data["datasource_code"] = vv["datasource_code"] data["datasource_name"] = vv["datasource_name"] + data["datasource_id"] = vv["id"] data["storage_time"] = esdata.BeginTime data["num"] = result datas = append(datas, data) diff --git a/dsSupport/MyModel/MetaData/MetadataDAO/MetadataDAO.go b/dsSupport/MyModel/MetaData/MetadataDAO/MetadataDAO.go index fc4a4532..0cd29bf7 100644 --- a/dsSupport/MyModel/MetaData/MetadataDAO/MetadataDAO.go +++ b/dsSupport/MyModel/MetaData/MetadataDAO/MetadataDAO.go @@ -2,7 +2,6 @@ package MetadataDAO import ( "dsSupport/MyModel/MySwagger" - "dsSupport/Utils/CacheUtil" "dsSupport/Utils/DbUtil" "dsSupport/Utils/ErrorConst" "dsSupport/Utils/LogUtil" @@ -13,20 +12,6 @@ import ( //数据库 var db = DbUtil.Engine -func GetMetadataRow(where string) (bool, string, map[string]interface{}, error) { - sql := "SELECT id FROM t_dataex_metadata WHERE " + where - fmt.Println("sql = ", sql) - - //通过SQL获取带缓存的数据 - list, count, _ := CacheUtil.Page(sql, 1, 0) - - if count > 0 { - return true, "数据获取成功", list[0], nil - } else { - return false, "数据获取失败,systemID对应的数据源类型不存在", nil, nil - } -} - func GetMetadataResults(query MySwagger.MetadataQuery) (bool, string, int, []map[string]interface{}, error) { sql := "SELECT * FROM t_dataex_metadata WHERE 1 = 1" + query.Conditions + " ORDER BY create_time DESC, change_time DESC" //接收传入参数 diff --git a/dsSupport/MyModel/MySwagger/Jyt2012Swag.go b/dsSupport/MyModel/MySwagger/Jyt2012Swag.go index 015f34f1..82350425 100644 --- a/dsSupport/MyModel/MySwagger/Jyt2012Swag.go +++ b/dsSupport/MyModel/MySwagger/Jyt2012Swag.go @@ -14,7 +14,7 @@ import "time" type Jyt2012Swag struct { Id string `json:"id" xorm:"not null pk comment('ID') VARCHAR(36)" example:"F38BD0DB-0142-4356-8F2B-623813FC2578"` DicName string `json:"dic_name" xorm:"not null comment('字典/字典项名称') VARCHAR(100)" example:"sex"` - DicValue string `json:"dic_name" xorm:"not null comment('字典/字典项值') VARCHAR(100)" example:"10"` + DicValue string `json:"dic_value" xorm:"not null comment('字典/字典项值') VARCHAR(100)" example:"10"` DicType int `json:"dic_type" xorm:"not null default 1 comment('字典类型【1:国标数据、关联数据源,2:国标字典、关联元数据】') INT(11)" example:"1"` DicInfo string `json:"dic_info" xorm:"default ''NULL'' comment('字典项说明') VARCHAR(500)" example:"我是字典项说明"` RootFlag int `json:"root_flag" xorm:"not null default -1 comment('是否是字典【1:是,-1:否】') INT(11)" example:"1"`