DailyRecordHouseCheckNewFileDao.xml 12 KB

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