DailyRecordBasicdeviceFileDao.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  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.daily.DailyRecordBasicdeviceFileDao">
  4. <resultMap type="cn.ourwill.module.house.entity.daily.DailyRecordBasicdeviceFile" id="baseMap">
  5. <result column="id" property="id"/>
  6. <result column="file_uuid" property="fileUuid"/>
  7. <result column="name" property="name"/>
  8. <result column="count" property="count"/>
  9. <result column="unit" property="unit"/>
  10. <result column="username" property="username"/>
  11. <result column="remark" property="remark"/>
  12. <result column="change" property="change"/>
  13. <result column="c_time" property="cTime"/>
  14. <result column="c_id" property="cId"/>
  15. <result column="u_time" property="uTime"/>
  16. <result column="u_id" property="uId"/>
  17. <result column="house_id" property="houseId"/>
  18. <result column="get_date" property="getDate"/>
  19. <result column="version" property="version"/>
  20. </resultMap>
  21. <sql id="columns">
  22. id ,
  23. file_uuid,
  24. `name` ,
  25. `count` ,
  26. unit ,
  27. username ,
  28. remark ,
  29. `change` ,
  30. c_time ,
  31. c_id ,
  32. u_time ,
  33. u_id ,
  34. house_id ,
  35. get_date ,
  36. version
  37. </sql>
  38. <sql id="joinCols">
  39. </sql>
  40. <select id="get" resultMap="baseMap">
  41. SELECT
  42. <include refid="columns"/>
  43. FROM daily_record_basicdevice_file a
  44. <include refid="joinCols"/>
  45. WHERE a.id = #{id}
  46. </select>
  47. <select id="findList" resultMap="baseMap">
  48. SELECT
  49. <include refid="columns"/>
  50. FROM daily_record_basicdevice_file a
  51. <include refid="joinCols"/>
  52. <where>
  53. <if test="id !=null">
  54. and id = #{id}
  55. </if>
  56. <if test="name !=null">
  57. and `name` like CONCAT('%',#{name},'%')
  58. </if>
  59. <if test="count !=null">
  60. and `count` = #{count}
  61. </if>
  62. <if test="unit !=null">
  63. and `unit` = #{unit}
  64. </if>
  65. <if test="username !=null">
  66. and username = #{username}
  67. </if>
  68. <if test="remark !=null">
  69. and remark = #{remark}
  70. </if>
  71. <if test="change !=null">
  72. and `change` = #{change}
  73. </if>
  74. <if test="cTime !=null">
  75. and c_time = #{cTime}
  76. </if>
  77. <if test="cId !=null">
  78. and c_id = #{cId}
  79. </if>
  80. <if test="uTime !=null">
  81. and u_time = #{uTime}
  82. </if>
  83. <if test="uId !=null">
  84. and u_id = #{uId}
  85. </if>
  86. <if test="houseId !=null">
  87. and house_id = #{houseId}
  88. </if>
  89. <if test="getDate !=null">
  90. and get_date = #{getDate}
  91. </if>
  92. <if test="version !=null">
  93. and version = #{version}
  94. </if>
  95. </where>
  96. <choose>
  97. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  98. ORDER BY ${page.orderBy}
  99. </when>
  100. <otherwise>
  101. </otherwise>
  102. </choose>
  103. </select>
  104. <select id="findAllList" resultMap="baseMap">
  105. SELECT
  106. <include refid="columns"/>
  107. FROM daily_record_basicdevice_file a
  108. <include refid="joinCols"/>
  109. <where>
  110. <if test="id !=null">
  111. and id = #{id}
  112. </if>
  113. <if test="name !=null">
  114. and `name` like CONCAT('%',#{name},'%')
  115. </if>
  116. <if test="count !=null">
  117. and `count` = #{count}
  118. </if>
  119. <if test="unit !=null">
  120. and unit = #{unit}
  121. </if>
  122. <if test="username !=null">
  123. and username = #{username}
  124. </if>
  125. <if test="remark !=null">
  126. and remark = #{remark}
  127. </if>
  128. <if test="change !=null">
  129. and `change` = #{change}
  130. </if>
  131. <if test="cTime !=null">
  132. and c_time = #{cTime}
  133. </if>
  134. <if test="cId !=null">
  135. and c_id = #{cId}
  136. </if>
  137. <if test="uTime !=null">
  138. and u_time = #{uTime}
  139. </if>
  140. <if test="uId !=null">
  141. and u_id = #{uId}
  142. </if>
  143. <if test="houseId !=null">
  144. and house_id = #{houseId}
  145. </if>
  146. <if test="getDate !=null">
  147. and get_date = #{getDate}
  148. </if>
  149. <if test="version !=null">
  150. and version = #{version}
  151. </if>
  152. </where>
  153. <choose>
  154. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  155. ORDER BY ${page.orderBy}
  156. </when>
  157. <otherwise>
  158. </otherwise>
  159. </choose>
  160. </select>
  161. <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
  162. parameterType="cn.ourwill.module.house.entity.daily.DailyRecordBasicdeviceFile">
  163. INSERT INTO daily_record_basicdevice_file
  164. <trim prefix="(" suffix=")" suffixOverrides=",">
  165. <!--<if test=" id != null">
  166. id,
  167. </if>-->
  168. <if test=" fileUuid != null">
  169. file_uuid,
  170. </if>
  171. <if test=" name != null">
  172. `name`,
  173. </if>
  174. <if test=" count != null">
  175. `count`,
  176. </if>
  177. <if test="unit !=null">
  178. unit,
  179. </if>
  180. <if test=" username != null">
  181. username,
  182. </if>
  183. <if test=" remark != null">
  184. remark,
  185. </if>
  186. <if test=" change != null">
  187. `change`,
  188. </if>
  189. <if test=" cTime != null">
  190. c_time,
  191. </if>
  192. <if test=" cId != null">
  193. c_id,
  194. </if>
  195. <if test=" uTime != null">
  196. u_time,
  197. </if>
  198. <if test=" uId != null">
  199. u_id,
  200. </if>
  201. <if test=" houseId != null">
  202. house_id,
  203. </if>
  204. <if test="getDate !=null">
  205. get_date,
  206. </if>
  207. <if test=" version != null">
  208. version
  209. </if>
  210. </trim>
  211. <trim prefix="values (" suffix=")" suffixOverrides=",">
  212. <!-- <if test=" id != null">
  213. #{id},
  214. </if>-->
  215. <if test=" fileUuid != null">
  216. #{fileUuid},
  217. </if>
  218. <if test=" name != null">
  219. #{name},
  220. </if>
  221. <if test=" count != null">
  222. #{count},
  223. </if>
  224. <if test="unit !=null">
  225. #{unit},
  226. </if>
  227. <if test=" username != null">
  228. #{username},
  229. </if>
  230. <if test=" remark != null">
  231. #{remark},
  232. </if>
  233. <if test=" change != null">
  234. #{change},
  235. </if>
  236. <if test=" cTime != null">
  237. #{cTime},
  238. </if>
  239. <if test=" cId != null">
  240. #{cId},
  241. </if>
  242. <if test=" uTime != null">
  243. #{uTime},
  244. </if>
  245. <if test=" uId != null">
  246. #{uId},
  247. </if>
  248. <if test=" houseId != null">
  249. #{houseId},
  250. </if>
  251. <if test="getDate !=null">
  252. #{getDate},
  253. </if>
  254. <if test=" version != null">
  255. #{version}
  256. </if>
  257. </trim>
  258. </insert>
  259. <update id="update" parameterType="cn.ourwill.module.house.entity.daily.DailyRecordBasicdeviceFile">
  260. UPDATE daily_record_basicdevice_file
  261. <set>
  262. <if test="id != null">
  263. id= #{id} ,
  264. </if>
  265. <if test="name != null">
  266. `name`= #{name} ,
  267. </if>
  268. <if test="count != null">
  269. `count`= #{count} ,
  270. </if>
  271. <if test="unit !=null">
  272. unit = #{unit} ,
  273. </if>
  274. <if test="username != null">
  275. username= #{username} ,
  276. </if>
  277. <if test="remark != null">
  278. remark= #{remark} ,
  279. </if>
  280. <if test="change != null">
  281. `change`= #{change} ,
  282. </if>
  283. <if test="cTime != null">
  284. c_time= #{cTime} ,
  285. </if>
  286. <if test="cId != null">
  287. c_id= #{cId} ,
  288. </if>
  289. <if test="uTime != null">
  290. u_time= #{uTime} ,
  291. </if>
  292. <if test="uId != null">
  293. u_id= #{uId} ,
  294. </if>
  295. <if test="houseId != null">
  296. house_id= #{houseId} ,
  297. </if>
  298. <if test="getDate !=null">
  299. get_date = #{getDate} ,
  300. </if>
  301. <if test="version != null">
  302. version= #{version}
  303. </if>
  304. </set>
  305. WHERE id = #{id}
  306. </update>
  307. <delete id="deleteById" parameterType="java.lang.Long">
  308. DELETE FROM daily_record_basicdevice_file WHERE id = #{id}
  309. </delete>
  310. <delete id="deleteByIds" parameterType="java.util.List">
  311. DELETE FROM daily_record_basicdevice_file WHERE id IN
  312. <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
  313. #{item}
  314. </foreach>
  315. </delete>
  316. <!--<select id="getDailyRecordBasicdeviceFile" resultMap="baseMap">
  317. SELECT
  318. <include refid="columns"/>
  319. FROM daily_record_basicdevice_file a
  320. <include refid="joinCols"/>
  321. <where>
  322. <if test="houseId !=null">
  323. a.house_id = #{houseId}
  324. </if>
  325. <if test="deviceName !=null">
  326. and `name` like CONCAT('%',#{deviceName},'%')
  327. </if>
  328. </where>
  329. </select>
  330. <select id="findByHouseId" resultMap="baseMap">
  331. SELECT *
  332. FROM daily_record_basicdevice_file a
  333. where house_id=#{houseId}
  334. <if test="cTime != null">
  335. AND cTime <![CDATA[ <= ]]> #{cTime}
  336. </if>
  337. </select>-->
  338. </mapper>