neck_ring_estrus.go 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package model
  2. import (
  3. pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
  4. )
  5. type NeckRingEstrus struct {
  6. Id int64 `json:"id"`
  7. PastureId int64 `json:"pastureId"`
  8. CowId int64 `json:"cowId"`
  9. NeckRingNumber string `json:"neckRingNumber"`
  10. EarNumber string `json:"earNumber"`
  11. Lact int32 `json:"lact"`
  12. FirstTime string `json:"firstTime"`
  13. LastTime string `json:"lastTime"`
  14. ActiveTime string `json:"activeTime"`
  15. ActiveLevel pasturePb.EstrusLevel_Kind `json:"activeLevel"`
  16. IsPeak pasturePb.IsShow_Kind `json:"isPeak"`
  17. DayHigh int32 `json:"dayHigh"`
  18. MaxHigh int32 `json:"maxHigh"`
  19. MaxCft int32 `json:"maxCft"`
  20. CheckResult pasturePb.CheckResult_Kind `json:"checkResult"`
  21. CheckUserId int64 `json:"checkUserId"`
  22. CheckUserName string `json:"checkUserName"`
  23. CheckAt int64 `json:"checkAt"`
  24. IsShow pasturePb.IsShow_Kind `json:"isShow"`
  25. CreatedAt int64 `json:"createdAt"`
  26. UpdatedAt int64 `json:"updatedAt"`
  27. }
  28. func (n *NeckRingEstrus) TableName() string {
  29. return "neck_ring_estrus"
  30. }
  31. func NewNeckRingEstrus(pastureId int64, cow *Cow, level pasturePb.EstrusLevel_Kind, maxCft int32,
  32. checkResult pasturePb.CheckResult_Kind, isShow pasturePb.IsShow_Kind) *NeckRingEstrus {
  33. return &NeckRingEstrus{
  34. PastureId: pastureId,
  35. CowId: cow.Id,
  36. NeckRingNumber: cow.NeckRingNumber,
  37. EarNumber: cow.EarNumber,
  38. Lact: cow.Lact,
  39. ActiveLevel: level,
  40. IsShow: isShow,
  41. CheckResult: checkResult,
  42. MaxCft: maxCft,
  43. }
  44. }
  45. type GroupEstrusData struct {
  46. CowId int64
  47. PastureId int64
  48. EarNumber string
  49. NeckRingNumber string
  50. Records []*NeckRingEstrus
  51. Moved bool
  52. }