DailyRecordLsjiagongDao.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  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.DailyRecordLsjiagongDao">
  4. <resultMap type="cn.ourwill.module.house.entity.daily.DailyRecordLsjiagong" id="baseMap">
  5. <result column="id" property="id"/>
  6. <result column="uuid" property="uuid"/>
  7. <result column="jcTime" property="jcTime"/>
  8. <result column="smj" property="smj"/>
  9. <result column="cdb" property="cdb"/>
  10. <result column="hlm" property="hlm"/>
  11. <result column="mtTime" property="mtTime"/>
  12. <result column="sml" property="sml"/>
  13. <result column="zjml" property="zjml"/>
  14. <result column="hyl" property="hyl"/>
  15. <result column="otms" property="otms"/>
  16. <result column="mbl" property="mbl"/>
  17. <result column="rxsl" property="rxsl"/>
  18. <result column="bz" property="bz"/>
  19. <result column="classes" property="classes"/>
  20. <result column="htype" property="htype"/>
  21. <result column="house_id" property="houseId"/>
  22. </resultMap>
  23. <sql id="columns">
  24. id ,
  25. uuid ,
  26. jcTime,
  27. smj,
  28. cdb,
  29. hlm,
  30. mtTime,
  31. sml,
  32. zjml,
  33. hyl,
  34. otms,
  35. mbl,
  36. rxsl,
  37. bz ,
  38. `classes` ,
  39. htype ,
  40. house_id
  41. </sql>
  42. <sql id="joinCols">
  43. </sql>
  44. <select id="get" resultMap="baseMap">
  45. SELECT
  46. <include refid="columns"/>
  47. FROM daily_record_lsjiagong a
  48. <include refid="joinCols"/>
  49. WHERE a.id = #{id}
  50. </select>
  51. <select id="getByUuid" resultMap="baseMap">
  52. SELECT
  53. <include refid="columns"/>
  54. FROM daily_record_lsjiagong a
  55. <include refid="joinCols"/>
  56. WHERE a.uuid = #{uuid}
  57. </select>
  58. <select id="findList" resultMap="baseMap">
  59. SELECT
  60. <include refid="columns"/>
  61. FROM daily_record_lsjiagong a
  62. <include refid="joinCols"/>
  63. <where>
  64. <if test="id !=null">
  65. and id = #{id}
  66. </if>
  67. <!--<if test="type !=null">
  68. and type = #{type}
  69. &lt;!&ndash;dash;&gt;<if test="type ==1 ">
  70. and ( houseId is not null and houseId != '' )
  71. </if>
  72. <if test="type ==2 ">
  73. and `type`=#{type}
  74. </if>
  75. <&ndash;&gt;
  76. </if>-->
  77. <if test="searchStartDate !=null">
  78. and jcTime <![CDATA[ >= ]]> #{searchStartDate}
  79. </if>
  80. <if test="searchEndDate !=null">
  81. and jcTime &lt;= #{searchEndDate}
  82. </if>
  83. <if test="uuid !=null">
  84. and uuid = #{uuid}
  85. </if>
  86. <if test="houseId !=null">
  87. and house_id = #{houseId}
  88. </if>
  89. <if test="classes !=null">
  90. and `classes` = #{classes}
  91. </if>
  92. <if test="htype !=null">
  93. and htype = #{htype}
  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. order by id desc
  102. </otherwise>
  103. </choose>
  104. </select>
  105. <select id="findAllList" resultMap="baseMap">
  106. SELECT
  107. <include refid="columns"/>
  108. FROM daily_record_supercheck a
  109. <include refid="joinCols"/>
  110. <where>
  111. <if test="id !=null">
  112. and id = #{id}
  113. </if>
  114. <if test="type !=null">
  115. <if test="type ==1 ">
  116. and ( houseId is not null and houseId != '' )
  117. </if>
  118. </if>
  119. <if test="searchStartDate !=null">
  120. and check_time <![CDATA[ >= ]]> #{searchStartDate}
  121. </if>
  122. <if test="searchEndDate !=null">
  123. and check_time &lt;= #{searchEndDate}
  124. </if>
  125. <if test="uuid !=null">
  126. and uuid = #{uuid}
  127. </if>
  128. <if test="checker !=null">
  129. and checker = #{checker}
  130. </if>
  131. <if test="checkTime !=null">
  132. and check_time = #{checkTime}
  133. </if>
  134. <if test="checkDesc !=null">
  135. and check_desc = #{checkDesc}
  136. </if>
  137. <if test="problems !=null">
  138. and problems = #{problems}
  139. </if>
  140. <if test="advices !=null">
  141. and advices = #{advices}
  142. </if>
  143. <if test="remarks !=null">
  144. and remarks = #{remarks}
  145. </if>
  146. <if test="capacity !=null">
  147. and capacity = #{capacity}
  148. </if>
  149. <if test="wheat !=null">
  150. and wheat = #{wheat}
  151. </if>
  152. <if test="rice !=null">
  153. and rice = #{rice}
  154. </if>
  155. <if test="corn !=null">
  156. and corn = #{corn}
  157. </if>
  158. <if test="bean !=null">
  159. and bean = #{bean}
  160. </if>
  161. <if test="houseId !=null">
  162. and houseId = #{houseId}
  163. </if>
  164. <if test="version !=null">
  165. and version = #{version}
  166. </if>
  167. <if test="audit !=null">
  168. and audit = #{audit}
  169. </if>
  170. <if test="otherType !=null">
  171. and other_type = #{otherType}
  172. </if>
  173. <if test="otherHouse !=null">
  174. and other_house = #{otherHouse}
  175. </if>
  176. <if test="problemRadio !=null">
  177. and problem_radio = #{problemRadio}
  178. </if>
  179. </where>
  180. <choose>
  181. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  182. ORDER BY ${page.orderBy}
  183. </when>
  184. <otherwise>
  185. order by id desc
  186. </otherwise>
  187. </choose>
  188. </select>
  189. <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
  190. parameterType="cn.ourwill.module.house.entity.daily.DailyRecordLsjiagong">
  191. INSERT INTO daily_record_lsjiagong
  192. <trim prefix="(" suffix=")" suffixOverrides=",">
  193. <if test=" id != null">
  194. id,
  195. </if>
  196. <if test=" uuid != null">
  197. uuid,
  198. </if>
  199. <if test=" jcTime != null">
  200. jcTime,
  201. </if>
  202. <if test=" smj != null">
  203. smj,
  204. </if>
  205. <if test=" cdb != null">
  206. cdb,
  207. </if>
  208. <if test=" hlm != null">
  209. hlm,
  210. </if>
  211. <if test=" mtTime != null and mtTime!='' ">
  212. mtTime,
  213. </if>
  214. <if test=" sml != null">
  215. sml,
  216. </if>
  217. <if test=" zjml != null">
  218. zjml,
  219. </if>
  220. <if test=" hyl != null">
  221. hyl,
  222. </if>
  223. <if test=" otms != null">
  224. otms,
  225. </if>
  226. <if test=" mbl != null">
  227. mbl,
  228. </if>
  229. <if test=" rxsl != null">
  230. rxsl,
  231. </if>
  232. <if test=" bz != null">
  233. bz,
  234. </if>
  235. <if test=" classes != null">
  236. classes,
  237. </if>
  238. <if test=" htype != null">
  239. htype,
  240. </if>
  241. <if test=" houseId != null">
  242. house_id
  243. </if>
  244. </trim>
  245. <trim prefix="values (" suffix=")" suffixOverrides=",">
  246. <if test=" id != null">
  247. #{id}, </if>
  248. <if test=" uuid != null">
  249. #{uuid}, </if>
  250. <if test=" jcTime != null">
  251. #{jcTime},
  252. </if>
  253. <if test=" smj != null">
  254. #{smj},
  255. </if>
  256. <if test=" cdb != null">
  257. #{cdb},
  258. </if>
  259. <if test=" hlm != null">
  260. #{hlm},
  261. </if>
  262. <if test=" mtTime != null and mtTime!='' ">
  263. #{mtTime},
  264. </if>
  265. <if test=" sml != null">
  266. #{sml},
  267. </if>
  268. <if test=" zjml != null">
  269. #{zjml},
  270. </if>
  271. <if test=" hyl != null">
  272. #{hyl},
  273. </if>
  274. <if test=" otms != null">
  275. #{otms},
  276. </if>
  277. <if test=" mbl != null">
  278. #{mbl},
  279. </if>
  280. <if test=" rxsl != null">
  281. #{rxsl},
  282. </if>
  283. <if test=" bz != null">
  284. #{bz},
  285. </if>
  286. <if test=" classes != null">
  287. #{classes}, </if>
  288. <if test=" htype != null">
  289. #{htype}, </if>
  290. <if test=" houseId != null">
  291. #{houseId} </if>
  292. </trim>
  293. </insert>
  294. <update id="update" parameterType="cn.ourwill.module.house.entity.daily.DailyRecordLsjiagong">
  295. UPDATE daily_record_lsjiagong <set>
  296. <if test="id != null">
  297. id= #{id} ,
  298. </if>
  299. <if test="uuid != null">
  300. uuid= #{uuid} ,
  301. </if>
  302. <if test=" jcTime != null">
  303. jcTime=#{jcTime},
  304. </if>
  305. <if test=" smj != null">
  306. smj=#{smj},
  307. </if>
  308. <if test=" cdb != null">
  309. cdb=#{cdb},
  310. </if>
  311. <if test=" hlm != null">
  312. hlm =#{hlm},
  313. </if>
  314. <if test=" mtTime != null and mtTime !='' " >
  315. mtTime=#{mtTime},
  316. </if>
  317. <if test=" sml != null">
  318. sml=#{sml},
  319. </if>
  320. <if test=" zjml != null">
  321. zjml=#{zjml},
  322. </if>
  323. <if test=" hyl != null">
  324. hyl=#{hyl},
  325. </if>
  326. <if test=" otms != null">
  327. otms=#{otms},
  328. </if>
  329. <if test=" mbl != null">
  330. mbl=#{mbl},
  331. </if>
  332. <if test=" rxsl != null">
  333. rxsl=#{rxsl},
  334. </if>
  335. <if test=" bz != null">
  336. bz=#{bz},
  337. </if>
  338. <if test="classes != null">
  339. classes = #{classes},
  340. </if>
  341. <if test="htype != null">
  342. htype= #{htype} ,
  343. </if>
  344. <if test="houseId != null">
  345. house_id= #{houseId}
  346. </if>
  347. </set>
  348. WHERE id = #{id}
  349. </update>
  350. <update id="updateByUuid" parameterType="cn.ourwill.module.house.entity.daily.DailyRecordSupercheck">
  351. UPDATE daily_record_supercheck <set>
  352. <if test="uuid != null">
  353. uuid= #{uuid} ,
  354. </if>
  355. <if test="classes != null">
  356. classes = #{classes},
  357. </if>
  358. <if test="checker != null">
  359. checker= #{checker} ,
  360. </if>
  361. <if test="checkTime != null">
  362. check_time= #{checkTime} ,
  363. </if>
  364. <if test="checkDesc != null">
  365. check_desc= #{checkDesc} ,
  366. </if>
  367. <if test="problems != null">
  368. problems= #{problems} ,
  369. </if>
  370. <if test="advices != null">
  371. advices= #{advices} ,
  372. </if>
  373. <if test="remarks != null">
  374. remarks= #{remarks} ,
  375. </if>
  376. <if test="capacity != null">
  377. capacity= #{capacity} ,
  378. </if>
  379. <if test="wheat != null">
  380. wheat= #{wheat} ,
  381. </if>
  382. <if test="rice != null">
  383. rice= #{rice} ,
  384. </if>
  385. <if test="corn != null">
  386. corn= #{corn} ,
  387. </if>
  388. <if test="bean != null">
  389. bean= #{bean} ,
  390. </if>
  391. <if test="improverPlan != null">
  392. improver_plan= #{improverPlan} ,
  393. </if>
  394. <if test="improverStartPlan != null">
  395. improver_start_plan= #{improverStartPlan} ,
  396. </if>
  397. <if test="improverEndPlan != null">
  398. improver_end_plan= #{improverEndPlan} ,
  399. </if>
  400. <if test="improver != null">
  401. improver= #{improver} ,
  402. </if>
  403. <if test="improveStartTime != null">
  404. improve_start_time= #{improveStartTime} ,
  405. </if>
  406. <if test="improveEndTime != null">
  407. improve_end_time= #{improveEndTime} ,
  408. </if>
  409. <if test="improveWorks != null">
  410. improve_works= #{improveWorks} ,
  411. </if>
  412. <if test="improveResult != null">
  413. improve_result= #{improveResult} ,
  414. </if>
  415. <if test="houseId != null">
  416. houseId= #{houseId} ,
  417. </if>
  418. <if test="audit != null">
  419. audit= #{audit} ,
  420. </if>
  421. <if test="checkerPic != null">
  422. checker_pic= #{checkerPic} ,
  423. </if>
  424. <if test="cId != null">
  425. c_id= #{cId} ,
  426. </if>
  427. <if test="cTime != null">
  428. c_time= #{cTime} ,
  429. </if>
  430. <if test="uId != null">
  431. u_id= #{uId} ,
  432. </if>
  433. <if test="uTime != null">
  434. u_time= #{uTime} ,
  435. </if>
  436. <if test="version != null">
  437. version= #{version} ,
  438. </if>
  439. <if test=" pic != null">
  440. pic= #{pic},
  441. </if>
  442. <if test=" pics != null">
  443. pics= #{pics},
  444. </if>
  445. <if test="otherType !=null">
  446. other_type = #{otherType},
  447. </if>
  448. <if test="otherHouse !=null">
  449. other_house = #{otherHouse}
  450. </if>
  451. <if test="problemRadio !=null">
  452. problem_radio = #{problemRadio}
  453. </if>
  454. </set>
  455. WHERE uuid = #{uuid}
  456. </update>
  457. <delete id="deleteById" parameterType="java.lang.Long">
  458. DELETE FROM daily_record_lsjiagong WHERE id = #{id}
  459. </delete>
  460. <delete id="deleteByIds" parameterType="java.util.List">
  461. DELETE FROM daily_record_supercheck WHERE id IN
  462. <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
  463. #{item}
  464. </foreach>
  465. </delete>
  466. <select id="findByHouseIdNoPage" resultMap="baseMap">
  467. SELECT *
  468. FROM daily_record_lsjiagong a
  469. where house_id=#{houseId}
  470. <if test="cTime != null">
  471. AND jcTime <![CDATA[ <= ]]> #{cTime}
  472. </if>
  473. </select>
  474. <select id="findByHouseIds" resultMap="baseMap">
  475. SELECT *
  476. FROM daily_record_lsjiagong a
  477. where house_id=#{houseId}
  478. </select>
  479. <delete id="deleteLsjiagongByHouseId">
  480. DELETE FROM daily_record_lsjiagong
  481. WHERE house_id = #{houseId}
  482. <if test="cTime != null">
  483. AND jcTime <![CDATA[ <= ]]> #{cTime}
  484. </if>
  485. </delete>
  486. </mapper>