edb_data_table.go 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. package models
  2. import (
  3. "eta/eta_index_lib/utils"
  4. )
  5. // GetEdbDataTableName 指标数据->存储表
  6. func GetEdbDataTableName(source, subSource int) (tableName string) {
  7. switch source {
  8. case utils.DATA_SOURCE_THS:
  9. tableName = "edb_data_ths"
  10. if subSource == utils.DATA_SUB_SOURCE_DATE {
  11. tableName = "edb_data_ths_ds"
  12. } else {
  13. tableName = "edb_data_ths"
  14. }
  15. case utils.DATA_SOURCE_WIND:
  16. if subSource == utils.DATA_SUB_SOURCE_DATE {
  17. tableName = "edb_data_wind_wsd"
  18. } else {
  19. tableName = "edb_data_wind"
  20. }
  21. case utils.DATA_SOURCE_PB, utils.DATA_SOURCE_PB_FINANCE:
  22. tableName = "edb_data_pb"
  23. case utils.DATA_SOURCE_CALCULATE:
  24. tableName = "edb_data_calculate"
  25. case utils.DATA_SOURCE_CALCULATE_LJZZY:
  26. tableName = "edb_data_calculate_ljzzy"
  27. case utils.DATA_SOURCE_CALCULATE_TBZ:
  28. tableName = "edb_data_calculate_tbz"
  29. case utils.DATA_SOURCE_CALCULATE_TCZ:
  30. tableName = "edb_data_calculate_tcz"
  31. case utils.DATA_SOURCE_CALCULATE_NSZYDPJJS:
  32. tableName = "edb_data_calculate_nszydpjjs"
  33. case utils.DATA_SOURCE_MANUAL:
  34. tableName = "edb_data_manual"
  35. case utils.DATA_SOURCE_LZ:
  36. tableName = "edb_data_lz"
  37. case utils.DATA_SOURCE_YS:
  38. tableName = "edb_data_ys"
  39. case utils.DATA_SOURCE_CALCULATE_HBZ:
  40. tableName = "edb_data_calculate_hbz"
  41. case utils.DATA_SOURCE_CALCULATE_HCZ:
  42. tableName = "edb_data_calculate_hcz"
  43. case utils.DATA_SOURCE_CALCULATE_BP:
  44. tableName = "edb_data_calculate_bp"
  45. case utils.DATA_SOURCE_GL:
  46. tableName = "edb_data_gl"
  47. case utils.DATA_SOURCE_ZZ:
  48. tableName = "edb_data_zz"
  49. case utils.DATA_SOURCE_DL:
  50. tableName = "edb_data_dl"
  51. case utils.DATA_SOURCE_SH:
  52. tableName = "edb_data_sh"
  53. case utils.DATA_SOURCE_CFFEX:
  54. tableName = "edb_data_cffex"
  55. case utils.DATA_SOURCE_SHFE:
  56. tableName = "edb_data_ine"
  57. case utils.DATA_SOURCE_GIE:
  58. tableName = "edb_data_gie"
  59. case utils.DATA_SOURCE_CALCULATE_ZJPJ:
  60. tableName = "edb_data_calculate_zjpj"
  61. case utils.DATA_SOURCE_CALCULATE_TIME_SHIFT:
  62. tableName = "edb_data_calculate_time_shift"
  63. case utils.DATA_SOURCE_CALCULATE_LJZTBPJ:
  64. tableName = "edb_data_calculate_ljztbpj"
  65. case utils.DATA_SOURCE_LT:
  66. tableName = "edb_data_lt"
  67. case utils.DATA_SOURCE_COAL:
  68. tableName = "edb_data_coal"
  69. case utils.DATA_SOURCE_PYTHON:
  70. tableName = "edb_data_python"
  71. case utils.DATA_SOURCE_GOOGLE_TRAVEL:
  72. tableName = "edb_data_google_travel"
  73. case utils.DATA_SOURCE_PREDICT_CALCULATE:
  74. tableName = "edb_data_predict_calculate"
  75. case utils.DATA_SOURCE_PREDICT_CALCULATE_TBZ:
  76. tableName = "edb_data_predict_calculate_tbz"
  77. case utils.DATA_SOURCE_PREDICT_CALCULATE_TCZ:
  78. tableName = "edb_data_predict_calculate_tcz"
  79. case utils.DATA_SOURCE_MYSTEEL_CHEMICAL:
  80. tableName = "edb_data_mysteel_chemical"
  81. case utils.DATA_SOURCE_CALCULATE_CJJX:
  82. tableName = "edb_data_calculate_cjjx"
  83. case utils.DATA_SOURCE_EIA_STEO:
  84. tableName = "edb_data_eia_steo"
  85. case utils.DATA_SOURCE_CALCULATE_NHCC:
  86. tableName = "edb_data_calculate_nhcc"
  87. case utils.DATA_SOURCE_COM_TRADE:
  88. tableName = "edb_data_com_trade"
  89. case utils.DATA_SOURCE_PREDICT_CALCULATE_NSZYDPJJS:
  90. tableName = "edb_data_predict_calculate_nszydpjjs"
  91. case utils.DATA_SOURCE_CALCULATE_ADJUST:
  92. tableName = "edb_data_calculate_adjust"
  93. case utils.DATA_SOURCE_SCI:
  94. tableName = "edb_data_sci"
  95. case utils.DATA_SOURCE_PREDICT_CALCULATE_LJZZY:
  96. tableName = "edb_data_predict_calculate_ljzzy"
  97. case utils.DATA_SOURCE_PREDICT_CALCULATE_TIME_SHIFT:
  98. tableName = "edb_data_predict_calculate_time_shift"
  99. case utils.DATA_SOURCE_PREDICT_CALCULATE_ZJPJ:
  100. tableName = "edb_data_predict_calculate_zjpj"
  101. case utils.DATA_SOURCE_PREDICT_CALCULATE_LJZTBPJ:
  102. tableName = "edb_data_predict_calculate_ljztbpj"
  103. case utils.DATA_SOURCE_PREDICT_CALCULATE_NHCC:
  104. tableName = "edb_data_predict_calculate_nhcc"
  105. case utils.DATA_SOURCE_PREDICT_CALCULATE_CJJX:
  106. tableName = "edb_data_predict_calculate_cjjx"
  107. case utils.DATA_SOURCE_PREDICT_CALCULATE_HBZ:
  108. tableName = "edb_data_predict_calculate_hbz"
  109. case utils.DATA_SOURCE_PREDICT_CALCULATE_HCZ:
  110. tableName = "edb_data_predict_calculate_hcz"
  111. case utils.DATA_SOURCE_PREDICT_CALCULATE_BP:
  112. tableName = "edb_data_predict_calculate_bp"
  113. case utils.DATA_SOURCE_CALCULATE_JP:
  114. tableName = "edb_data_calculate_jp"
  115. case utils.DATA_SOURCE_CALCULATE_NH:
  116. tableName = "edb_data_calculate_nh"
  117. case utils.DATA_SOURCE_CALCULATE_KSZS:
  118. tableName = "edb_data_calculate_kszs"
  119. case utils.DATA_SOURCE_PREDICT_CALCULATE_JP:
  120. tableName = "edb_data_predict_calculate_jp"
  121. case utils.DATA_SOURCE_PREDICT_CALCULATE_NH:
  122. tableName = "edb_data_predict_calculate_nh"
  123. case utils.DATA_SOURCE_PREDICT_CALCULATE_KSZS:
  124. tableName = "edb_data_predict_calculate_kszs"
  125. case utils.DATA_SOURCE_BAIINFO:
  126. tableName = "edb_data_baiinfo"
  127. case utils.DATA_SOURCE_STOCK_PLANT:
  128. tableName = "edb_data_stock_plant"
  129. case utils.DATA_SOURCE_CALCULATE_CORRELATION:
  130. tableName = "edb_data_calculate_correlation"
  131. case utils.DATA_SOURCE_NATIONAL_STATISTICS:
  132. tableName = "edb_data_national_statistics"
  133. case utils.DATA_SOURCE_CALCULATE_LJZZJ: //累计值转季 -> 61
  134. tableName = "edb_data_calculate_ljzzj"
  135. case utils.DATA_SOURCE_CALCULATE_LJZ: //累计值 -> 62
  136. tableName = "edb_data_calculate_ljz"
  137. case utils.DATA_SOURCE_CALCULATE_LJZNCZJ: //累计值(年初至今) -> 63
  138. tableName = "edb_data_calculate_ljznczj"
  139. case utils.DATA_SOURCE_PREDICT_CALCULATE_LJZZJ: // 预测指标 - 累计值 -> 65
  140. tableName = "edb_data_predict_calculate_ljzzj"
  141. case utils.DATA_SOURCE_PREDICT_CALCULATE_LJZ: //预测指标 - 累计值转季->64
  142. tableName = "edb_data_predict_calculate_ljz"
  143. case utils.DATA_SOURCE_PREDICT_CALCULATE_LJZNCZJ: //预测指标 - 累计值(年初至今) -> 66
  144. tableName = "edb_data_predict_calculate_ljznczj"
  145. case utils.DATA_SOURCE_CALCULATE_STANDARD_DEVIATION: //标准差->67
  146. tableName = "edb_data_calculate_standard_deviation"
  147. case utils.DATA_SOURCE_CALCULATE_PERCENTILE: //百分位->68
  148. tableName = "edb_data_calculate_percentile"
  149. case utils.DATA_SOURCE_PREDICT_CALCULATE_STANDARD_DEVIATION: //预测标准差->69
  150. tableName = "edb_data_predict_ccalculate_standard_deviation"
  151. case utils.DATA_SOURCE_PREDICT_CALCULATE_PERCENTILE: //预测百分位->70
  152. tableName = "edb_data_predict_ccalculate_percentile"
  153. case utils.DATA_SOURCE_FUBAO:
  154. tableName = "edb_data_fubao"
  155. case utils.DATA_SOURCE_CALCULATE_ZSXY:
  156. tableName = "edb_data_calculate_zsxy" // 指数修匀->72
  157. case utils.DATA_SOURCE_PREDICT_CALCULATE_ZSXY:
  158. tableName = "edb_data_predict_calculate_zsxy" // 预测指数修匀->73
  159. case utils.DATA_SOURCE_CALCULATE_ZDYFX:
  160. tableName = "edb_data_calculate_zdyfx" // 自定义分析->74
  161. case utils.DATA_SOURCE_CALCULATE_RJZ: //日均值75
  162. tableName = "edb_data_calculate_rjz"
  163. default:
  164. edbSource := EdbSourceIdMap[source]
  165. if edbSource != nil {
  166. tableName = edbSource.TableName
  167. }
  168. }
  169. return
  170. }