track.go 651 B

12345678910111213141516171819202122
  1. package archive
  2. import (
  3. "context"
  4. "go-common/library/log"
  5. )
  6. const (
  7. _inArcHis = "INSERT INTO archive_track(aid,state,round,attribute,remark,ctime,mtime) VALUES(?,?,?,?,?,?,?)"
  8. )
  9. // AddTrack insert archive track history
  10. func (d *Dao) AddTrack(c context.Context, aid int64, state int, round int8, attr int32, remark string, ctime, mtime string) (rows int64, err error) {
  11. rs, err := d.db.Exec(c, _inArcHis, aid, state, round, attr, remark, ctime, mtime)
  12. if err != nil {
  13. log.Error("d.inArcHisStmt.Exec(%d, %d, %d, %s, %s, %s) error(%v)", aid, state, round, attr, remark, ctime, mtime, err)
  14. return
  15. }
  16. rows, err = rs.RowsAffected()
  17. return
  18. }