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.
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 ESSqlDAO
import (
"dsDataex/Utils/CacheUtil"
"html"
)
func GetQuerybyID ( queryID string ) ( bool , string , map [ string ] interface { } , error ) {
ids := [ ] string { queryID }
result := CacheUtil . GetListByIds ( ids , CacheUtil . GetBean ( "t_report_sqlquery" ) )
if len ( result ) == 1 {
return true , "数据获取成功" , result [ 0 ] , nil
} else {
return false , "数据获取失败, queryID不存在" , nil , nil
}
}
func GetQuerybyCode ( queryCode string ) ( bool , string , map [ string ] interface { } , error ) {
sql := "SELECT id from t_report_sqlquery where delete_flag = -1 and enable_flag = 1 and query_code = '" + html . EscapeString ( queryCode ) + "'"
//通过SQL获取带缓存的数据
list , count , _ := CacheUtil . Page ( sql , 10 , 0 )
if count == 1 {
return true , "数据获取成功" , list [ 0 ] , nil
} else {
return false , "数据获取失败, queryID不存在" , nil , nil
}
}