Documentation ¶
Index ¶
- func BuildArray[T any](data []T) []interface{}
- func Page[R any, T any](ctx context.Context, db *gorm.DB, t *T, query SearchCriteria) (data []*R, total int64, err error)
- type Entity
- type FuzzyField
- type GTEField
- type GTField
- type JSONField
- type JSONFuzzyField
- type JSONGTEField
- type JSONGTField
- type JSONLTEField
- type JSONLTField
- type JSONTermField
- type LTEField
- type LTField
- type Model
- type NotNullField
- type OrFuzzyField
- type PageQuery
- type RawSearchCriteria
- type SearchCriteria
- type SearchField
- type TermField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FuzzyField ¶
type FuzzyField struct { Name string `json:"name"` //查询字段名称 Value interface{} `json:"value"` //查询字段值 }
type JSONField ¶
type JSONField struct { TermFields []JSONTermField FuzzyFields []JSONFuzzyField LTEFields []JSONLTEField LTFields []JSONLTField GTEFields []JSONGTEField GTFields []JSONGTField ArrayFields []TermField }
type JSONFuzzyField ¶
type JSONGTEField ¶
type JSONGTField ¶
type JSONLTEField ¶
type JSONLTField ¶
type JSONTermField ¶
type NotNullField ¶ added in v0.0.9
type NotNullField struct {
Name string `json:"name"` //查询字段名称
}
type OrFuzzyField ¶
type OrFuzzyField struct { Names []string `json:"names"` //查询字段名称 Value interface{} `json:"value"` //查询字段值 }
type PageQuery ¶
func (*PageQuery) InjectDefault ¶
func (pq *PageQuery) InjectDefault()
type RawSearchCriteria ¶
type RawSearchCriteria struct { SelectSql string CountSql string Where []string OrderSql string Values []interface{} PageQuery }
RawSearchCriteria 原生查询
type SearchCriteria ¶
type SearchCriteria struct { PageQuery Columns string Table string SearchField Joins []string Order string Group string OrFuzzys []OrFuzzyField NoPageQuery bool ContainsDelete bool }
SearchCriteria 搜索条件
func NewJoinSearchCriteria ¶
func NewJoinSearchCriteria(columns, table string, joins []string) *SearchCriteria
func NewJoinSearchCriteriaOfPageQuery ¶
func NewJoinSearchCriteriaOfPageQuery(query PageQuery, columns, table string, joins []string) *SearchCriteria
func NewSearchCriteriaOfPageQuery ¶
func NewSearchCriteriaOfPageQuery(query PageQuery) *SearchCriteria
func (*SearchCriteria) WithKeyword ¶
func (sc *SearchCriteria) WithKeyword(names []string, keyword string) *SearchCriteria
关键词查询
type SearchField ¶
type SearchField struct { TermFields []TermField FuzzyFields []FuzzyField LTEFields []LTEField LTFields []LTField GTEFields []GTEField GTFields []GTField JSONField JSONField NotMullFields []NotNullField }
Click to show internal directories.
Click to hide internal directories.