base

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TblBaseService

type TblBaseService struct {
	Table string
	// contains filtered or unexported fields
}

TblBaseService 数据表基础查询操作

func (*TblBaseService) Delete

func (s *TblBaseService) Delete(ctx context.Context, where interface{}) error

Delete 删除数据

func (*TblBaseService) DeletePri

func (s *TblBaseService) DeletePri(ctx context.Context, id uint) error

DeletePri 根据主键ID删除数据(唯一主键有效)

func (*TblBaseService) DetailPri

func (s *TblBaseService) DetailPri(ctx context.Context, id uint, pointer interface{}) error

DetailPri 通过主键ID获取详情

func (*TblBaseService) Exists

func (s *TblBaseService) Exists(ctx context.Context, where interface{}) (bool, error)

Exists 检测数据是否存在

func (*TblBaseService) ExistsPri

func (s *TblBaseService) ExistsPri(ctx context.Context, id uint) (bool, error)

ExistsPri 通过主键ID检测数据是否存在

func (*TblBaseService) ListAndTotal

func (s *TblBaseService) ListAndTotal(ctx context.Context, in model.CommonListAndTotalInput, pointer interface{}, total *int) error

ListAndTotal 获取数据列表和数量

func (*TblBaseService) Save

func (s *TblBaseService) Save(ctx context.Context, data interface{}) error

Save 更新数据-基础操作

func (*TblBaseService) Scan

func (s *TblBaseService) Scan(ctx context.Context, where, pointer interface{}) error

Scan 获取并扫描数据

func (*TblBaseService) ScanOmitEmpty

func (s *TblBaseService) ScanOmitEmpty(ctx context.Context, where, pointer interface{}) error

ScanOmitEmpty 过滤条件为空并获取数据

func (*TblBaseService) Total

func (s *TblBaseService) Total(ctx context.Context, where interface{}) (int, error)

Total 获取数据总数

func (*TblBaseService) TotalPri

func (s *TblBaseService) TotalPri(ctx context.Context, id ...uint) (int, error)

TotalPri 通过主键ID获取数据总数

func (*TblBaseService) Update

func (s *TblBaseService) Update(ctx context.Context, where, data interface{}) error

Update 更新数据-简单操作

func (*TblBaseService) UpdatePri

func (s *TblBaseService) UpdatePri(ctx context.Context, id uint, column string, value interface{}) error

UpdatePri 根据主键ID更新数据(唯一主键有效)

func (*TblBaseService) WhereErr

func (s *TblBaseService) WhereErr(where interface{}) error

WhereErr 条件查询错误

Jump to

Keyboard shortcuts

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