2025-01-25 18:05:02 +08:00
|
|
|
// Code generated by gorm.io/gen. DO NOT EDIT.
|
|
|
|
// Code generated by gorm.io/gen. DO NOT EDIT.
|
|
|
|
// Code generated by gorm.io/gen. DO NOT EDIT.
|
|
|
|
|
|
|
|
package query
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"gorm.io/gorm"
|
|
|
|
"gorm.io/gorm/clause"
|
|
|
|
"gorm.io/gorm/schema"
|
|
|
|
|
|
|
|
"gorm.io/gen"
|
|
|
|
"gorm.io/gen/field"
|
|
|
|
|
|
|
|
"gorm.io/plugin/dbresolver"
|
|
|
|
|
|
|
|
"gitea.youtukeji.com.cn/xiabin/youtu_server/gorm-gen/dao/model"
|
|
|
|
)
|
|
|
|
|
|
|
|
func newDouyinEcpmConfig(db *gorm.DB, opts ...gen.DOOption) douyinEcpmConfig {
|
|
|
|
_douyinEcpmConfig := douyinEcpmConfig{}
|
|
|
|
|
|
|
|
_douyinEcpmConfig.douyinEcpmConfigDo.UseDB(db, opts...)
|
|
|
|
_douyinEcpmConfig.douyinEcpmConfigDo.UseModel(&model.DouyinEcpmConfig{})
|
|
|
|
|
|
|
|
tableName := _douyinEcpmConfig.douyinEcpmConfigDo.TableName()
|
|
|
|
_douyinEcpmConfig.ALL = field.NewAsterisk(tableName)
|
|
|
|
_douyinEcpmConfig.ID = field.NewUint32(tableName, "id")
|
|
|
|
_douyinEcpmConfig.AppAccountID = field.NewUint32(tableName, "app_account_id")
|
|
|
|
_douyinEcpmConfig.EcpmValue = field.NewUint32(tableName, "ecpm_value")
|
|
|
|
_douyinEcpmConfig.EcpmView = field.NewUint32(tableName, "ecpm_view")
|
|
|
|
|
|
|
|
_douyinEcpmConfig.fillFieldMap()
|
|
|
|
|
|
|
|
return _douyinEcpmConfig
|
|
|
|
}
|
|
|
|
|
|
|
|
type douyinEcpmConfig struct {
|
2025-01-25 18:19:07 +08:00
|
|
|
douyinEcpmConfigDo
|
2025-01-25 18:05:02 +08:00
|
|
|
|
|
|
|
ALL field.Asterisk
|
|
|
|
ID field.Uint32
|
|
|
|
AppAccountID field.Uint32
|
2025-01-25 18:19:07 +08:00
|
|
|
EcpmValue field.Uint32
|
|
|
|
EcpmView field.Uint32
|
2025-01-25 18:05:02 +08:00
|
|
|
|
|
|
|
fieldMap map[string]field.Expr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d douyinEcpmConfig) Table(newTableName string) *douyinEcpmConfig {
|
|
|
|
d.douyinEcpmConfigDo.UseTable(newTableName)
|
|
|
|
return d.updateTableName(newTableName)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d douyinEcpmConfig) As(alias string) *douyinEcpmConfig {
|
|
|
|
d.douyinEcpmConfigDo.DO = *(d.douyinEcpmConfigDo.As(alias).(*gen.DO))
|
|
|
|
return d.updateTableName(alias)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *douyinEcpmConfig) updateTableName(table string) *douyinEcpmConfig {
|
|
|
|
d.ALL = field.NewAsterisk(table)
|
|
|
|
d.ID = field.NewUint32(table, "id")
|
|
|
|
d.AppAccountID = field.NewUint32(table, "app_account_id")
|
|
|
|
d.EcpmValue = field.NewUint32(table, "ecpm_value")
|
|
|
|
d.EcpmView = field.NewUint32(table, "ecpm_view")
|
|
|
|
|
|
|
|
d.fillFieldMap()
|
|
|
|
|
|
|
|
return d
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *douyinEcpmConfig) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
|
|
|
_f, ok := d.fieldMap[fieldName]
|
|
|
|
if !ok || _f == nil {
|
|
|
|
return nil, false
|
|
|
|
}
|
|
|
|
_oe, ok := _f.(field.OrderExpr)
|
|
|
|
return _oe, ok
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *douyinEcpmConfig) fillFieldMap() {
|
|
|
|
d.fieldMap = make(map[string]field.Expr, 4)
|
|
|
|
d.fieldMap["id"] = d.ID
|
|
|
|
d.fieldMap["app_account_id"] = d.AppAccountID
|
|
|
|
d.fieldMap["ecpm_value"] = d.EcpmValue
|
|
|
|
d.fieldMap["ecpm_view"] = d.EcpmView
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d douyinEcpmConfig) clone(db *gorm.DB) douyinEcpmConfig {
|
|
|
|
d.douyinEcpmConfigDo.ReplaceConnPool(db.Statement.ConnPool)
|
|
|
|
return d
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d douyinEcpmConfig) replaceDB(db *gorm.DB) douyinEcpmConfig {
|
|
|
|
d.douyinEcpmConfigDo.ReplaceDB(db)
|
|
|
|
return d
|
|
|
|
}
|
|
|
|
|
|
|
|
type douyinEcpmConfigDo struct{ gen.DO }
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
type IDouyinEcpmConfigDo interface {
|
|
|
|
gen.SubQuery
|
|
|
|
Debug() IDouyinEcpmConfigDo
|
|
|
|
WithContext(ctx context.Context) IDouyinEcpmConfigDo
|
|
|
|
WithResult(fc func(tx gen.Dao)) gen.ResultInfo
|
|
|
|
ReplaceDB(db *gorm.DB)
|
|
|
|
ReadDB() IDouyinEcpmConfigDo
|
|
|
|
WriteDB() IDouyinEcpmConfigDo
|
|
|
|
As(alias string) gen.Dao
|
|
|
|
Session(config *gorm.Session) IDouyinEcpmConfigDo
|
|
|
|
Columns(cols ...field.Expr) gen.Columns
|
|
|
|
Clauses(conds ...clause.Expression) IDouyinEcpmConfigDo
|
|
|
|
Not(conds ...gen.Condition) IDouyinEcpmConfigDo
|
|
|
|
Or(conds ...gen.Condition) IDouyinEcpmConfigDo
|
|
|
|
Select(conds ...field.Expr) IDouyinEcpmConfigDo
|
|
|
|
Where(conds ...gen.Condition) IDouyinEcpmConfigDo
|
|
|
|
Order(conds ...field.Expr) IDouyinEcpmConfigDo
|
|
|
|
Distinct(cols ...field.Expr) IDouyinEcpmConfigDo
|
|
|
|
Omit(cols ...field.Expr) IDouyinEcpmConfigDo
|
|
|
|
Join(table schema.Tabler, on ...field.Expr) IDouyinEcpmConfigDo
|
|
|
|
LeftJoin(table schema.Tabler, on ...field.Expr) IDouyinEcpmConfigDo
|
|
|
|
RightJoin(table schema.Tabler, on ...field.Expr) IDouyinEcpmConfigDo
|
|
|
|
Group(cols ...field.Expr) IDouyinEcpmConfigDo
|
|
|
|
Having(conds ...gen.Condition) IDouyinEcpmConfigDo
|
|
|
|
Limit(limit int) IDouyinEcpmConfigDo
|
|
|
|
Offset(offset int) IDouyinEcpmConfigDo
|
|
|
|
Count() (count int64, err error)
|
|
|
|
Scopes(funcs ...func(gen.Dao) gen.Dao) IDouyinEcpmConfigDo
|
|
|
|
Unscoped() IDouyinEcpmConfigDo
|
|
|
|
Create(values ...*model.DouyinEcpmConfig) error
|
|
|
|
CreateInBatches(values []*model.DouyinEcpmConfig, batchSize int) error
|
|
|
|
Save(values ...*model.DouyinEcpmConfig) error
|
|
|
|
First() (*model.DouyinEcpmConfig, error)
|
|
|
|
Take() (*model.DouyinEcpmConfig, error)
|
|
|
|
Last() (*model.DouyinEcpmConfig, error)
|
|
|
|
Find() ([]*model.DouyinEcpmConfig, error)
|
|
|
|
FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.DouyinEcpmConfig, err error)
|
|
|
|
FindInBatches(result *[]*model.DouyinEcpmConfig, batchSize int, fc func(tx gen.Dao, batch int) error) error
|
|
|
|
Pluck(column field.Expr, dest interface{}) error
|
|
|
|
Delete(...*model.DouyinEcpmConfig) (info gen.ResultInfo, err error)
|
|
|
|
Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error)
|
|
|
|
UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error)
|
|
|
|
Updates(value interface{}) (info gen.ResultInfo, err error)
|
|
|
|
UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error)
|
|
|
|
UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error)
|
|
|
|
UpdateColumns(value interface{}) (info gen.ResultInfo, err error)
|
|
|
|
UpdateFrom(q gen.SubQuery) gen.Dao
|
|
|
|
Attrs(attrs ...field.AssignExpr) IDouyinEcpmConfigDo
|
|
|
|
Assign(attrs ...field.AssignExpr) IDouyinEcpmConfigDo
|
|
|
|
Joins(fields ...field.RelationField) IDouyinEcpmConfigDo
|
|
|
|
Preload(fields ...field.RelationField) IDouyinEcpmConfigDo
|
|
|
|
FirstOrInit() (*model.DouyinEcpmConfig, error)
|
|
|
|
FirstOrCreate() (*model.DouyinEcpmConfig, error)
|
|
|
|
FindByPage(offset int, limit int) (result []*model.DouyinEcpmConfig, count int64, err error)
|
|
|
|
ScanByPage(result interface{}, offset int, limit int) (count int64, err error)
|
|
|
|
Scan(result interface{}) (err error)
|
|
|
|
Returning(value interface{}, columns ...string) IDouyinEcpmConfigDo
|
|
|
|
UnderlyingDB() *gorm.DB
|
|
|
|
schema.Tabler
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d douyinEcpmConfigDo) Debug() IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.withDO(d.DO.Debug())
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) WithContext(ctx context.Context) IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.withDO(d.DO.WithContext(ctx))
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) ReadDB() IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.Clauses(dbresolver.Read)
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) WriteDB() IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.Clauses(dbresolver.Write)
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) Session(config *gorm.Session) IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.withDO(d.DO.Session(config))
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) Clauses(conds ...clause.Expression) IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.withDO(d.DO.Clauses(conds...))
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) Returning(value interface{}, columns ...string) IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.withDO(d.DO.Returning(value, columns...))
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) Not(conds ...gen.Condition) IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.withDO(d.DO.Not(conds...))
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) Or(conds ...gen.Condition) IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.withDO(d.DO.Or(conds...))
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) Select(conds ...field.Expr) IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.withDO(d.DO.Select(conds...))
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) Where(conds ...gen.Condition) IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.withDO(d.DO.Where(conds...))
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) Order(conds ...field.Expr) IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.withDO(d.DO.Order(conds...))
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) Distinct(cols ...field.Expr) IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.withDO(d.DO.Distinct(cols...))
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) Omit(cols ...field.Expr) IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.withDO(d.DO.Omit(cols...))
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) Join(table schema.Tabler, on ...field.Expr) IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.withDO(d.DO.Join(table, on...))
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) LeftJoin(table schema.Tabler, on ...field.Expr) IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.withDO(d.DO.LeftJoin(table, on...))
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) RightJoin(table schema.Tabler, on ...field.Expr) IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.withDO(d.DO.RightJoin(table, on...))
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) Group(cols ...field.Expr) IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.withDO(d.DO.Group(cols...))
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) Having(conds ...gen.Condition) IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.withDO(d.DO.Having(conds...))
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) Limit(limit int) IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.withDO(d.DO.Limit(limit))
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) Offset(offset int) IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.withDO(d.DO.Offset(offset))
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) Scopes(funcs ...func(gen.Dao) gen.Dao) IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.withDO(d.DO.Scopes(funcs...))
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) Unscoped() IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.withDO(d.DO.Unscoped())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d douyinEcpmConfigDo) Create(values ...*model.DouyinEcpmConfig) error {
|
|
|
|
if len(values) == 0 {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return d.DO.Create(values)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d douyinEcpmConfigDo) CreateInBatches(values []*model.DouyinEcpmConfig, batchSize int) error {
|
|
|
|
return d.DO.CreateInBatches(values, batchSize)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Save : !!! underlying implementation is different with GORM
|
|
|
|
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
|
|
|
func (d douyinEcpmConfigDo) Save(values ...*model.DouyinEcpmConfig) error {
|
|
|
|
if len(values) == 0 {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return d.DO.Save(values)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d douyinEcpmConfigDo) First() (*model.DouyinEcpmConfig, error) {
|
|
|
|
if result, err := d.DO.First(); err != nil {
|
|
|
|
return nil, err
|
|
|
|
} else {
|
|
|
|
return result.(*model.DouyinEcpmConfig), nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d douyinEcpmConfigDo) Take() (*model.DouyinEcpmConfig, error) {
|
|
|
|
if result, err := d.DO.Take(); err != nil {
|
|
|
|
return nil, err
|
|
|
|
} else {
|
|
|
|
return result.(*model.DouyinEcpmConfig), nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d douyinEcpmConfigDo) Last() (*model.DouyinEcpmConfig, error) {
|
|
|
|
if result, err := d.DO.Last(); err != nil {
|
|
|
|
return nil, err
|
|
|
|
} else {
|
|
|
|
return result.(*model.DouyinEcpmConfig), nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d douyinEcpmConfigDo) Find() ([]*model.DouyinEcpmConfig, error) {
|
|
|
|
result, err := d.DO.Find()
|
|
|
|
return result.([]*model.DouyinEcpmConfig), err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d douyinEcpmConfigDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.DouyinEcpmConfig, err error) {
|
|
|
|
buf := make([]*model.DouyinEcpmConfig, 0, batchSize)
|
|
|
|
err = d.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
|
|
|
defer func() { results = append(results, buf...) }()
|
|
|
|
return fc(tx, batch)
|
|
|
|
})
|
|
|
|
return results, err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d douyinEcpmConfigDo) FindInBatches(result *[]*model.DouyinEcpmConfig, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
|
|
|
return d.DO.FindInBatches(result, batchSize, fc)
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) Attrs(attrs ...field.AssignExpr) IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.withDO(d.DO.Attrs(attrs...))
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) Assign(attrs ...field.AssignExpr) IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
return d.withDO(d.DO.Assign(attrs...))
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) Joins(fields ...field.RelationField) IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
for _, _f := range fields {
|
|
|
|
d = *d.withDO(d.DO.Joins(_f))
|
|
|
|
}
|
|
|
|
return &d
|
|
|
|
}
|
|
|
|
|
2025-01-25 18:19:07 +08:00
|
|
|
func (d douyinEcpmConfigDo) Preload(fields ...field.RelationField) IDouyinEcpmConfigDo {
|
2025-01-25 18:05:02 +08:00
|
|
|
for _, _f := range fields {
|
|
|
|
d = *d.withDO(d.DO.Preload(_f))
|
|
|
|
}
|
|
|
|
return &d
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d douyinEcpmConfigDo) FirstOrInit() (*model.DouyinEcpmConfig, error) {
|
|
|
|
if result, err := d.DO.FirstOrInit(); err != nil {
|
|
|
|
return nil, err
|
|
|
|
} else {
|
|
|
|
return result.(*model.DouyinEcpmConfig), nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d douyinEcpmConfigDo) FirstOrCreate() (*model.DouyinEcpmConfig, error) {
|
|
|
|
if result, err := d.DO.FirstOrCreate(); err != nil {
|
|
|
|
return nil, err
|
|
|
|
} else {
|
|
|
|
return result.(*model.DouyinEcpmConfig), nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d douyinEcpmConfigDo) FindByPage(offset int, limit int) (result []*model.DouyinEcpmConfig, count int64, err error) {
|
|
|
|
result, err = d.Offset(offset).Limit(limit).Find()
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
if size := len(result); 0 < limit && 0 < size && size < limit {
|
|
|
|
count = int64(size + offset)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
count, err = d.Offset(-1).Limit(-1).Count()
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d douyinEcpmConfigDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
|
|
|
|
count, err = d.Count()
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
err = d.Offset(offset).Limit(limit).Scan(result)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d douyinEcpmConfigDo) Scan(result interface{}) (err error) {
|
|
|
|
return d.DO.Scan(result)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d douyinEcpmConfigDo) Delete(models ...*model.DouyinEcpmConfig) (result gen.ResultInfo, err error) {
|
|
|
|
return d.DO.Delete(models)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *douyinEcpmConfigDo) withDO(do gen.Dao) *douyinEcpmConfigDo {
|
|
|
|
d.DO = *do.(*gen.DO)
|
|
|
|
return d
|
|
|
|
}
|