DailyRecordSupercheckFileDao.xml 16 KB

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