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 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 ¶ added in v0.0.3
type FuzzyField struct { Name string `json:"name"` //查询字段名称 Value interface{} `json:"value"` //查询字段值 }
type JSONField ¶ added in v0.0.3
type JSONField struct { TermFields []JSONTermField FuzzyFields []JSONFuzzyField LTEFields []JSONLTEField LTFields []JSONLTField GTEFields []JSONGTEField GTFields []JSONGTField ArrayFields []TermField }
type JSONFuzzyField ¶ added in v0.0.3
type JSONGTEField ¶ added in v0.0.3
type JSONGTField ¶ added in v0.0.3
type JSONLTEField ¶ added in v0.0.3
type JSONLTField ¶ added in v0.0.3
type JSONTermField ¶ added in v0.0.3
type OrFuzzyField ¶ added in v0.0.3
type OrFuzzyField struct { Names []string `json:"names"` //查询字段名称 Value interface{} `json:"value"` //查询字段值 }
type PageQuery ¶ added in v0.0.3
func (*PageQuery) InjectDefault ¶ added in v0.0.3
func (pq *PageQuery) InjectDefault()
type RawSearchCriteria ¶ added in v0.0.3
type RawSearchCriteria struct { SelectSql string CountSql string Where []string OrderSql string Values []interface{} PageQuery }
RawSearchCriteria 原生查询
type SearchCriteria ¶ added in v0.0.3
type SearchCriteria struct { PageQuery Columns string Table string SearchField Joins []string Order string Group string OrFuzzys []OrFuzzyField NoPageQuery bool }
SearchCriteria 搜索条件
func NewJoinSearchCriteria ¶ added in v0.0.3
func NewJoinSearchCriteria(columns, table string, joins []string) *SearchCriteria
func NewJoinSearchCriteriaOfPageQuery ¶ added in v0.0.3
func NewJoinSearchCriteriaOfPageQuery(query PageQuery, columns, table string, joins []string) *SearchCriteria
func NewSearchCriteriaOfPageQuery ¶ added in v0.0.3
func NewSearchCriteriaOfPageQuery(query PageQuery) *SearchCriteria
func (*SearchCriteria) BuildDB ¶ added in v0.0.3
func (sc *SearchCriteria) BuildDB(db *gorm.DB) *gorm.DB
func (*SearchCriteria) WithKeyword ¶ added in v0.0.3
func (sc *SearchCriteria) WithKeyword(names []string, keyword string) *SearchCriteria
关键词查询
type SearchField ¶ added in v0.0.3
Click to show internal directories.
Click to hide internal directories.