edb_data_base.go 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. package models
  2. import (
  3. "eta_gn/eta_chart_lib/models/data_manage"
  4. "eta_gn/eta_chart_lib/utils"
  5. )
  6. func GetEdbDataTableName(source, subSource int) (tableName string) {
  7. switch source {
  8. case utils.DATA_SOURCE_CALCULATE:
  9. tableName = "edb_data_calculate"
  10. case utils.DATA_SOURCE_CALCULATE_LJZZY:
  11. tableName = "edb_data_calculate_ljzzy"
  12. case utils.DATA_SOURCE_CALCULATE_TBZ:
  13. tableName = "edb_data_calculate_tbz"
  14. case utils.DATA_SOURCE_CALCULATE_TCZ:
  15. tableName = "edb_data_calculate_tcz"
  16. case utils.DATA_SOURCE_CALCULATE_NSZYDPJJS:
  17. tableName = "edb_data_calculate_nszydpjjs"
  18. case utils.DATA_SOURCE_MANUAL:
  19. tableName = "edb_data_manual"
  20. case utils.DATA_SOURCE_CALCULATE_HBZ:
  21. tableName = "edb_data_calculate_hbz"
  22. case utils.DATA_SOURCE_CALCULATE_HCZ:
  23. tableName = "edb_data_calculate_hcz"
  24. case utils.DATA_SOURCE_CALCULATE_BP:
  25. tableName = "edb_data_calculate_bp"
  26. case utils.DATA_SOURCE_CALCULATE_ZJPJ:
  27. tableName = "edb_data_calculate_zjpj"
  28. case utils.DATA_SOURCE_CALCULATE_TIME_SHIFT:
  29. tableName = "edb_data_calculate_time_shift"
  30. case utils.DATA_SOURCE_CALCULATE_LJZTBPJ:
  31. tableName = "edb_data_calculate_ljztbpj"
  32. case utils.DATA_SOURCE_PYTHON:
  33. tableName = "edb_data_python"
  34. case utils.DATA_SOURCE_PREDICT_CALCULATE:
  35. tableName = "edb_data_predict_calculate"
  36. case utils.DATA_SOURCE_PREDICT_CALCULATE_TBZ:
  37. tableName = "edb_data_predict_calculate_tbz"
  38. case utils.DATA_SOURCE_PREDICT_CALCULATE_TCZ:
  39. tableName = "edb_data_predict_calculate_tcz"
  40. case utils.DATA_SOURCE_CALCULATE_CJJX:
  41. tableName = "edb_data_calculate_cjjx"
  42. case utils.DATA_SOURCE_CALCULATE_NHCC:
  43. tableName = "edb_data_calculate_nhcc"
  44. case utils.DATA_SOURCE_PREDICT_CALCULATE_NSZYDPJJS:
  45. tableName = "edb_data_predict_calculate_nszydpjjs"
  46. case utils.DATA_SOURCE_CALCULATE_ADJUST:
  47. tableName = "edb_data_calculate_adjust"
  48. case utils.DATA_SOURCE_PREDICT_CALCULATE_LJZZY:
  49. tableName = "edb_data_predict_calculate_ljzzy"
  50. case utils.DATA_SOURCE_PREDICT_CALCULATE_TIME_SHIFT:
  51. tableName = "edb_data_predict_calculate_time_shift"
  52. case utils.DATA_SOURCE_PREDICT_CALCULATE_ZJPJ:
  53. tableName = "edb_data_predict_calculate_zjpj"
  54. case utils.DATA_SOURCE_PREDICT_CALCULATE_LJZTBPJ:
  55. tableName = "edb_data_predict_calculate_ljztbpj"
  56. case utils.DATA_SOURCE_PREDICT_CALCULATE_NHCC:
  57. tableName = "edb_data_predict_calculate_nhcc"
  58. case utils.DATA_SOURCE_PREDICT_CALCULATE_CJJX:
  59. tableName = "edb_data_predict_calculate_cjjx"
  60. case utils.DATA_SOURCE_PREDICT_CALCULATE_HBZ:
  61. tableName = "edb_data_predict_calculate_hbz"
  62. case utils.DATA_SOURCE_PREDICT_CALCULATE_HCZ:
  63. tableName = "edb_data_predict_calculate_hcz"
  64. case utils.DATA_SOURCE_PREDICT_CALCULATE_BP:
  65. tableName = "edb_data_predict_calculate_bp"
  66. case utils.DATA_SOURCE_CALCULATE_JP:
  67. tableName = "edb_data_calculate_jp"
  68. case utils.DATA_SOURCE_CALCULATE_NH:
  69. tableName = "edb_data_calculate_nh"
  70. case utils.DATA_SOURCE_CALCULATE_KSZS:
  71. tableName = "edb_data_calculate_kszs"
  72. case utils.DATA_SOURCE_PREDICT_CALCULATE_JP:
  73. tableName = "edb_data_predict_calculate_jp"
  74. case utils.DATA_SOURCE_PREDICT_CALCULATE_NH:
  75. tableName = "edb_data_predict_calculate_nh"
  76. case utils.DATA_SOURCE_PREDICT_CALCULATE_KSZS:
  77. tableName = "edb_data_predict_calculate_kszs"
  78. case utils.DATA_SOURCE_CALCULATE_CORRELATION:
  79. tableName = "edb_data_calculate_correlation"
  80. case utils.DATA_SOURCE_CALCULATE_LJZZJ: //累计值转季 -> 61
  81. tableName = "edb_data_calculate_ljzzj"
  82. case utils.DATA_SOURCE_CALCULATE_LJZ: //累计值 -> 62
  83. tableName = "edb_data_calculate_ljz"
  84. case utils.DATA_SOURCE_CALCULATE_LJZNCZJ: //累计值(年初至今) -> 63
  85. tableName = "edb_data_calculate_ljznczj"
  86. case utils.DATA_SOURCE_PREDICT_CALCULATE_LJZZJ: // 预测指标 - 累计值 -> 65
  87. tableName = "edb_data_predict_calculate_ljzzj"
  88. case utils.DATA_SOURCE_PREDICT_CALCULATE_LJZ: //预测指标 - 累计值转季->64
  89. tableName = "edb_data_predict_calculate_ljz"
  90. case utils.DATA_SOURCE_PREDICT_CALCULATE_LJZNCZJ: //预测指标 - 累计值(年初至今) -> 66
  91. tableName = "edb_data_predict_calculate_ljznczj"
  92. case utils.DATA_SOURCE_CALCULATE_STANDARD_DEVIATION: //标准差->67
  93. tableName = "edb_data_calculate_standard_deviation"
  94. case utils.DATA_SOURCE_CALCULATE_PERCENTILE: //百分位->68
  95. tableName = "edb_data_calculate_percentile"
  96. case utils.DATA_SOURCE_PREDICT_CALCULATE_STANDARD_DEVIATION: //预测标准差->69
  97. tableName = "edb_data_predict_ccalculate_standard_deviation"
  98. case utils.DATA_SOURCE_PREDICT_CALCULATE_PERCENTILE: //预测百分位->70
  99. tableName = "edb_data_predict_ccalculate_percentile"
  100. case utils.DATA_SOURCE_CALCULATE_ZSXY:
  101. tableName = "edb_data_calculate_zsxy" // 指数修匀->72
  102. case utils.DATA_SOURCE_PREDICT_CALCULATE_ZSXY:
  103. tableName = "edb_data_predict_calculate_zsxy" // 预测指数修匀->73
  104. case utils.DATA_SOURCE_CALCULATE_ZDYFX:
  105. tableName = "edb_data_calculate_zdyfx" // 自定义分析->74
  106. case utils.DATA_SOURCE_CALCULATE_RJZ: //日均值->75
  107. tableName = "edb_data_calculate_rjz"
  108. default:
  109. edbSource := data_manage.GetEdbSourceBySourceId(source)
  110. if edbSource != nil {
  111. tableName = edbSource.TableName
  112. }
  113. }
  114. return
  115. }