TdThinkModelMessageMapper.xml 984 B

12345678910111213141516171819202122232425262728293031323334
  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.TdThinkModelMessageMapper">
  6. <!-- 创建物模型消息日志超级表 -->
  7. <update id="createSuperTable">
  8. CREATE STABLE ${dataBaseName}.${superTableName}(
  9. ts TIMESTAMP,
  10. id VARCHAR(255),
  11. sys VARCHAR(2048),
  12. method VARCHAR(255),
  13. params VARCHAR(2048)
  14. )TAGS (
  15. deviceKey VARCHAR(255)
  16. )
  17. </update>
  18. <!-- 创建物模型消息日志子表,带有deviceKey的TAG -->
  19. <update id="createTableWithTag">
  20. CREATE TABLE IF NOT EXISTS ${dataBaseName}.${tableName}
  21. USING ${dataBaseName}.${superTableName}(
  22. ts,
  23. id ,
  24. sys ,
  25. method ,
  26. params
  27. )TAGS(
  28. #{deviceKey}
  29. )
  30. </update>
  31. </mapper>