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 DaoAppBase
import (
"dsSso/Dao/DaoCache"
"dsSso/Model"
"dsSso/Utils/DbUtil"
)
var joinModel Model . Selector
var tableName = "t_app_base"
var db = DbUtil . Engine
func init ( ) {
_ , joinModel = joinModel . Get ( tableName )
}
/**
功能:获取统一认证的接入系统列表
作者:黄海
时间: 2020-02-05
*/
func GetAppBaseList ( page int , limit int , keyword string ) ( [ ] map [ string ] interface { } , int32 ) {
//基础查询语句
baseSql := "select app_id from t_app_base where app_name like ? and b_use=1"
//使用通用方法, 获取简单表的分页查询SQL语句和求总数SQL语句
keyword = "%" + keyword + "%"
//偏移量
var offset = ( page - 1 ) * limit
//一键加载,最后两个参数:每页多少个+从哪个位置开始,中间的参数为sql语句中的查询参数
list , count := DaoCache . PageData ( baseSql , joinModel , keyword , limit , offset )
return list , count
}
/**
功能: 根据appId获取接入第三方统一认证系统的信息
作者:吴缤
日期: 2020-03-26
*/
func GetAppInfoById ( appId string ) map [ string ] interface { } {
ids := [ ] string { appId }
list := DaoCache . GetListByIds ( ids , joinModel )
if len ( list ) > 0 {
return list [ 0 ]
} else {
return nil
}
}