pagebase

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MulanPSL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Eq = iota
	Ne
	Ge
	Gt
	Le
	Lt
	In
	Like
	Between
	NotIn
	NotLike
	NotBetween
	//	es
	EsFuzzy
	EsTerm
	EsTerms
	EsId
	EsIds
	EsMatch
	EsMatchAll
)

@Title 文件名称: PageConsts.go @Description 描述: PageConsts

@Author 作者: leijianming@163.com 时间(2024-02-21 22:38:21) @Update 作者: leijianming@163.com 时间(2024-02-21 22:38:21)

Variables

View Source
var OpSign = map[int]FieldSign{
	Eq: "=",
	Ne: "!=",
	Ge: ">=",
	Gt: ">",
	Le: "<=",
	Lt: "<",

	In:         "in",
	Like:       "like",
	Between:    "between",
	NotIn:      "not in",
	NotLike:    "not like",
	NotBetween: "not between",

	EsFuzzy:    "fuzzy",
	EsTerm:     "term",
	EsTerms:    "terms",
	EsId:       "id",
	EsIds:      "ids",
	EsMatch:    "match",
	EsMatchAll: "match-all",
}

Functions

This section is empty.

Types

type FieldSign

type FieldSign string

type IchubQueryField

type IchubQueryField struct {
	basedto.BaseEntity
	// 字段名 小写
	Field string `json:"field"`
	//比较符 = != > < >= <= between notbetween in notin like notlike
	OpType FieldSign `json:"op_type"`
	//比较值:一个或多个值
	Values []interface{} `json:"values,omitempty"`
}

通用查询条件

func NewFields

func NewFields(field string, opType int, opValues []any) *IchubQueryField

func NewQueryFields

func NewQueryFields() *IchubQueryField

func (*IchubQueryField) CheckType

func (this *IchubQueryField) CheckType() string

func (*IchubQueryField) Field2Keyword

func (this *IchubQueryField) Field2Keyword() string

func (*IchubQueryField) SetField

func (this *IchubQueryField) SetField(field string)

func (*IchubQueryField) Values2InStr

func (this *IchubQueryField) Values2InStr() string

type OrderByDto

type OrderByDto struct {
	//字段名 camlecase or case
	Field string `json:"field"`
	//排序:asc or desc
	Sort string `json:"sort"` //desc  asc

}

@Title 文件名称: OrderByDto.go @Description 描述: OrderByDto

@Author  作者: leijianming@163.com  时间(2024-02-21 22:38:21)
@Update  作者: leijianming@163.com  时间(2024-02-21 22:38:21)

排序

func NewOrderByDto

func NewOrderByDto() *OrderByDto

func OrderBy

func OrderBy(field, sort string) *OrderByDto

func (*OrderByDto) SetField

func (this *OrderByDto) SetField(field string)

func (*OrderByDto) SetSort

func (this *OrderByDto) SetSort(sort string)

func (*OrderByDto) ToOrderBy

func (this *OrderByDto) ToOrderBy() string

Jump to

Keyboard shortcuts

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