edb_data_insert_config.go 1.1 KB

123456789101112131415161718192021222324252627282930
  1. package models
  2. import (
  3. "eta_gn/eta_index_lib/global"
  4. "time"
  5. )
  6. // EdbDataInsertConfig 指标数据插入配置表
  7. type EdbDataInsertConfig struct {
  8. EdbInfoId int `gorm:"primaryKey;autoIncrement;column:edb_info_id" description:"指标id"`
  9. Date time.Time `description:"插入的日期"`
  10. Value string `description:"插入的值"`
  11. RealDate time.Time `description:"实际数据的日期"`
  12. ModifyTime time.Time `description:"数据更新时间"`
  13. CreateTime time.Time `description:"数据插入的时间"`
  14. }
  15. // GetEdbDataInsertConfigByEdbId 根据指标id 获取数据插入配置详情
  16. func GetEdbDataInsertConfigByEdbId(edbInfoId int) (item *EdbDataInsertConfig, err error) {
  17. sql := ` SELECT * FROM edb_data_insert_config WHERE edb_info_id=? `
  18. err = global.DEFAULT_DmSQL.Raw(sql, edbInfoId).First(&item).Error
  19. return
  20. }
  21. // DeleteEdbDataInsertConfigByEdbId 根据指标id 删除数据插入配置详情
  22. func DeleteEdbDataInsertConfigByEdbId(edbInfoId int) (err error) {
  23. sql := ` DELETE FROM edb_data_insert_config WHERE edb_info_id=? `
  24. err = global.DEFAULT_DmSQL.Exec(sql, edbInfoId).Error
  25. return
  26. }