mysql_mobile_sync_log.go 847 B

1234567891011121314151617181920212223
  1. package dao
  2. import (
  3. "go-common/app/admin/ep/merlin/model"
  4. pkgerr "github.com/pkg/errors"
  5. )
  6. // InsertMobileSyncLog Insert Mobile Sync Log.
  7. func (d *Dao) InsertMobileSyncLog(mobileSyncLog *model.MobileSyncLog) (err error) {
  8. return pkgerr.WithStack(d.db.Create(mobileSyncLog).Error)
  9. }
  10. // UpdateMobileSyncLog Update Mobile SyncLog.
  11. func (d *Dao) UpdateMobileSyncLog(mobileSyncLog *model.MobileSyncLog) (err error) {
  12. return pkgerr.WithStack(d.db.Model(&model.MobileSyncLog{}).Where("uuid=?", mobileSyncLog.UUID).Update(mobileSyncLog).Error)
  13. }
  14. // FindMobileSyncLogStartStatus FindMobile SyncLog Start Status.
  15. func (d *Dao) FindMobileSyncLogStartStatus() (startCount int, err error) {
  16. err = pkgerr.WithStack(d.db.Model(&model.MobileSyncLog{}).Where("status=0 and mtime>=DATE_SUB(NOW(),INTERVAL 10 MINUTE)").Count(&startCount).Error)
  17. return
  18. }