DailyRecordHouseCheckNewDao.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  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.DailyRecordHouseCheckNewDao" >
  4. <resultMap id="BaseResultMap" type="cn.ourwill.module.house.entity.daily.DailyRecordHouseCheckNew" >
  5. <id column="id" property="id"/>
  6. <result column="grain_id" property="grainId"/>
  7. <result column="house_id" property="houseId"/>
  8. <result column="location" property="location"/>
  9. <result column="house_type" property="houseType"/>
  10. <result column="type" property="type"/>
  11. <result column="number" property="number"/>
  12. <result column="prod_year" property="prodYear"/>
  13. <result column="in_time" property="inTime"/>
  14. <result column="level" property="level"/>
  15. <result column="water" property="water"/>
  16. <result column="impurity" property="impurity"/>
  17. <result column="lay_type" property="layType"/>
  18. <result column="temperature_max" property="temperatureMax"/>
  19. <result column="temperature_min" property="temperatureMin"/>
  20. <result column="temperature_avg" property="temperatureAvg"/>
  21. <result column="is_density" property="isDensity"/>
  22. <result column="is_hot" property="isHot"/>
  23. <result column="is_condensation" property="isCondensation"/>
  24. <result column="location_length" property="locationLength"/>
  25. <result column="location_widtn" property="locationWidtn"/>
  26. <result column="location_height" property="locationHeight"/>
  27. <result column="is_check" property="isCheck"/>
  28. <result column="is_warm" property="isWarm"/>
  29. <result column="is_lay" property="isLay"/>
  30. <result column="remark" property="remark"/>
  31. <result column="checker" property="checker"/>
  32. <result column="check_date" property="checkDate"/>
  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, 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,check_date,charge, uuid, c_id, c_time, u_id, u_time
  47. </sql>
  48. <select id="findList" resultMap="BaseResultMap">
  49. select
  50. a.*
  51. from daily_record_house_check_new a
  52. left join sys_grain sg on a.grain_id = sg.id
  53. <include refid="joinCols"/>
  54. <where>
  55. <if test="grainId !=null and grainId !=''" >
  56. and grain_id = #{grainId}
  57. </if>
  58. <!--<if test="grainList !=null" >
  59. and grain_id in
  60. <foreach item="item" index="index" collection="grainList" open="(" separator="," close=")">
  61. #{item}
  62. </foreach>
  63. </if>-->
  64. <if test="houseId !=null and houseId !=''">
  65. and house_id = #{houseId}
  66. </if>
  67. <if test="houseType !=null and houseType !=''">
  68. and house_type = #{houseType}
  69. </if>
  70. <if test="type !=null and type !=''">
  71. and type = #{type}
  72. </if>
  73. <if test="checkDate !=null and checkDate !=''">
  74. and check_date = #{checkDate}
  75. </if>
  76. </where>
  77. order by check_date desc
  78. <!-- <choose>
  79. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  80. ORDER BY ${page.orderBy}
  81. </when>
  82. <otherwise>
  83. </otherwise>
  84. </choose>-->
  85. </select>
  86. <select id="get" resultMap="BaseResultMap">
  87. select
  88. <include refid="Base_Column_List" />
  89. from daily_record_house_check_new
  90. where id = #{id}
  91. </select>
  92. <delete id="deleteById" parameterType="java.lang.Long" >
  93. delete from daily_record_house_check_new
  94. where id = #{id}
  95. </delete>
  96. <insert id="insert" parameterType="cn.ourwill.module.house.entity.daily.DailyRecordHouseCheckNew" >
  97. insert into daily_record_house_check_new
  98. <trim prefix="(" suffix=")" suffixOverrides="," >
  99. <if test="id != null" >
  100. id,
  101. </if>
  102. <if test="grainId != null" >
  103. grain_id,
  104. </if>
  105. <if test="houseId != null" >
  106. house_id,
  107. </if>
  108. <if test="location != null" >
  109. location,
  110. </if>
  111. <if test="houseType != null" >
  112. house_type,
  113. </if>
  114. <if test="type != null" >
  115. type,
  116. </if>
  117. <if test="number != null" >
  118. number,
  119. </if>
  120. <if test="prodYear != null" >
  121. prod_year,
  122. </if>
  123. <if test="inTime != null" >
  124. in_time,
  125. </if>
  126. <if test="level != null" >
  127. level,
  128. </if>
  129. <if test="water != null" >
  130. water,
  131. </if>
  132. <if test="impurity != null" >
  133. impurity,
  134. </if>
  135. <if test="layType != null" >
  136. lay_type,
  137. </if>
  138. <if test="temperatureMax != null" >
  139. temperature_max,
  140. </if>
  141. <if test="temperatureMin != null" >
  142. temperature_min,
  143. </if>
  144. <if test="temperatureAvg != null" >
  145. temperature_avg,
  146. </if>
  147. <if test="isDensity != null" >
  148. is_density,
  149. </if>
  150. <if test="isHot != null" >
  151. is_hot,
  152. </if>
  153. <if test="isCondensation != null" >
  154. is_condensation,
  155. </if>
  156. <if test="locationLength != null" >
  157. location_length,
  158. </if>
  159. <if test="locationWidtn != null" >
  160. location_widtn,
  161. </if>
  162. <if test="locationHeight != null" >
  163. location_height,
  164. </if>
  165. <if test="isCheck != null" >
  166. is_check,
  167. </if>
  168. <if test="isWarm != null" >
  169. is_warm,
  170. </if>
  171. <if test="isLay != null" >
  172. is_lay,
  173. </if>
  174. <if test="remark != null" >
  175. remark,
  176. </if>
  177. <if test="checker != null" >
  178. checker,
  179. </if>
  180. <if test="checkDate != null" >
  181. check_date,
  182. </if>
  183. <if test="charge != null" >
  184. charge,
  185. </if>
  186. <if test="uuid != null" >
  187. uuid,
  188. </if>
  189. <if test="cId != null" >
  190. c_id,
  191. </if>
  192. <if test="cTime != null" >
  193. c_time,
  194. </if>
  195. <if test="uId != null" >
  196. u_id,
  197. </if>
  198. <if test="uTime != null" >
  199. u_time,
  200. </if>
  201. </trim>
  202. <trim prefix="values (" suffix=")" suffixOverrides="," >
  203. <if test="id != null" >
  204. #{id},
  205. </if>
  206. <if test="grainId != null" >
  207. #{grainId},
  208. </if>
  209. <if test="houseId != null" >
  210. #{houseId},
  211. </if>
  212. <if test="location != null" >
  213. #{location},
  214. </if>
  215. <if test="houseType != null" >
  216. #{houseType},
  217. </if>
  218. <if test="type != null" >
  219. #{type},
  220. </if>
  221. <if test="number != null" >
  222. #{number},
  223. </if>
  224. <if test="prodYear != null" >
  225. #{prodYear},
  226. </if>
  227. <if test="inTime != null" >
  228. #{inTime},
  229. </if>
  230. <if test="level != null" >
  231. #{level},
  232. </if>
  233. <if test="water != null" >
  234. #{water},
  235. </if>
  236. <if test="impurity != null" >
  237. #{impurity},
  238. </if>
  239. <if test="layType != null" >
  240. #{layType},
  241. </if>
  242. <if test="temperatureMax != null" >
  243. #{temperatureMax},
  244. </if>
  245. <if test="temperatureMin != null" >
  246. #{temperatureMin},
  247. </if>
  248. <if test="temperatureAvg != null" >
  249. #{temperatureAvg},
  250. </if>
  251. <if test="isDensity != null" >
  252. #{isDensity},
  253. </if>
  254. <if test="isHot != null" >
  255. #{isHot},
  256. </if>
  257. <if test="isCondensation != null" >
  258. #{isCondensation},
  259. </if>
  260. <if test="locationLength != null" >
  261. #{locationLength},
  262. </if>
  263. <if test="locationWidtn != null" >
  264. #{locationWidtn},
  265. </if>
  266. <if test="locationHeight != null" >
  267. #{locationHeight},
  268. </if>
  269. <if test="isCheck != null" >
  270. #{isCheck},
  271. </if>
  272. <if test="isWarm != null" >
  273. #{isWarm},
  274. </if>
  275. <if test="isLay != null" >
  276. #{isLay},
  277. </if>
  278. <if test="remark != null" >
  279. #{remark},
  280. </if>
  281. <if test="checker != null" >
  282. #{checker},
  283. </if>
  284. <if test="checkDate != null" >
  285. #{checkDate},
  286. </if>
  287. <if test="charge != null" >
  288. #{charge},
  289. </if>
  290. <if test="uuid != null" >
  291. #{uuid},
  292. </if>
  293. <if test="cId != null" >
  294. #{cId},
  295. </if>
  296. <if test="cTime != null" >
  297. #{cTime},
  298. </if>
  299. <if test="uId != null" >
  300. #{uId},
  301. </if>
  302. <if test="uTime != null" >
  303. #{uTime},
  304. </if>
  305. </trim>
  306. </insert>
  307. <update id="update" parameterType="cn.ourwill.module.house.entity.daily.DailyRecordHouseCheckNew" >
  308. update daily_record_house_check_new
  309. <set >
  310. <if test="grainId != null" >
  311. grain_id = #{grainId},
  312. </if>
  313. <if test="houseId != null" >
  314. house_id = #{houseId},
  315. </if>
  316. <if test="location != null" >
  317. location = #{location},
  318. </if>
  319. <if test="houseType != null" >
  320. house_type = #{houseType},
  321. </if>
  322. <if test="type != null" >
  323. type = #{type},
  324. </if>
  325. <if test="number != null" >
  326. number = #{number},
  327. </if>
  328. <if test="prodYear != null" >
  329. prod_year = #{prodYear},
  330. </if>
  331. <if test="inTime != null" >
  332. in_time = #{inTime},
  333. </if>
  334. <if test="level != null" >
  335. level = #{level},
  336. </if>
  337. <if test="water != null" >
  338. water = #{water},
  339. </if>
  340. <if test="impurity != null" >
  341. impurity = #{impurity},
  342. </if>
  343. <if test="layType != null" >
  344. lay_type = #{layType},
  345. </if>
  346. <if test="temperatureMax != null" >
  347. temperature_max = #{temperatureMax},
  348. </if>
  349. <if test="temperatureMin != null" >
  350. temperature_min = #{temperatureMin},
  351. </if>
  352. <if test="temperatureAvg != null" >
  353. temperature_avg = #{temperatureAvg},
  354. </if>
  355. <if test="isDensity != null" >
  356. is_density = #{isDensity},
  357. </if>
  358. <if test="isHot != null" >
  359. is_hot = #{isHot},
  360. </if>
  361. <if test="isCondensation != null" >
  362. is_condensation = #{isCondensation},
  363. </if>
  364. <if test="locationLength != null" >
  365. location_length = #{locationLength},
  366. </if>
  367. <if test="locationWidtn != null" >
  368. location_widtn = #{locationWidtn},
  369. </if>
  370. <if test="locationHeight != null" >
  371. location_height = #{locationHeight},
  372. </if>
  373. <if test="isCheck != null" >
  374. is_check = #{isCheck},
  375. </if>
  376. <if test="isWarm != null" >
  377. is_warm = #{isWarm},
  378. </if>
  379. <if test="isLay != null" >
  380. is_lay = #{isLay},
  381. </if>
  382. <if test="remark != null" >
  383. remark = #{remark},
  384. </if>
  385. <if test="checker != null" >
  386. checker = #{checker},
  387. </if>
  388. <if test="checkDate != null" >
  389. check_date = #{checkDate},
  390. </if>
  391. <if test="charge != null" >
  392. charge = #{charge},
  393. </if>
  394. <if test="uuid != null" >
  395. uuid = #{uuid},
  396. </if>
  397. <if test="cId != null" >
  398. c_id = #{cId},
  399. </if>
  400. <if test="cTime != null" >
  401. c_time = #{cTime},
  402. </if>
  403. <if test="uId != null" >
  404. u_id = #{uId},
  405. </if>
  406. <if test="uTime != null" >
  407. u_time = #{uTime},
  408. </if>
  409. </set>
  410. where id = #{id}
  411. </update>
  412. <update id="updateByUUID" parameterType="cn.ourwill.module.house.entity.daily.DailyRecordHouseCheckNew" >
  413. update daily_record_house_check_new
  414. <set >
  415. <if test="grainId != null" >
  416. grain_id = #{grainId},
  417. </if>
  418. <if test="houseId != null" >
  419. house_id = #{houseId},
  420. </if>
  421. <if test="location != null" >
  422. location = #{location},
  423. </if>
  424. <if test="houseType != null" >
  425. house_type = #{houseType},
  426. </if>
  427. <if test="type != null" >
  428. type = #{type},
  429. </if>
  430. <if test="number != null" >
  431. number = #{number},
  432. </if>
  433. <if test="prodYear != null" >
  434. prod_year = #{prodYear},
  435. </if>
  436. <if test="inTime != null" >
  437. in_time = #{inTime},
  438. </if>
  439. <if test="level != null" >
  440. level = #{level},
  441. </if>
  442. <if test="water != null" >
  443. water = #{water},
  444. </if>
  445. <if test="impurity != null" >
  446. impurity = #{impurity},
  447. </if>
  448. <if test="layType != null" >
  449. lay_type = #{layType},
  450. </if>
  451. <if test="temperatureMax != null" >
  452. temperature_max = #{temperatureMax},
  453. </if>
  454. <if test="temperatureMin != null" >
  455. temperature_min = #{temperatureMin},
  456. </if>
  457. <if test="temperatureAvg != null" >
  458. temperature_avg = #{temperatureAvg},
  459. </if>
  460. <if test="isDensity != null" >
  461. is_density = #{isDensity},
  462. </if>
  463. <if test="isHot != null" >
  464. is_hot = #{isHot},
  465. </if>
  466. <if test="isCondensation != null" >
  467. is_condensation = #{isCondensation},
  468. </if>
  469. <if test="locationLength != null" >
  470. location_length = #{locationLength},
  471. </if>
  472. <if test="locationWidtn != null" >
  473. location_widtn = #{locationWidtn},
  474. </if>
  475. <if test="locationHeight != null" >
  476. location_height = #{locationHeight},
  477. </if>
  478. <if test="isCheck != null" >
  479. is_check = #{isCheck},
  480. </if>
  481. <if test="isWarm != null" >
  482. is_warm = #{isWarm},
  483. </if>
  484. <if test="isLay != null" >
  485. is_lay = #{isLay},
  486. </if>
  487. <if test="remark != null" >
  488. remark = #{remark},
  489. </if>
  490. <if test="checker != null" >
  491. checker = #{checker},
  492. </if>
  493. <if test="checkDate != null" >
  494. check_date = #{checkDate},
  495. </if>
  496. <if test="charge != null" >
  497. charge = #{charge},
  498. </if>
  499. <if test="uuid != null" >
  500. uuid = #{uuid},
  501. </if>
  502. <if test="cId != null" >
  503. c_id = #{cId},
  504. </if>
  505. <if test="cTime != null" >
  506. c_time = #{cTime},
  507. </if>
  508. <if test="uId != null" >
  509. u_id = #{uId},
  510. </if>
  511. <if test="uTime != null" >
  512. u_time = #{uTime},
  513. </if>
  514. </set>
  515. where uuid = #{uuid}
  516. </update>
  517. <select id="findByHouseId" resultMap="BaseResultMap">
  518. SELECT *
  519. FROM daily_record_house_check_new a
  520. where house_id=#{houseId}
  521. <if test="cTime != null">
  522. AND c_time <![CDATA[ <= ]]> #{cTime}
  523. </if>
  524. </select>
  525. <select id="getByUuid" resultMap="BaseResultMap">
  526. SELECT *
  527. FROM daily_record_house_check_new a
  528. where uuid=#{uuid}
  529. </select>
  530. <delete id="deleteByHouseId" parameterType="java.lang.Long" >
  531. delete from daily_record_house_check_new
  532. where house_id=#{houseId}
  533. </delete>
  534. </mapper>