master
huanghai 5 years ago
parent 342347f080
commit 7c711e54b5

@ -38,20 +38,6 @@ func GetListByIds(ids []string, m Model.Selector) []map[string]interface{} {
return list
}
/**
ID
2020-02-21
*/
func DeleteCacheByIds(ids []string, m Model.Selector) {
prefix := m.RedisPrefix
for i := 0; i < len(ids); i++ {
id := ids[i]
key := prefix + id
RedisUtil.DEL(key)
}
}
/*===================以下为内部函数用于扩展从REDIS缓存中查询===========================*/
func fromDb(ids []string, m Model.Selector) []map[string]interface{} {
tableName := m.TableName
@ -135,22 +121,6 @@ func batchReadRedis(ids []string, prefix string) ([]map[string]interface{}, []st
return existList, notExistsIds
}
/**
SQLSQLSQL
2020-02-21
*/
func count(baseSql string) (int32, error) {
countSql := "SELECT count(*) as count from (" + baseSql + ") as t100"
var count int32
_, err := db.SQL(countSql).Get(&count)
if err != nil {
LogUtil.Error(ErrorConst.SqlQueryError, err.Error())
return 0, err
}
return count, nil
}
/**
SQLSQL

Loading…
Cancel
Save