conditional

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const GeneralSumKey = "#sum"

Variables

This section is empty.

Functions

func QueryStructConditional

func QueryStructConditional(db *gorm.DB, search interface{}, list interface{}, sum interface{}, total *int64, maxPagesize, includeEmptyString int) (err error)

Types

type BaseCondition

type BaseCondition struct {
	Page     *int    `json:"page" form:"page"`         // zh: 页码
	Pagesize *int    `json:"pagesize" form:"pagesize"` // zh: 每页大小
	OrderKey *string `json:"orderKey" form:"orderKey"` // zh: 排序字段名
	Desc     *bool   `json:"desc" form:"desc"`         // zh: 是否降序
}

type GeneralResult

type GeneralResult struct {
	Total int64                    `json:"total"`
	List  []map[string]interface{} `json:"list"`
	Sum   map[string]interface{}   `json:"sum"`
}

func QueryGeneralConditional

func QueryGeneralConditional(db *gorm.DB, search map[string]interface{}, maxPagesize, includeEmptyString int) (gr GeneralResult, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL