edb_data_lz.go 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. package data_manage
  2. //type lzSurveyData struct {
  3. // DataTime string `orm:"column(data_time)" description:"日期"`
  4. // InputValue string `orm:"column(input_value)" description:"值"`
  5. //}
  6. //type LongzhongSurveyData struct {
  7. // SurveyDataId int `orm:"column(survey_data_id);pk" gorm:"primaryKey"`
  8. // SurveyProductId int
  9. // ProjectQuotaId int64
  10. // BreedId string
  11. // BreedName string
  12. // QuotaId string
  13. // QuotaName string
  14. // UnitId string
  15. // UnitName string
  16. // SampleType int64
  17. // SampleId string
  18. // SampleName string
  19. // DeviceId string
  20. // Device string
  21. // ProductCraftId string
  22. // ProductCraft string
  23. // ProductLine string
  24. // InputMode int64
  25. // Frequency int64
  26. // InputValue string
  27. // TaskShouldFinishTime int64
  28. // CustomId string
  29. // CustomType int64
  30. // Custom string
  31. // QuotaSampleId int64
  32. // TaskActualFinishTime int64
  33. // AreaName string
  34. // ProvinceName string
  35. // ResearchStartData int64
  36. // ResearchStopData int64
  37. // DataTime string
  38. //}
  39. //func GetLzSurveyDataByTradeCode(condition string, pars []interface{}) (item []*lzSurveyData, err error) {
  40. // sql := ` SELECT a.* FROM longzhong_survey_data AS a
  41. // INNER JOIN longzhong_survey_product AS b ON a.survey_product_id=b.survey_product_id
  42. // WHERE 1=1 `
  43. // o := global.DbMap[utils.DbNameIndex]
  44. // if condition != "" {
  45. // sql += condition
  46. // }
  47. // sql += ` ORDER BY a.data_time DESC `
  48. // err = o.Raw(sql, pars).Find(&item).Error
  49. // return
  50. //}
  51. //func GetLzSurveyDataExistByTradeCode(surveyProductId int) (items []*LongzhongSurveyData, err error) {
  52. // sql := ` SELECT * FROM longzhong_survey_data WHERE 1=1 AND survey_product_id=? `
  53. // o := global.DbMap[utils.DbNameIndex]
  54. // err = o.Raw(sql, surveyProductId).Find(&items).Error
  55. // return
  56. //}
  57. //func GetEdbDataLzByCodeAndDate(edbCode string, startDate string) (count int, err error) {
  58. // o := global.DbMap[utils.DbNameIndex]
  59. // sql := ` SELECT COUNT(1) AS count FROM edb_data_lz WHERE edb_code=? AND data_time=? `
  60. // err = o.Raw(sql, edbCode, startDate).Scan(&count).Error
  61. // return
  62. //}
  63. //func ModifyEdbDataLz(edbInfoId int64, dataTime, value string) (err error) {
  64. // o := global.DbMap[utils.DbNameIndex]
  65. // sql := ` UPDATE edb_data_lz SET value=?,modify_time=NOW() WHERE edb_info_id=? AND data_time=? `
  66. // err = o.Exec(sql, value, edbInfoId, dataTime).Error
  67. // return
  68. //}