RecordDeviceBackDao.xml 13 KB

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