DeviceGetDao.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  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.dao.dm.DeviceGetDao">
  4. <resultMap type="cn.ourwill.module.house.entity.dm.DeviceGet" id="baseMap">
  5. <result column="id" property="id"/>
  6. <result column="type" property="type"/>
  7. <result column="subType" property="subType"/>
  8. <result column="name" property="name"/>
  9. <result column="getTime" property="getTime"/>
  10. <result column="returnTime" property="returnTime"/>
  11. <result column="model" property="model"/>
  12. <result column="number" property="number"/>
  13. <result column="count" property="count"/>
  14. <result column="getUser" property="getUser"/>
  15. <result column="useage" property="useage"/>
  16. <result column="houseId" property="houseId"/>
  17. <result column="cId" property="cId"/>
  18. <result column="uId" property="uId"/>
  19. <result column="cTime" property="cTime"/>
  20. <result column="uTime" property="uTime"/>
  21. <result column="uuid" property="uuid"/>
  22. <result column="version" property="version"/>
  23. <result column="remark" property="remark"/>
  24. <result column="provinceId" property="provinceId"/>
  25. <result column="cityId" property="cityId"/>
  26. <result column="grainId" property="grainId"/>
  27. </resultMap>
  28. <sql id="columns">
  29. id ,
  30. `type` ,
  31. subType ,
  32. `name` ,
  33. getTime ,
  34. returnTime ,
  35. model ,
  36. `number` ,
  37. `count` ,
  38. getUser ,
  39. useage ,
  40. houseId ,
  41. cId ,
  42. uId ,
  43. cTime ,
  44. uTime ,
  45. uuid ,
  46. version ,
  47. remark,
  48. provinceId,
  49. cityId,
  50. grainId
  51. </sql>
  52. <sql id="joinCols">
  53. </sql>
  54. <select id="get" resultMap="baseMap">
  55. SELECT
  56. <include refid="columns"/>
  57. FROM dm_device_get a
  58. <include refid="joinCols"/>
  59. WHERE a.id = #{id}
  60. </select>
  61. <select id="findList" resultMap="baseMap">
  62. SELECT
  63. <include refid="columns"/>
  64. FROM dm_device_get a
  65. <include refid="joinCols"/>
  66. <where>
  67. <if test="id !=null">
  68. and id = #{id}
  69. </if>
  70. <if test="type !=null">
  71. and `type` = #{type}
  72. </if>
  73. <if test="subType !=null">
  74. and subType = #{subType}
  75. </if>
  76. <if test="name !=null">
  77. and `name` like CONCAT('%',#{name},'%')
  78. </if>
  79. <if test="getTime !=null">
  80. and getTime = #{getTime}
  81. </if>
  82. <if test="returnTime !=null">
  83. and returnTime = #{returnTime}
  84. </if>
  85. <if test="model !=null">
  86. and model = #{model}
  87. </if>
  88. <if test="number !=null">
  89. and `number` = #{number}
  90. </if>
  91. <if test="count !=null">
  92. and `count` = #{count}
  93. </if>
  94. <if test="getUser !=null">
  95. and getUser = #{getUser}
  96. </if>
  97. <if test="useage !=null">
  98. and useage = #{useage}
  99. </if>
  100. <if test="houseId !=null">
  101. and houseId = #{houseId}
  102. </if>
  103. <if test="cId !=null">
  104. and cId = #{cId}
  105. </if>
  106. <if test="uId !=null">
  107. and uId = #{uId}
  108. </if>
  109. <if test="cTime !=null">
  110. and cTime = #{cTime}
  111. </if>
  112. <if test="uTime !=null">
  113. and uTime = #{uTime}
  114. </if>
  115. <if test="uuid !=null">
  116. and uuid = #{uuid}
  117. </if>
  118. <if test="version !=null">
  119. and version = #{version}
  120. </if>
  121. <if test="remark !=null">
  122. and remark = #{remark}
  123. </if>
  124. <if test="provinceId !=null">
  125. and provinceId = #{provinceId}
  126. </if>
  127. <if test="cityId !=null">
  128. and cityId = #{cityId}
  129. </if>
  130. <if test="grainId !=null">
  131. and grainId = #{grainId}
  132. </if>
  133. </where>
  134. <choose>
  135. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  136. ORDER BY ${page.orderBy}
  137. </when>
  138. <otherwise>
  139. </otherwise>
  140. </choose>
  141. </select>
  142. <select id="findAllList" resultMap="baseMap">
  143. SELECT
  144. <include refid="columns"/>
  145. FROM dm_device_get a
  146. <include refid="joinCols"/>
  147. <where>
  148. <if test="id !=null">
  149. and id = #{id}
  150. </if>
  151. <if test="type !=null">
  152. and `type` = #{type}
  153. </if>
  154. <if test="subType !=null">
  155. and subType = #{subType}
  156. </if>
  157. <if test="name !=null">
  158. and `name` = #{name}
  159. </if>
  160. <if test="getTime !=null">
  161. and getTime = #{getTime}
  162. </if>
  163. <if test="returnTime !=null">
  164. and returnTime = #{returnTime}
  165. </if>
  166. <if test="model !=null">
  167. and model = #{model}
  168. </if>
  169. <if test="number !=null">
  170. and `number` = #{number}
  171. </if>
  172. <if test="count !=null">
  173. and `count` = #{count}
  174. </if>
  175. <if test="getUser !=null">
  176. and getUser = #{getUser}
  177. </if>
  178. <if test="useage !=null">
  179. and useage = #{useage}
  180. </if>
  181. <if test="houseId !=null">
  182. and houseId = #{houseId}
  183. </if>
  184. <if test="cId !=null">
  185. and cId = #{cId}
  186. </if>
  187. <if test="uId !=null">
  188. and uId = #{uId}
  189. </if>
  190. <if test="cTime !=null">
  191. and cTime = #{cTime}
  192. </if>
  193. <if test="uTime !=null">
  194. and uTime = #{uTime}
  195. </if>
  196. <if test="uuid !=null">
  197. and uuid = #{uuid}
  198. </if>
  199. <if test="version !=null">
  200. and version = #{version}
  201. </if>
  202. <if test="remark !=null">
  203. and remark = #{remark}
  204. </if>
  205. <if test="provinceId !=null">
  206. and provinceId = #{provinceId}
  207. </if>
  208. <if test="cityId !=null">
  209. and cityId = #{cityId}
  210. </if>
  211. <if test="grainId !=null">
  212. and grainId = #{grainId}
  213. </if>
  214. </where>
  215. <choose>
  216. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  217. ORDER BY ${page.orderBy}
  218. </when>
  219. <otherwise>
  220. </otherwise>
  221. </choose>
  222. </select>
  223. <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
  224. parameterType="cn.ourwill.module.house.entity.dm.DeviceGet">
  225. INSERT INTO dm_device_get
  226. <trim prefix="(" suffix=")" suffixOverrides=",">
  227. <if test=" id != null">
  228. id,
  229. </if>
  230. <if test=" type != null">
  231. `type`,
  232. </if>
  233. <if test=" subType != null">
  234. subType,
  235. </if>
  236. <if test=" name != null">
  237. `name`,
  238. </if>
  239. <if test=" getTime != null">
  240. getTime,
  241. </if>
  242. <if test=" returnTime != null">
  243. returnTime,
  244. </if>
  245. <if test=" model != null">
  246. model,
  247. </if>
  248. <if test=" number != null">
  249. `number`,
  250. </if>
  251. <if test=" count != null">
  252. `count`,
  253. </if>
  254. <if test=" getUser != null">
  255. getUser,
  256. </if>
  257. <if test=" useage != null">
  258. useage,
  259. </if>
  260. <if test=" houseId != null">
  261. houseId,
  262. </if>
  263. <if test=" cId != null">
  264. cId,
  265. </if>
  266. <if test=" uId != null">
  267. uId,
  268. </if>
  269. <if test=" cTime != null">
  270. cTime,
  271. </if>
  272. <if test=" uTime != null">
  273. uTime,
  274. </if>
  275. <if test=" uuid != null">
  276. uuid,
  277. </if>
  278. <if test=" version != null">
  279. version,
  280. </if>
  281. <if test=" remark != null">
  282. remark,
  283. </if>
  284. <if test="provinceId !=null">
  285. provinceId,
  286. </if>
  287. <if test="cityId !=null">
  288. cityId,
  289. </if>
  290. <if test="grainId !=null">
  291. grainId
  292. </if>
  293. </trim>
  294. <trim prefix="values (" suffix=")" suffixOverrides=",">
  295. <if test=" id != null">
  296. #{id}, </if>
  297. <if test=" type != null">
  298. #{type}, </if>
  299. <if test=" subType != null">
  300. #{subType}, </if>
  301. <if test=" name != null">
  302. #{name}, </if>
  303. <if test=" getTime != null">
  304. #{getTime}, </if>
  305. <if test=" returnTime != null">
  306. #{returnTime}, </if>
  307. <if test=" model != null">
  308. #{model}, </if>
  309. <if test=" number != null">
  310. #{number}, </if>
  311. <if test=" count != null">
  312. #{count}, </if>
  313. <if test=" getUser != null">
  314. #{getUser}, </if>
  315. <if test=" useage != null">
  316. #{useage}, </if>
  317. <if test=" houseId != null">
  318. #{houseId}, </if>
  319. <if test=" cId != null">
  320. #{cId}, </if>
  321. <if test=" uId != null">
  322. #{uId}, </if>
  323. <if test=" cTime != null">
  324. #{cTime}, </if>
  325. <if test=" uTime != null">
  326. #{uTime}, </if>
  327. <if test=" uuid != null">
  328. #{uuid}, </if>
  329. <if test=" version != null">
  330. #{version}, </if>
  331. <if test=" remark != null">
  332. #{remark}, </if>
  333. <if test=" provinceId != null">
  334. #{provinceId}, </if>
  335. <if test=" cityId != null">
  336. #{cityId}, </if>
  337. <if test=" grainId != null">
  338. #{grainId} </if>
  339. </trim>
  340. </insert>
  341. <update id="update" parameterType="cn.ourwill.module.house.entity.dm.DeviceGet">
  342. UPDATE dm_device_get <set>
  343. <if test="id != null">
  344. id= #{id} ,
  345. </if>
  346. <if test="type != null">
  347. `type`= #{type} ,
  348. </if>
  349. <if test="subType != null">
  350. subType= #{subType} ,
  351. </if>
  352. <if test="name != null">
  353. `name`= #{name} ,
  354. </if>
  355. <if test="getTime != null">
  356. getTime= #{getTime} ,
  357. </if>
  358. <if test="returnTime != null">
  359. returnTime= #{returnTime} ,
  360. </if>
  361. <if test="model != null">
  362. model= #{model} ,
  363. </if>
  364. <if test="number != null">
  365. `number`= #{number} ,
  366. </if>
  367. <if test="count != null">
  368. `count`= #{count} ,
  369. </if>
  370. <if test="getUser != null">
  371. getUser= #{getUser} ,
  372. </if>
  373. <if test="useage != null">
  374. useage= #{useage} ,
  375. </if>
  376. <if test="houseId != null">
  377. houseId= #{houseId} ,
  378. </if>
  379. <if test="cId != null">
  380. cId= #{cId} ,
  381. </if>
  382. <if test="uId != null">
  383. uId= #{uId} ,
  384. </if>
  385. <if test="cTime != null">
  386. cTime= #{cTime} ,
  387. </if>
  388. <if test="uTime != null">
  389. uTime= #{uTime} ,
  390. </if>
  391. <if test="uuid != null">
  392. uuid= #{uuid} ,
  393. </if>
  394. <if test="version != null">
  395. version= #{version} ,
  396. </if>
  397. <if test="remark != null">
  398. remark= #{remark},
  399. </if>
  400. <if test="provinceId != null">
  401. provinceId= #{provinceId},
  402. </if>
  403. <if test="cityId != null">
  404. cityId= #{cityId},
  405. </if>
  406. <if test="grainId != null">
  407. grainId= #{grainId}
  408. </if>
  409. </set>
  410. WHERE id = #{id}
  411. </update>
  412. <delete id="deleteById" parameterType="java.lang.Long">
  413. DELETE FROM dm_device_get WHERE id = #{id}
  414. </delete>
  415. <delete id="deleteByIds" parameterType="java.util.List">
  416. DELETE FROM dm_device_get WHERE id IN
  417. <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
  418. #{item}
  419. </foreach>
  420. </delete>
  421. </mapper>