DevicesMapper.xml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.sckw.slope.detection.dao.tdengine.DevicesMapper">
  4. <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.dos.tdengine.Devices">
  5. <!--@mbg.generated-->
  6. <!--@Table devices-->
  7. <id column="ts" jdbcType="TIMESTAMP" property="ts" />
  8. <result column="tslver_id" jdbcType="INTEGER" property="tslverId" />
  9. <result column="line" jdbcType="VARCHAR" property="line" />
  10. <result column="val" jdbcType="VARCHAR" property="val" />
  11. <result column="msg_id" jdbcType="VARCHAR" property="msgId" />
  12. <result column="raw_ts" jdbcType="TIMESTAMP" property="rawTs" />
  13. <result column="guid" jdbcType="VARCHAR" property="guid" />
  14. </resultMap>
  15. <sql id="Base_Column_List">
  16. <!--@mbg.generated-->
  17. ts, tslver_id, line, val, msg_id, raw_ts, guid
  18. </sql>
  19. <select id="selectByPrimaryKey" parameterType="java.util.Date" resultMap="BaseResultMap">
  20. <!--@mbg.generated-->
  21. select
  22. <include refid="Base_Column_List" />
  23. from devicesv2.devices
  24. where ts = #{ts,jdbcType=TIMESTAMP}
  25. </select>
  26. <delete id="deleteByPrimaryKey" parameterType="java.util.Date">
  27. <!--@mbg.generated-->
  28. delete from devicesv2.devices
  29. where ts = #{ts,jdbcType=TIMESTAMP}
  30. </delete>
  31. <insert id="insert" parameterType="com.sckw.slope.detection.model.dos.tdengine.Devices">
  32. <!--@mbg.generated-->
  33. insert into devicesv2.devices (ts, tslver_id, line,
  34. val, msg_id, raw_ts,
  35. guid)
  36. values (#{ts,jdbcType=TIMESTAMP}, #{tslverId,jdbcType=INTEGER}, #{line,jdbcType=VARCHAR},
  37. #{val,jdbcType=VARCHAR}, #{msgId,jdbcType=VARCHAR}, #{rawTs,jdbcType=TIMESTAMP},
  38. #{guid,jdbcType=VARCHAR})
  39. </insert>
  40. <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.tdengine.Devices">
  41. <!--@mbg.generated-->
  42. insert into devicesv2.devices
  43. <trim prefix="(" suffix=")" suffixOverrides=",">
  44. <if test="ts != null">
  45. ts,
  46. </if>
  47. <if test="tslverId != null">
  48. tslver_id,
  49. </if>
  50. <if test="line != null">
  51. line,
  52. </if>
  53. <if test="val != null">
  54. val,
  55. </if>
  56. <if test="msgId != null">
  57. msg_id,
  58. </if>
  59. <if test="rawTs != null">
  60. raw_ts,
  61. </if>
  62. <if test="guid != null">
  63. guid,
  64. </if>
  65. </trim>
  66. <trim prefix="values (" suffix=")" suffixOverrides=",">
  67. <if test="ts != null">
  68. #{ts,jdbcType=TIMESTAMP},
  69. </if>
  70. <if test="tslverId != null">
  71. #{tslverId,jdbcType=INTEGER},
  72. </if>
  73. <if test="line != null">
  74. #{line,jdbcType=VARCHAR},
  75. </if>
  76. <if test="val != null">
  77. #{val,jdbcType=VARCHAR},
  78. </if>
  79. <if test="msgId != null">
  80. #{msgId,jdbcType=VARCHAR},
  81. </if>
  82. <if test="rawTs != null">
  83. #{rawTs,jdbcType=TIMESTAMP},
  84. </if>
  85. <if test="guid != null">
  86. #{guid,jdbcType=VARCHAR},
  87. </if>
  88. </trim>
  89. </insert>
  90. <update id="updateByPrimaryKeySelective" parameterType="com.sckw.slope.detection.model.dos.tdengine.Devices">
  91. <!--@mbg.generated-->
  92. update devicesv2.devices
  93. <set>
  94. <if test="tslverId != null">
  95. tslver_id = #{tslverId,jdbcType=INTEGER},
  96. </if>
  97. <if test="line != null">
  98. line = #{line,jdbcType=VARCHAR},
  99. </if>
  100. <if test="val != null">
  101. val = #{val,jdbcType=VARCHAR},
  102. </if>
  103. <if test="msgId != null">
  104. msg_id = #{msgId,jdbcType=VARCHAR},
  105. </if>
  106. <if test="rawTs != null">
  107. raw_ts = #{rawTs,jdbcType=TIMESTAMP},
  108. </if>
  109. <if test="guid != null">
  110. guid = #{guid,jdbcType=VARCHAR},
  111. </if>
  112. </set>
  113. where ts = #{ts,jdbcType=TIMESTAMP}
  114. </update>
  115. <update id="updateByPrimaryKey" parameterType="com.sckw.slope.detection.model.dos.tdengine.Devices">
  116. <!--@mbg.generated-->
  117. update devicesv2.devices
  118. set tslver_id = #{tslverId,jdbcType=INTEGER},
  119. line = #{line,jdbcType=VARCHAR},
  120. val = #{val,jdbcType=VARCHAR},
  121. msg_id = #{msgId,jdbcType=VARCHAR},
  122. raw_ts = #{rawTs,jdbcType=TIMESTAMP},
  123. guid = #{guid,jdbcType=VARCHAR}
  124. where ts = #{ts,jdbcType=TIMESTAMP}
  125. </update>
  126. </mapper>