TdThinkModelMessageMapper.xml 976 B

123456789101112131415161718192021222324252627282930313233
  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_${superTableName}(
  9. ts TIMESTAMP,
  10. id NCHAR(64),
  11. sys NCHAR(2048),
  12. method NCHAR(255),
  13. params NCHAR(2048)
  14. )TAGS (
  15. device_key NCHAR(50)
  16. )
  17. </update>
  18. <!-- 创建物模型消息日志子表,带有deviceKey的TAG -->
  19. <update id="createTableWithTag">
  20. CREATE STABLE ${tableName}
  21. USING thing_model_message_${superTableName}(
  22. ts,
  23. id ,
  24. sys ,
  25. method ,
  26. params
  27. )TAGS(
  28. #{device_key}
  29. )
  30. </update>
  31. </mapper>