Script-datang.sql 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. select *
  2. from info_curve_power_turbine icpt
  3. where 1=1
  4. and icpt.standard_model = 'CCWE1500-82.DF'
  5. -- and icpt.standard_model ='CCWE1500-87.DF'
  6. -- and icpt.wind_speed >=0.5 and icpt.wind_speed <3.5
  7. and icpt.wind_speed >=18
  8. order by icpt.wind_farm_id,icpt.description ,icpt.standard_model ,icpt.wind_speed
  9. ;
  10. select model,manufacturer
  11. from info_model_turbine imt
  12. group by model,manufacturer
  13. ;
  14. select dst.no_model_turbine
  15. from data_scada_turbine dst
  16. group by dst.no_model_turbine
  17. ;
  18. select dst.id_turbine
  19. from data_scada_turbine dst
  20. group by dst.id_turbine
  21. ;
  22. select count(1)
  23. from data_scada_turbine dst
  24. ;
  25. select dst.id_farm,dst.name_farm,dst.id_turbine,dst.data_time,dst.*
  26. from data_scada_turbine dst
  27. where 1=1
  28. and dst.id_farm = 'Twr2SPNt'
  29. ;
  30. select dst.id_farm,dst.name_farm,dst.id_turbine,dst.data_time,dst.no_model_turbine,dst.wtg_sts,dst.scada_wtg_sts,dst.hyd_station_prs , dst.wind_spd ,dst.wind_dir,dst.yaw_ang,dst.yaw_to_wind_ang ,dst.impeller_spd ,dst.rotor_spd,dst.pitch_ang_act_1 ,dst.pitch_ang_act_2 ,dst.pitch_ang_act_3,dst.pitch_motor_cur_1 ,dst.pitch_motor_cur_2 ,dst.pitch_motor_cur_3 ,dst.gearbox_spd_1 ,dst.gearbox_spd_2 , dst.gen_spd ,dst.p_active
  31. from data_scada_turbine dst
  32. where 1=1
  33. and dst.rotor_spd is not null
  34. and (
  35. dst.gearbox_spd_1 is not null
  36. or
  37. dst.gearbox_spd_2 is not null
  38. )
  39. and dst.gen_spd is not null
  40. and dst.p_active is not null
  41. ;
  42. select *
  43. from info_curve_power_turbine icpt
  44. where 1=1
  45. and icpt.standard_model ='CCWE1500-82.DF'
  46. ;
  47. select
  48. it.wind_farm_id ,it.model ,
  49. imt.no_model ,
  50. imt.rated_capacity ,imt.cut_in_wind_speed,imt.cut_out_wind_speed,imt.rotor_diameter,imt.hub_height ,
  51. icpt.rated_wind_speed
  52. from info_turbine it ,info_model_turbine imt ,info_curve_power_turbine icpt
  53. where 1=1
  54. and it.model =imt.model
  55. and it.cut_in_wind_speed =imt.cut_in_wind_speed
  56. and it.cut_out_wind_speed =imt.cut_out_wind_speed
  57. and it.rotor_diameter =imt.rotor_diameter
  58. and it.hub_height =imt.hub_height
  59. and it.wind_farm_id =icpt.wind_farm_id
  60. and it.model =icpt.standard_model
  61. group by
  62. it.wind_farm_id ,it.model ,
  63. imt.no_model ,
  64. imt.rated_capacity ,imt.cut_in_wind_speed,imt.cut_out_wind_speed,imt.rotor_diameter,imt.hub_height ,
  65. icpt.rated_wind_speed
  66. ;
  67. SET SESSION tidb_mem_quota_query = 4 << 30; -- TiDB 对单条查询sql 增加最大内存
  68. --
  69. select
  70. it.wind_farm_id,it.turbine_id ,it.model,
  71. icpt.rated_wind_speed,
  72. imt.rated_capacity ,imt.cut_in_wind_speed,imt.cut_out_wind_speed,imt.rotor_diameter,imt.hub_height ,
  73. dst.data_time,dst.wtg_sts,dst.scada_wtg_sts,dst.hyd_station_prs , dst.wind_spd ,dst.wind_dir,dst.yaw_ang,dst.yaw_to_wind_ang ,dst.impeller_spd ,dst.rotor_spd,dst.pitch_ang_act_1 ,dst.pitch_ang_act_2 ,dst.pitch_ang_act_3,dst.pitch_motor_cur_1 ,dst.pitch_motor_cur_2 ,dst.pitch_motor_cur_3 ,dst.gearbox_spd_1 ,dst.gearbox_spd_2 , dst.gen_spd ,dst.p_active
  74. from info_turbine it ,info_curve_power_turbine icpt,info_model_turbine imt ,data_scada_turbine dst
  75. where 1=1
  76. and it.wind_farm_id =dst.id_farm
  77. and it.turbine_id =dst.id_turbine
  78. and it.model =dst.no_model_turbine
  79. and it.model =imt.model
  80. and it.cut_in_wind_speed =imt.cut_in_wind_speed
  81. and it.cut_out_wind_speed =imt.cut_out_wind_speed
  82. and it.rotor_diameter =imt.rotor_diameter
  83. and it.hub_height =imt.hub_height
  84. and it.wind_farm_id =icpt.wind_farm_id
  85. and it.model =icpt.standard_model
  86. and dst.rotor_spd is not null
  87. and (
  88. dst.gearbox_spd_1 is not null
  89. or
  90. dst.gearbox_spd_2 is not null
  91. )
  92. and dst.gen_spd is not null
  93. and dst.p_active is not null
  94. and it.model ='CCWE1500-82.DF'
  95. ;
  96. -- 推算 机型的 额定叶轮转速、额定发电机转速、 传动比,获取数据sql
  97. select
  98. it.wind_farm_id,it.turbine_id ,
  99. it.model,
  100. icpt.rated_wind_speed,
  101. imt.no_model,
  102. imt.rated_capacity ,imt.cut_in_wind_speed,imt.cut_out_wind_speed,imt.rotor_diameter,imt.hub_height ,
  103. dst.data_time,
  104. dst.wind_spd ,dst.rotor_spd,dst.gen_spd ,dst.p_active
  105. from info_turbine it ,info_curve_power_turbine icpt,info_model_turbine imt ,data_scada_turbine dst
  106. where 1=1
  107. and it.wind_farm_id =dst.id_farm
  108. and it.turbine_id =dst.id_turbine
  109. and it.model =dst.no_model_turbine
  110. and it.model =imt.model
  111. and it.cut_in_wind_speed =imt.cut_in_wind_speed
  112. and it.cut_out_wind_speed =imt.cut_out_wind_speed
  113. and it.rotor_diameter =imt.rotor_diameter
  114. and it.hub_height =imt.hub_height
  115. and it.wind_farm_id =icpt.wind_farm_id
  116. and it.model =icpt.standard_model
  117. and dst.wind_spd>=icpt.rated_wind_speed
  118. and (dst.p_active>=imt.rated_capacity*0.95 and dst.p_active<=imt.rated_capacity*1.05)
  119. ;
  120. select *
  121. from info_model_turbine imt
  122. where 1=1
  123. and imt.rated_gen_spd is not null
  124. ;