BaseSQLTools

package
v5.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgsGetAll added in v5.2.31

type ArgsGetAll struct {
	//检索字段
	// 仅支持field_list:"true"的字段
	ConditionFields []ArgsGetListSimpleConditionID
	//是否删除
	IsRemove bool `db:"is_remove" json:"isRemove" check:"bool"`
}

type ArgsGetListPrev

type ArgsGetListPrev struct {
	//分页
	Pages CoreSQL2.ArgsPages `json:"pages"`
	//是否删除
	IsRemove bool `db:"is_remove" json:"isRemove" check:"bool"`
	//搜索
	Search string `json:"search" check:"search" empty:"true"`
}

ArgsGetListPrev 获取高级列表参数

type ArgsGetListSimple

type ArgsGetListSimple struct {
	//分页
	Pages CoreSQL2.ArgsPages `json:"pages"`
	//检索字段
	// 仅支持field_list:"true"的字段
	ConditionFields []ArgsGetListSimpleConditionID
	//是否删除
	IsRemove bool `db:"is_remove" json:"isRemove" check:"bool"`
	//搜索
	Search string `json:"search" check:"search" empty:"true"`
}

ArgsGetListSimple 获取简单列表参数

type ArgsGetListSimpleConditionID

type ArgsGetListSimpleConditionID struct {
	//字段名称
	Name string `json:"name"`
	//值
	Val any `json:"val"`
}

type Quick

type Quick struct {
	// contains filtered or unexported fields
}

Quick 快速组装模块 * 1. 支持快速对定义好的结构体,自动生成通用方法 2. 方法包括:查看列表、查看详情、创建、更新、删除

func (*Quick) DeleteCacheByID

func (c *Quick) DeleteCacheByID(id int64)

DeleteCacheByID 删除缓冲

func (*Quick) DeleteCachePrefix added in v5.3.1

func (c *Quick) DeleteCachePrefix()

DeleteCachePrefix 删除缓冲

func (*Quick) GetAnalysis added in v5.3.1

func (c *Quick) GetAnalysis() *QuickAnalysis

GetAnalysis 获取analysis

func (*Quick) GetCacheInfoByID

func (c *Quick) GetCacheInfoByID(id int64, data any) (err error)

GetCacheInfoByID 获取缓冲Info数据

func (*Quick) GetCacheListByID

func (c *Quick) GetCacheListByID(id int64, data any) (err error)

GetCacheListByID 获取缓冲List数据

func (*Quick) GetCacheMarkByInfoID

func (c *Quick) GetCacheMarkByInfoID(id int64) string

GetCacheMarkByInfoID 获取Info缓冲标识码

func (*Quick) GetCacheMarkByListID

func (c *Quick) GetCacheMarkByListID(id int64) string

GetCacheMarkByListID 获取List缓冲标识码

func (*Quick) GetClient added in v5.2.32

func (c *Quick) GetClient() *CoreSQL2.Client

func (*Quick) GetDelete

func (c *Quick) GetDelete() *QuickDelete

GetDelete 获取delete

func (*Quick) GetInfo

func (c *Quick) GetInfo() *QuickInfo

GetInfo 获取Info

func (*Quick) GetInsert

func (c *Quick) GetInsert() *QuickInsert

GetInsert 获取insert

func (*Quick) GetList

func (c *Quick) GetList() *QuickList

GetList 获取list

func (*Quick) GetUpdate

func (c *Quick) GetUpdate() *QuickUpdate

GetUpdate 获取update

func (*Quick) Init

func (c *Quick) Init(tableName string, structData any) (err error)

Init 初始化模块

func (*Quick) SetCacheInfoByID

func (c *Quick) SetCacheInfoByID(id int64, data any)

SetCacheInfoByID 设置Info缓冲

func (*Quick) SetCacheListByID

func (c *Quick) SetCacheListByID(id int64, data any)

SetCacheListByID 设置List缓冲

type QuickAnalysis added in v5.3.1

type QuickAnalysis struct {
	// contains filtered or unexported fields
}

QuickAnalysis 获取统计

func (*QuickAnalysis) GetCountByField added in v5.3.1

