upcrmdao

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//TimeFmtMysql mysql time format
	TimeFmtMysql = mysql.TimeFormat
	//TimeFmtDate with only date
	TimeFmtDate = "2006-01-02"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

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

Dao upcrm dao

func New

func New(c *conf.Config) *Dao

New create

func (*Dao) AddCreditScore

func (d *Dao) AddCreditScore(creditScore *upcrmmodel.UpScoreHistory) error

AddCreditScore add score

func (*Dao) AddLog

func (d *Dao) AddLog(arg *upcrmmodel.ArgCreditLogAdd) error

AddLog add log

func (*Dao) AddOrUpdateCreditScore

func (d *Dao) AddOrUpdateCreditScore(creditScore *upcrmmodel.UpScoreHistory) (err error)

AddOrUpdateCreditScore update score

func (*Dao) Close

func (d *Dao) Close()

Close close

func (*Dao) GetCreditLog

func (d *Dao) GetCreditLog(c context.Context, arg *upcrmmodel.ArgGetLogHistory) (results []*upcrmmodel.SimpleCreditLogWithContent, err error)

GetCreditLog get log

func (*Dao) GetCreditScore

func (d *Dao) GetCreditScore(c context.Context, arg *upcrmmodel.GetScoreParam) (results []*upcrmmodel.UpScoreHistory, err error)

GetCreditScore get score

func (*Dao) InsertBatchScoreHistory

func (d *Dao) InsertBatchScoreHistory(infoList []*UpQualityInfo, tablenum int) (affectRow int64, err error)

InsertBatchScoreHistory insert batch sql

func (*Dao) InsertScoreHistory

func (d *Dao) InsertScoreHistory(info *UpQualityInfo) (affectRow int64, err error)

InsertScoreHistory insert into score history

func (*Dao) InsertScoreSection

func (d *Dao) InsertScoreSection(statis calculator.OverAllStatistic, scoreType int, date time.Time) error

InsertScoreSection insert score section

func (*Dao) UpdateCreditScore

func (d *Dao) UpdateCreditScore(score int, mid int64) (affectRow int64, err error)

UpdateCreditScore update score

func (*Dao) UpdateQualityAndPrScore

func (d *Dao) UpdateQualityAndPrScore(prScore int, qualityScore int, mid int64) (affectRow int64, err error)

UpdateQualityAndPrScore update score

type UpQualityInfo

type UpQualityInfo struct {
	Mid          int64  `json:"mid"`
	QualityValue int    `json:"quality_value"`
	PrValue      int    `json:"pr_value"`
	Cdate        string `json:"cdate"` // 产生时间 "2018-01-01"
}

UpQualityInfo struct

func (*UpQualityInfo) AsPrScore

func (u *UpQualityInfo) AsPrScore() (history *upcrmmodel.UpScoreHistory)

AsPrScore copy to db struct

func (*UpQualityInfo) AsQualityScore

func (u *UpQualityInfo) AsQualityScore() (history *upcrmmodel.UpScoreHistory)

AsQualityScore copy to db struct

Jump to

Keyboard shortcuts

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