taossql.sql 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*CREATE DATABASE IF NOT EXISTS fjjsfw UPDATE 2 cacheLast 1
  2. DROP DATABASE fjjsfw;*/
  3. CREATE DATABASE IF NOT EXISTS jsfw UPDATE 2 cacheLast 1
  4. CREATE DATABASE IF NOT EXISTS jsfw CACHEMODEL 'both'
  5. CREATE STABLE IF NOT EXISTS jsfw.realtime_average_target
  6. (time TIMESTAMP, wind_speed FLOAT, power FLOAT, generator_speed FLOAT, impeller_speed FLOAT, wind_direction FLOAT, theory_generation FLOAT, blade_angle FLOAT, engine_direction FLOAT, wind_deviation FLOAT)
  7. TAGS (station_id BINARY(30),equipment_id BINARY(30),uniform_code BINARY(20), description NCHAR(50))
  8. /*
  9. CREATE TABLE realtime_average_target.USING realtime_average_target TAGS
  10. (,
  11. );
  12. ALTER STABLE jsfw.realtime_average_target ADD COLUMN theory_generation FLOAT;*/
  13. ALTER STABLE jsfw.realtime_average_target ADD COLUMN blade_angle FLOAT;
  14. ALTER STABLE jsfw.realtime_average_target ADD COLUMN engine_direction FLOAT;
  15. ALTER STABLE jsfw.realtime_average_target ADD COLUMN wind_deviation FLOAT;
  16. /*
  17. CREATE TABLE IF NOT EXISTS fjjsfw.realtime_average_target
  18. (
  19. time TIMESTAMP,
  20. equipment_id BINARY (30),
  21. wind_speed FLOAT,
  22. power FLOAT,
  23. generator_speed FLOAT,
  24. impeller_speed FLOAT,
  25. wind_direction FLOAT
  26. );*/
  27. CREATE STABLE IF NOT EXISTS jsfw.state_cause
  28. (start_time TIMESTAMP, end_time TIMESTAMP, event NCHAR(30), advance_state NCHAR(30), after_state NCHAR(30), user_flag NCHAR(30), time INT UNSIGNED)
  29. TAGS (station_id BINARY(30),equipment_id BINARY(30))
  30. CREATE STABLE IF NOT EXISTS jsfw.state_cause
  31. (start_time TIMESTAMP, end_time TIMESTAMP, event TINYINT, advance_state TINYINT, after_state TINYINT, user_flag TINYINT, time INT UNSIGNED)
  32. TAGS (station_id BINARY(50),equipment_id BINARY(50),state_type NCHAR(50))
  33. @2.6版本taos-定边
  34. CREATE DATABASE IF NOT EXISTS jsfw_db UPDATE 2;
  35. create stable if not exists pointci (ts timestamp,val double)
  36. tags (description nchar(100),station binary(20),category binary(20),facility binary(20),uniformcode binary(20));
  37. create stable if not exists jsfw_db.state_point (ts timestamp,val tinyint,status tinyint,time int) tags (description nchar(100));