func (c *QuickAnalysis) GetCountByField(field string, val any) (count int64)

GetCountByField 获取指定条件的数据量

type QuickDelete

type QuickDelete struct {
	// contains filtered or unexported fields
}

QuickDelete 删除信息

func (*QuickDelete) Clear added in v5.2.37

func (c *QuickDelete) Clear() (err error)

Clear 清理数据

func (*QuickDelete) DeleteByField added in v5.2.31

func (c *QuickDelete) DeleteByField(fieldName string, val any) (err error)

DeleteByField 根据字段删除

func (*QuickDelete) DeleteByFieldReal added in v5.3.1

func (c *QuickDelete) DeleteByFieldReal(fieldName string, val any) (err error)

DeleteByFieldReal 根据字段删除 真实删除无视软删除

func (*QuickDelete) DeleteByID

func (c *QuickDelete) DeleteByID(id int64) (err error)

DeleteByID 根据ID删除

type QuickInfo

type QuickInfo struct {
	// contains filtered or unexported fields
}

QuickInfo 获取信息

func (*QuickInfo) CheckInfoByFields added in v5.2.33

func (c *QuickInfo) CheckInfoByFields(fields map[string]any, haveDelete bool) (b bool, err error)

CheckInfoByFields 检查多条件是否存在数据

func (*QuickInfo) CheckInfoByFieldsAndTime added in v5.2.34

func (c *QuickInfo) CheckInfoByFieldsAndTime(fields map[string]any, haveDelete bool, timeField string, timeMin, timeMax time.Time) (b bool, err error)

CheckInfoByFieldsAndTime 检查多条件是否存在数据,且判断时间是否在有效期内

func (*QuickInfo) GetInfoByField added in v5.2.31

func (c *QuickInfo) GetInfoByField(fieldName string, fieldVal any, haveDelete bool, result any) (err error)

GetInfoByField 通过指定字段获取信息(必须是唯一的字段) 注意,当字段存在软删除时,请务必启用haveDelete,否则将出现异常

func (*QuickInfo) GetInfoByFields added in v5.2.33

func (c *QuickInfo) GetInfoByFields(fields map[string]any, haveDelete bool, result any) (err error)

GetInfoByFields 多个条件获取数据

func (*QuickInfo) GetInfoByID

func (c *QuickInfo) GetInfoByID(id int64, result any) (err error)

GetInfoByID 获取指定ID的信息

type QuickInsert

type QuickInsert struct {
	// contains filtered or unexported fields
}

QuickInsert 插入模块

func (*QuickInsert) InsertRow

func (c *QuickInsert) InsertRow(args any) (newID int64, err error)

InsertRow 快速写入单行

type QuickList

type QuickList struct {
	// contains filtered or unexported fields
}

QuickList 获取列表

func (*QuickList) GetAll added in v5.2.31

func (c *QuickList) GetAll(args *ArgsGetAll, result any) (dataCount int64, err error)

GetAll 获取所有数据 注意筛选条件会判断是否为空,<0的数值不会被筛选

func (*QuickList) GetDistinctList added in v5.3.0

func (c *QuickList) GetDistinctList(fieldName string) (result pq.StringArray, err error)

GetDistinctList 获取指定字段的所有差异值清单

func (*QuickList) GetListDo

func (c *QuickList) GetListDo(ctx *CoreSQL2.ClientListCtx, result any) (dataCount int64, err error)

func (*QuickList) GetListPrev

func (c *QuickList) GetListPrev(args *ArgsGetListPrev) (ctx *CoreSQL2.ClientListCtx)

GetListPrev 获取高级列表

func (*QuickList) GetListSimple

func (c *QuickList) GetListSimple(args *ArgsGetListSimple, result any) (dataCount int64, err error)

GetListSimple 获取简单列表 注意筛选条件会判断是否为空,<0的数值不会被筛选

type QuickUpdate

type QuickUpdate struct {
	// contains filtered or unexported fields
}

QuickUpdate 更新模块

func (*QuickUpdate) UpdateByID

func (c *QuickUpdate) UpdateByID(args any) (err error)

UpdateByID 根据ID更新数据

Jump to

Keyboard shortcuts

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