| | |
| | | return db.Table(d.TableName()).Where("device_id = ? AND create_time <= ?", devId, timestamp).Order("id desc").First(&d).Error |
| | | } |
| | | |
| | | func (d *Positions) FindMovePosition(id uint, pos string) error { |
| | | return db.Table(d.TableName()).Where("id > ? AND pos != ?", id, pos).First(&d).Error |
| | | func (d *Positions) FindMovePosition(timestamp int64, pos string) error { |
| | | return db.Table(d.TableName()).Where("create_time <= ? AND pos != ?", timestamp, pos).First(&d).Error |
| | | } |
| | | |
| | | func (d *Positions) FindPositionByTime(timestamp int64) error { |