Documentation ¶
Index ¶
- Constants
- func BuildSqlAllField(fields map[string]interface{}) string
- func BuildSqlAllFieldArray(fields map[string]interface{}) []string
- func BuildSqlField(fields map[string]interface{}, rule string, tableAlias ...string) string
- func BuildSqlFieldBySelect(fields map[string]interface{}, selects interface{}, tableAlias ...string) string
- func CheckFieldNameValid(fields map[string]interface{}, fieldName string) bool
- func CreateDateBetweenFilterSql(fieldName string, startDate string, endDate string) string
- func FilterSortFields(sort string, options map[string]interface{}, selects ...map[string]bool) string
- func ParseSortFields(str string, options map[string]interface{}, selects ...map[string]bool) []string
- func QueryFields(tableAlias string, fields ...string) string
- type FieldRule
- type QueryField
Constants ¶
View Source
const ( FIELD_RULE_ADMIN_DETAIL = "MD" FIELD_RULE_ADMIN_LIST = "ML" FIELD_RULE_USER_DETAIL = "UD" FIELD_RULE_USER_LIST = "UL" FIELD_RULE_GUEST_DETAIL = "GD" FIELD_RULE_GUEST_LIST = "GL" )
Variables ¶
This section is empty.
Functions ¶
func BuildSqlAllFieldArray ¶
生成所有字段列表数组
func BuildSqlField ¶
func BuildSqlFieldBySelect ¶
func BuildSqlFieldBySelect(fields map[string]interface{}, selects interface{}, tableAlias ...string) string
使用selects选择器生成sql查询字段列表 selects 可用值:nil, 字段列表字符串,[]string
func CheckFieldNameValid ¶
检查字段名是否有效
func CreateDateBetweenFilterSql ¶
生成sql时间段条件表达式
func FilterSortFields ¶
func FilterSortFields(sort string, options map[string]interface{}, selects ...map[string]bool) string
过滤排序字段字符串
Types ¶
type QueryField ¶
type QueryField struct {
// contains filtered or unexported fields
}
func (*QueryField) Parse ¶
func (f *QueryField) Parse(field string)
func (*QueryField) String ¶
func (f *QueryField) String() string
Click to show internal directories.
Click to hide internal directories.