TdThinkModelMessageMapper.xml 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="cn.iocoder.yudao.module.iot.dal.tdengine.TdThingModelMessageMapper">
  6. <!-- 创建物模型消息日志超级表 -->
  7. <update id="createSuperTable">
  8. CREATE STABLE thing_model_message_${productKey}(
  9. ts TIMESTAMP,
  10. id NCHAR(64),
  11. sys NCHAR(2048),
  12. method NCHAR(255),
  13. params NCHAR(2048),
  14. device_name NCHAR(64)
  15. )TAGS (
  16. device_key NCHAR(50)
  17. )
  18. </update>
  19. <!-- 创建物模型消息日志子表,带有deviceKey的TAG -->
  20. <update id="createTableWithTag">
  21. CREATE STABLE ${deviceKey}
  22. USING thing_model_message_${productKey}(
  23. ts,
  24. id ,
  25. sys ,
  26. method ,
  27. params ,
  28. device_name
  29. )TAGS(
  30. #{device_key}
  31. )
  32. </update>
  33. </mapper>