edb_data_table.go 7.4 KB

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