)funcgetCountSQL(sqlstring,args...interface{})int{varcountintcountSQL:=fmt.Sprintf("SELECT COUNT(*) FROM (%s) A",sql)err:=database.GetConnection().QueryRow(countSQL,args...).Scan(&count)iferr!=nil{panic(err)}returncount}funcgetPageSQL(sqlstring,orderBy,orderTypestring,page,pageSizeint,args...interface{})(*SQL.Rows,error){pageSQL:=fmt.Sprintf("%s ORDER BY %s %s LIMIT ?,?",sql,orderBy,orderType)args=append(args,(page-1)*pageSize,pageSize)returndatabase.GetConnection().Query(pageSQL,args...)}