DeviceSpotRecordNewMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  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="cn.ourwill.module.house.entity.new_entity.DeviceSpotRecordNewMapper" >
  4. <resultMap id="BaseResultMap" type="cn.ourwill.module.house.entity.new_entity.DeviceSpotRecordNew" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="spot_id" property="spotId" jdbcType="INTEGER" />
  7. <result column="device_id" property="deviceId" jdbcType="INTEGER" />
  8. <result column="device_code" property="deviceCode" jdbcType="VARCHAR" />
  9. <result column="device_name" property="deviceName" jdbcType="VARCHAR" />
  10. <result column="spot_content" property="spotContent" jdbcType="VARCHAR" />
  11. <result column="spot_result" property="spotResult" jdbcType="VARCHAR" />
  12. <result column="spot_idea" property="spotIdea" jdbcType="VARCHAR" />
  13. <result column="uuid" property="uuid" jdbcType="VARCHAR" />
  14. <result column="c_id" property="cId" jdbcType="INTEGER" />
  15. <result column="c_time" property="cTime" jdbcType="TIMESTAMP" />
  16. <result column="u_id" property="uId" jdbcType="INTEGER" />
  17. <result column="u_time" property="uTime" jdbcType="TIMESTAMP" />
  18. </resultMap>
  19. <sql id="Example_Where_Clause" >
  20. <where >
  21. <foreach collection="oredCriteria" item="criteria" separator="or" >
  22. <if test="criteria.valid" >
  23. <trim prefix="(" suffix=")" prefixOverrides="and" >
  24. <foreach collection="criteria.criteria" item="criterion" >
  25. <choose >
  26. <when test="criterion.noValue" >
  27. and ${criterion.condition}
  28. </when>
  29. <when test="criterion.singleValue" >
  30. and ${criterion.condition} #{criterion.value}
  31. </when>
  32. <when test="criterion.betweenValue" >
  33. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  34. </when>
  35. <when test="criterion.listValue" >
  36. and ${criterion.condition}
  37. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  38. #{listItem}
  39. </foreach>
  40. </when>
  41. </choose>
  42. </foreach>
  43. </trim>
  44. </if>
  45. </foreach>
  46. </where>
  47. </sql>
  48. <sql id="Update_By_Example_Where_Clause" >
  49. <where >
  50. <foreach collection="example.oredCriteria" item="criteria" separator="or" >
  51. <if test="criteria.valid" >
  52. <trim prefix="(" suffix=")" prefixOverrides="and" >
  53. <foreach collection="criteria.criteria" item="criterion" >
  54. <choose >
  55. <when test="criterion.noValue" >
  56. and ${criterion.condition}
  57. </when>
  58. <when test="criterion.singleValue" >
  59. and ${criterion.condition} #{criterion.value}
  60. </when>
  61. <when test="criterion.betweenValue" >
  62. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  63. </when>
  64. <when test="criterion.listValue" >
  65. and ${criterion.condition}
  66. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  67. #{listItem}
  68. </foreach>
  69. </when>
  70. </choose>
  71. </foreach>
  72. </trim>
  73. </if>
  74. </foreach>
  75. </where>
  76. </sql>
  77. <sql id="Base_Column_List" >
  78. id, spot_id, device_id, device_code, device_name, spot_content, spot_result, spot_idea,
  79. c_id, c_time, u_id, u_time
  80. </sql>
  81. <select id="selectByExample" resultMap="BaseResultMap" parameterType="cn.ourwill.module.house.entity.new_entity.DeviceSpotRecordNewExample" >
  82. select
  83. <if test="distinct" >
  84. distinct
  85. </if>
  86. <include refid="Base_Column_List" />
  87. from device_spot_record_new
  88. <if test="_parameter != null" >
  89. <include refid="Example_Where_Clause" />
  90. </if>
  91. <if test="orderByClause != null" >
  92. order by ${orderByClause}
  93. </if>
  94. </select>
  95. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  96. select
  97. <include refid="Base_Column_List" />
  98. from device_spot_record_new
  99. where id = #{id,jdbcType=INTEGER}
  100. </select>
  101. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  102. delete from device_spot_record_new
  103. where id = #{id,jdbcType=INTEGER}
  104. </delete>
  105. <delete id="deleteByExample" parameterType="cn.ourwill.module.house.entity.new_entity.DeviceSpotRecordNewExample" >
  106. delete from device_spot_record_new
  107. <if test="_parameter != null" >
  108. <include refid="Example_Where_Clause" />
  109. </if>
  110. </delete>
  111. <insert id="insert" parameterType="cn.ourwill.module.house.entity.new_entity.DeviceSpotRecordNew" >
  112. insert into device_spot_record_new (id, spot_id, device_id,
  113. device_code, device_name, spot_content,
  114. spot_result, spot_idea, c_id,
  115. c_time, u_id, u_time
  116. )
  117. values (#{id,jdbcType=INTEGER}, #{spotId,jdbcType=INTEGER}, #{deviceId,jdbcType=INTEGER},
  118. #{deviceCode,jdbcType=VARCHAR}, #{deviceName,jdbcType=VARCHAR}, #{spotContent,jdbcType=VARCHAR},
  119. #{spotResult,jdbcType=VARCHAR}, #{spotIdea,jdbcType=VARCHAR}, #{cId,jdbcType=INTEGER},
  120. #{cTime,jdbcType=TIMESTAMP}, #{uId,jdbcType=INTEGER}, #{uTime,jdbcType=TIMESTAMP}
  121. )
  122. </insert>
  123. <insert id="insertSelective" parameterType="cn.ourwill.module.house.entity.new_entity.DeviceSpotRecordNew" >
  124. insert into device_spot_record_new
  125. <trim prefix="(" suffix=")" suffixOverrides="," >
  126. <if test="id != null" >
  127. id,
  128. </if>
  129. <if test="spotId != null" >
  130. spot_id,
  131. </if>
  132. <if test="deviceId != null" >
  133. device_id,
  134. </if>
  135. <if test="deviceCode != null" >
  136. device_code,
  137. </if>
  138. <if test="deviceName != null" >
  139. device_name,
  140. </if>
  141. <if test="spotContent != null" >
  142. spot_content,
  143. </if>
  144. <if test="spotResult != null" >
  145. spot_result,
  146. </if>
  147. <if test="spotIdea != null" >
  148. spot_idea,
  149. </if>
  150. <if test="cId != null" >
  151. c_id,
  152. </if>
  153. <if test="cTime != null" >
  154. c_time,
  155. </if>
  156. <if test="uId != null" >
  157. u_id,
  158. </if>
  159. <if test="uTime != null" >
  160. u_time,
  161. </if>
  162. </trim>
  163. <trim prefix="values (" suffix=")" suffixOverrides="," >
  164. <if test="id != null" >
  165. #{id,jdbcType=INTEGER},
  166. </if>
  167. <if test="spotId != null" >
  168. #{spotId,jdbcType=INTEGER},
  169. </if>
  170. <if test="deviceId != null" >
  171. #{deviceId,jdbcType=INTEGER},
  172. </if>
  173. <if test="deviceCode != null" >
  174. #{deviceCode,jdbcType=VARCHAR},
  175. </if>
  176. <if test="deviceName != null" >
  177. #{deviceName,jdbcType=VARCHAR},
  178. </if>
  179. <if test="spotContent != null" >
  180. #{spotContent,jdbcType=VARCHAR},
  181. </if>
  182. <if test="spotResult != null" >
  183. #{spotResult,jdbcType=VARCHAR},
  184. </if>
  185. <if test="spotIdea != null" >
  186. #{spotIdea,jdbcType=VARCHAR},
  187. </if>
  188. <if test="cId != null" >
  189. #{cId,jdbcType=INTEGER},
  190. </if>
  191. <if test="cTime != null" >
  192. #{cTime,jdbcType=TIMESTAMP},
  193. </if>
  194. <if test="uId != null" >
  195. #{uId,jdbcType=INTEGER},
  196. </if>
  197. <if test="uTime != null" >
  198. #{uTime,jdbcType=TIMESTAMP},
  199. </if>
  200. </trim>
  201. </insert>
  202. <select id="countByExample" parameterType="cn.ourwill.module.house.entity.new_entity.DeviceSpotRecordNewExample" resultType="java.lang.Integer" >
  203. select count(*) from device_spot_record_new
  204. <if test="_parameter != null" >
  205. <include refid="Example_Where_Clause" />
  206. </if>
  207. </select>
  208. <update id="updateByExampleSelective" parameterType="map" >
  209. update device_spot_record_new
  210. <set >
  211. <if test="record.id != null" >
  212. id = #{record.id,jdbcType=INTEGER},
  213. </if>
  214. <if test="record.spotId != null" >
  215. spot_id = #{record.spotId,jdbcType=INTEGER},
  216. </if>
  217. <if test="record.deviceId != null" >
  218. device_id = #{record.deviceId,jdbcType=INTEGER},
  219. </if>
  220. <if test="record.deviceCode != null" >
  221. device_code = #{record.deviceCode,jdbcType=VARCHAR},
  222. </if>
  223. <if test="record.deviceName != null" >
  224. device_name = #{record.deviceName,jdbcType=VARCHAR},
  225. </if>
  226. <if test="record.spotContent != null" >
  227. spot_content = #{record.spotContent,jdbcType=VARCHAR},
  228. </if>
  229. <if test="record.spotResult != null" >
  230. spot_result = #{record.spotResult,jdbcType=VARCHAR},
  231. </if>
  232. <if test="record.spotIdea != null" >
  233. spot_idea = #{record.spotIdea,jdbcType=VARCHAR},
  234. </if>
  235. <if test="record.cId != null" >
  236. c_id = #{record.cId,jdbcType=INTEGER},
  237. </if>
  238. <if test="record.cTime != null" >
  239. c_time = #{record.cTime,jdbcType=TIMESTAMP},
  240. </if>
  241. <if test="record.uId != null" >
  242. u_id = #{record.uId,jdbcType=INTEGER},
  243. </if>
  244. <if test="record.uTime != null" >
  245. u_time = #{record.uTime,jdbcType=TIMESTAMP},
  246. </if>
  247. </set>
  248. <if test="_parameter != null" >
  249. <include refid="Update_By_Example_Where_Clause" />
  250. </if>
  251. </update>
  252. <update id="updateByExample" parameterType="map" >
  253. update device_spot_record_new
  254. set id = #{record.id,jdbcType=INTEGER},
  255. spot_id = #{record.spotId,jdbcType=INTEGER},
  256. device_id = #{record.deviceId,jdbcType=INTEGER},
  257. device_code = #{record.deviceCode,jdbcType=VARCHAR},
  258. device_name = #{record.deviceName,jdbcType=VARCHAR},
  259. spot_content = #{record.spotContent,jdbcType=VARCHAR},
  260. spot_result = #{record.spotResult,jdbcType=VARCHAR},
  261. spot_idea = #{record.spotIdea,jdbcType=VARCHAR},
  262. c_id = #{record.cId,jdbcType=INTEGER},
  263. c_time = #{record.cTime,jdbcType=TIMESTAMP},
  264. u_id = #{record.uId,jdbcType=INTEGER},
  265. u_time = #{record.uTime,jdbcType=TIMESTAMP}
  266. <if test="_parameter != null" >
  267. <include refid="Update_By_Example_Where_Clause" />
  268. </if>
  269. </update>
  270. <update id="updateByPrimaryKeySelective" parameterType="cn.ourwill.module.house.entity.new_entity.DeviceSpotRecordNew" >
  271. update device_spot_record_new
  272. <set >
  273. <if test="spotId != null" >
  274. spot_id = #{spotId,jdbcType=INTEGER},
  275. </if>
  276. <if test="deviceId != null" >
  277. device_id = #{deviceId,jdbcType=INTEGER},
  278. </if>
  279. <if test="deviceCode != null" >
  280. device_code = #{deviceCode,jdbcType=VARCHAR},
  281. </if>
  282. <if test="deviceName != null" >
  283. device_name = #{deviceName,jdbcType=VARCHAR},
  284. </if>
  285. <if test="spotContent != null" >
  286. spot_content = #{spotContent,jdbcType=VARCHAR},
  287. </if>
  288. <if test="spotResult != null" >
  289. spot_result = #{spotResult,jdbcType=VARCHAR},
  290. </if>
  291. <if test="spotIdea != null" >
  292. spot_idea = #{spotIdea,jdbcType=VARCHAR},
  293. </if>
  294. <if test="cId != null" >
  295. c_id = #{cId,jdbcType=INTEGER},
  296. </if>
  297. <if test="cTime != null" >
  298. c_time = #{cTime,jdbcType=TIMESTAMP},
  299. </if>
  300. <if test="uId != null" >
  301. u_id = #{uId,jdbcType=INTEGER},
  302. </if>
  303. <if test="uTime != null" >
  304. u_time = #{uTime,jdbcType=TIMESTAMP},
  305. </if>
  306. </set>
  307. where id = #{id,jdbcType=INTEGER}
  308. </update>
  309. <update id="updateByPrimaryKey" parameterType="cn.ourwill.module.house.entity.new_entity.DeviceSpotRecordNew" >
  310. update device_spot_record_new
  311. set spot_id = #{spotId,jdbcType=INTEGER},
  312. device_id = #{deviceId,jdbcType=INTEGER},
  313. device_code = #{deviceCode,jdbcType=VARCHAR},
  314. device_name = #{deviceName,jdbcType=VARCHAR},
  315. spot_content = #{spotContent,jdbcType=VARCHAR},
  316. spot_result = #{spotResult,jdbcType=VARCHAR},
  317. spot_idea = #{spotIdea,jdbcType=VARCHAR},
  318. c_id = #{cId,jdbcType=INTEGER},
  319. c_time = #{cTime,jdbcType=TIMESTAMP},
  320. u_id = #{uId,jdbcType=INTEGER},
  321. u_time = #{uTime,jdbcType=TIMESTAMP}
  322. where id = #{id,jdbcType=INTEGER}
  323. </update>
  324. </mapper>