IotDeviceMapper.xml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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.middle.platform.manage.biz.mapper.IotDeviceMapper">
  4. <resultMap id="BaseResultMap" type="com.middle.platform.manage.biz.domain.IotDevice">
  5. <!--@mbg.generated-->
  6. <!--@Table iot_device-->
  7. <id column="id" jdbcType="INTEGER" property="id" />
  8. <result column="product_id" jdbcType="INTEGER" property="productId" />
  9. <result column="name" jdbcType="VARCHAR" property="name" />
  10. <result column="sn" jdbcType="VARCHAR" property="sn" />
  11. <result column="guid" jdbcType="VARCHAR" property="guid" />
  12. <result column="subtitle" jdbcType="VARCHAR" property="subtitle" />
  13. <result column="lon" jdbcType="DECIMAL" property="lon" />
  14. <result column="lat" jdbcType="DECIMAL" property="lat" />
  15. <result column="address" jdbcType="VARCHAR" property="address" />
  16. <result column="online_time" jdbcType="TIMESTAMP" property="onlineTime" />
  17. <result column="status" jdbcType="TINYINT" property="status" />
  18. <result column="enable_flag" jdbcType="TINYINT" property="enableFlag" />
  19. <result column="remark" jdbcType="VARCHAR" property="remark" />
  20. <result column="create_by" jdbcType="INTEGER" property="createBy" />
  21. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  22. <result column="update_by" jdbcType="INTEGER" property="updateBy" />
  23. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  24. <result column="delete_time" jdbcType="TIMESTAMP" property="deleteTime" />
  25. <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
  26. </resultMap>
  27. <sql id="Base_Column_List">
  28. <!--@mbg.generated-->
  29. id, product_id, `name`, sn, guid, subtitle, lon, lat, address, online_time, `status`, enable_flag,
  30. remark, create_by, create_time, update_by, update_time, delete_time, del_flag
  31. </sql>
  32. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  33. <!--@mbg.generated-->
  34. select
  35. <include refid="Base_Column_List" />
  36. from iot_device
  37. where id = #{id,jdbcType=INTEGER}
  38. </select>
  39. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  40. <!--@mbg.generated-->
  41. delete from iot_device
  42. where id = #{id,jdbcType=INTEGER}
  43. </delete>
  44. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.middle.platform.manage.biz.domain.IotDevice" useGeneratedKeys="true">
  45. <!--@mbg.generated-->
  46. insert into iot_device (product_id, `name`, sn,
  47. guid, subtitle, lon,
  48. lat, address, online_time,
  49. `status`, enable_flag, remark,
  50. create_by, create_time, update_by,
  51. update_time, delete_time, del_flag
  52. )
  53. values (#{productId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{sn,jdbcType=VARCHAR},
  54. #{guid,jdbcType=VARCHAR}, #{subtitle,jdbcType=VARCHAR}, #{lon,jdbcType=DECIMAL},
  55. #{lat,jdbcType=DECIMAL}, #{address,jdbcType=VARCHAR}, #{onlineTime,jdbcType=TIMESTAMP},
  56. #{status,jdbcType=TINYINT}, #{enableFlag,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR},
  57. #{createBy,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=INTEGER},
  58. #{updateTime,jdbcType=TIMESTAMP}, #{deleteTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}
  59. )
  60. </insert>
  61. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.middle.platform.manage.biz.domain.IotDevice" useGeneratedKeys="true">
  62. <!--@mbg.generated-->
  63. insert into iot_device
  64. <trim prefix="(" suffix=")" suffixOverrides=",">
  65. <if test="productId != null">
  66. product_id,
  67. </if>
  68. <if test="name != null">
  69. `name`,
  70. </if>
  71. <if test="sn != null">
  72. sn,
  73. </if>
  74. <if test="guid != null">
  75. guid,
  76. </if>
  77. <if test="subtitle != null">
  78. subtitle,
  79. </if>
  80. <if test="lon != null">
  81. lon,
  82. </if>
  83. <if test="lat != null">
  84. lat,
  85. </if>
  86. <if test="address != null">
  87. address,
  88. </if>
  89. <if test="onlineTime != null">
  90. online_time,
  91. </if>
  92. <if test="status != null">
  93. `status`,
  94. </if>
  95. <if test="enableFlag != null">
  96. enable_flag,
  97. </if>
  98. <if test="remark != null">
  99. remark,
  100. </if>
  101. <if test="createBy != null">
  102. create_by,
  103. </if>
  104. <if test="createTime != null">
  105. create_time,
  106. </if>
  107. <if test="updateBy != null">
  108. update_by,
  109. </if>
  110. <if test="updateTime != null">
  111. update_time,
  112. </if>
  113. <if test="deleteTime != null">
  114. delete_time,
  115. </if>
  116. <if test="delFlag != null">
  117. del_flag,
  118. </if>
  119. </trim>
  120. <trim prefix="values (" suffix=")" suffixOverrides=",">
  121. <if test="productId != null">
  122. #{productId,jdbcType=INTEGER},
  123. </if>
  124. <if test="name != null">
  125. #{name,jdbcType=VARCHAR},
  126. </if>
  127. <if test="sn != null">
  128. #{sn,jdbcType=VARCHAR},
  129. </if>
  130. <if test="guid != null">
  131. #{guid,jdbcType=VARCHAR},
  132. </if>
  133. <if test="subtitle != null">
  134. #{subtitle,jdbcType=VARCHAR},
  135. </if>
  136. <if test="lon != null">
  137. #{lon,jdbcType=DECIMAL},
  138. </if>
  139. <if test="lat != null">
  140. #{lat,jdbcType=DECIMAL},
  141. </if>
  142. <if test="address != null">
  143. #{address,jdbcType=VARCHAR},
  144. </if>
  145. <if test="onlineTime != null">
  146. #{onlineTime,jdbcType=TIMESTAMP},
  147. </if>
  148. <if test="status != null">
  149. #{status,jdbcType=TINYINT},
  150. </if>
  151. <if test="enableFlag != null">
  152. #{enableFlag,jdbcType=TINYINT},
  153. </if>
  154. <if test="remark != null">
  155. #{remark,jdbcType=VARCHAR},
  156. </if>
  157. <if test="createBy != null">
  158. #{createBy,jdbcType=INTEGER},
  159. </if>
  160. <if test="createTime != null">
  161. #{createTime,jdbcType=TIMESTAMP},
  162. </if>
  163. <if test="updateBy != null">
  164. #{updateBy,jdbcType=INTEGER},
  165. </if>
  166. <if test="updateTime != null">
  167. #{updateTime,jdbcType=TIMESTAMP},
  168. </if>
  169. <if test="deleteTime != null">
  170. #{deleteTime,jdbcType=TIMESTAMP},
  171. </if>
  172. <if test="delFlag != null">
  173. #{delFlag,jdbcType=TINYINT},
  174. </if>
  175. </trim>
  176. </insert>
  177. <update id="updateByPrimaryKeySelective" parameterType="com.middle.platform.manage.biz.domain.IotDevice">
  178. <!--@mbg.generated-->
  179. update iot_device
  180. <set>
  181. <if test="productId != null">
  182. product_id = #{productId,jdbcType=INTEGER},
  183. </if>
  184. <if test="name != null">
  185. `name` = #{name,jdbcType=VARCHAR},
  186. </if>
  187. <if test="sn != null">
  188. sn = #{sn,jdbcType=VARCHAR},
  189. </if>
  190. <if test="guid != null">
  191. guid = #{guid,jdbcType=VARCHAR},
  192. </if>
  193. <if test="subtitle != null">
  194. subtitle = #{subtitle,jdbcType=VARCHAR},
  195. </if>
  196. <if test="lon != null">
  197. lon = #{lon,jdbcType=DECIMAL},
  198. </if>
  199. <if test="lat != null">
  200. lat = #{lat,jdbcType=DECIMAL},
  201. </if>
  202. <if test="address != null">
  203. address = #{address,jdbcType=VARCHAR},
  204. </if>
  205. <if test="onlineTime != null">
  206. online_time = #{onlineTime,jdbcType=TIMESTAMP},
  207. </if>
  208. <if test="status != null">
  209. `status` = #{status,jdbcType=TINYINT},
  210. </if>
  211. <if test="enableFlag != null">
  212. enable_flag = #{enableFlag,jdbcType=TINYINT},
  213. </if>
  214. <if test="remark != null">
  215. remark = #{remark,jdbcType=VARCHAR},
  216. </if>
  217. <if test="createBy != null">
  218. create_by = #{createBy,jdbcType=INTEGER},
  219. </if>
  220. <if test="createTime != null">
  221. create_time = #{createTime,jdbcType=TIMESTAMP},
  222. </if>
  223. <if test="updateBy != null">
  224. update_by = #{updateBy,jdbcType=INTEGER},
  225. </if>
  226. <if test="updateTime != null">
  227. update_time = #{updateTime,jdbcType=TIMESTAMP},
  228. </if>
  229. <if test="deleteTime != null">
  230. delete_time = #{deleteTime,jdbcType=TIMESTAMP},
  231. </if>
  232. <if test="delFlag != null">
  233. del_flag = #{delFlag,jdbcType=TINYINT},
  234. </if>
  235. </set>
  236. where id = #{id,jdbcType=INTEGER}
  237. </update>
  238. <update id="updateByPrimaryKey" parameterType="com.middle.platform.manage.biz.domain.IotDevice">
  239. <!--@mbg.generated-->
  240. update iot_device
  241. set product_id = #{productId,jdbcType=INTEGER},
  242. `name` = #{name,jdbcType=VARCHAR},
  243. sn = #{sn,jdbcType=VARCHAR},
  244. guid = #{guid,jdbcType=VARCHAR},
  245. subtitle = #{subtitle,jdbcType=VARCHAR},
  246. lon = #{lon,jdbcType=DECIMAL},
  247. lat = #{lat,jdbcType=DECIMAL},
  248. address = #{address,jdbcType=VARCHAR},
  249. online_time = #{onlineTime,jdbcType=TIMESTAMP},
  250. `status` = #{status,jdbcType=TINYINT},
  251. enable_flag = #{enableFlag,jdbcType=TINYINT},
  252. remark = #{remark,jdbcType=VARCHAR},
  253. create_by = #{createBy,jdbcType=INTEGER},
  254. create_time = #{createTime,jdbcType=TIMESTAMP},
  255. update_by = #{updateBy,jdbcType=INTEGER},
  256. update_time = #{updateTime,jdbcType=TIMESTAMP},
  257. delete_time = #{deleteTime,jdbcType=TIMESTAMP},
  258. del_flag = #{delFlag,jdbcType=TINYINT}
  259. where id = #{id,jdbcType=INTEGER}
  260. </update>
  261. <select id="select" resultMap="BaseResultMap" parameterType="com.middle.platform.manage.biz.domain.IotDevice">
  262. select
  263. <include refid="Base_Column_List" />
  264. from iot_device
  265. </select>
  266. </mapper>