DailyRecordFoodbasicinfoFileDao.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  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.DailyRecordFoodbasicinfoFileDao">
  4. <resultMap type="cn.ourwill.module.house.entity.daily.DailyRecordFoodbasicinfoFile" id="baseMap">
  5. <result column="id" property="id"/>
  6. <result column="uuid" property="uuid"/>
  7. <result column="record_unite" property="recordUnite"/>
  8. <result column="keep_unite" property="keepUnite"/>
  9. <result column="location_num" property="locationNum"/>
  10. <result column="quality" property="quality"/>
  11. <result column="type" property="type"/>
  12. <result column="htype" property="htype"/>
  13. <result column="number" property="number"/>
  14. <result column="stand_number" property="standNumber"/>
  15. <result column="input_year" property="inputYear"/>
  16. <result column="output_year" property="outputYear"/>
  17. <result column="grow_year" property="growYear"/>
  18. <result column="keep_method" property="keepMethod"/>
  19. <result column="level" property="level"/>
  20. <result column="weight" property="weight"/>
  21. <result column="impurity" property="impurity"/>
  22. <result column="water" property="water"/>
  23. <result column="unsound" property="unsound"/>
  24. <result column="recorder" property="recorder"/>
  25. <result column="house_type" property="houseType"/>
  26. <result column="design_house_capacity" property="designHouseCapacity"/>
  27. <result column="valid_house_capacity" property="validHouseCapacity"/>
  28. <result column="price" property="price"/>
  29. <result column="place_of_origin" property="placeOfOrigin"/>
  30. <result column="storage_location" property="storageLocation"/>
  31. <result column="disperse_capacity" property="disperseCapacity"/>
  32. <result column="length" property="length"/>
  33. <result column="width" property="width"/>
  34. <result column="height" property="height"/>
  35. <result column="pack_num" property="packNum"/>
  36. <result column="pack_average_weight" property="packAverageWeight"/>
  37. <result column="filling_time" property="fillingTime"/>
  38. <result column="c_id" property="cId"/>
  39. <result column="c_time" property="cTime"/>
  40. <result column="u_id" property="uId"/>
  41. <result column="u_time" property="uTime"/>
  42. <result column="version" property="version"/>
  43. <result column="house_id" property="houseId"/>
  44. <result column="plan_num" property="planNum"/>
  45. <result column="responsible_user" property="responsibleUser"/>
  46. <result column="superior_user" property="superiorUser"/>
  47. <result column="line_height" property="lineHeight"/>
  48. <result column="file_date" property="fileDate"/>
  49. <result column="file_maker_uuid" property="fileMakerUuid"/>
  50. </resultMap>
  51. <sql id="columns">
  52. a.id ,
  53. a.uuid ,
  54. a.record_unite ,
  55. a.keep_unite ,
  56. a.location_num ,
  57. a.quality ,
  58. a.`type` ,
  59. a.htype ,
  60. a.`number` ,
  61. a.stand_number ,
  62. a.input_year ,
  63. a.output_year ,
  64. a.grow_year ,
  65. a.keep_method ,
  66. a.`level` ,
  67. a.weight ,
  68. a.impurity ,
  69. a.water ,
  70. a.unsound ,
  71. a.recorder ,
  72. a.house_type ,
  73. a.design_house_capacity ,
  74. a.valid_house_capacity ,
  75. a.price ,
  76. a.place_of_origin ,
  77. a.storage_location ,
  78. a.disperse_capacity ,
  79. a.`length` ,
  80. a.width ,
  81. a.height ,
  82. a.pack_num ,
  83. a.pack_average_weight ,
  84. a.filling_time ,
  85. a.c_id ,
  86. a.c_time ,
  87. a.u_id ,
  88. a.u_time ,
  89. a.version ,
  90. a.house_id ,
  91. a.line_height,
  92. a.file_date,
  93. a.file_maker_uuid
  94. </sql>
  95. <sql id="joinCols">
  96. </sql>
  97. <select id="get" resultMap="baseMap">
  98. SELECT
  99. <include refid="columns"/>
  100. FROM daily_record_foodbasicinfo_file a
  101. <include refid="joinCols"/>
  102. WHERE a.id = #{id}
  103. </select>
  104. <select id="findByHouseId" resultMap="baseMap">
  105. SELECT *
  106. FROM daily_record_foodbasicinfo_file a
  107. where house_id=#{houseId}
  108. order BY c_time DESC
  109. limit 1
  110. </select>
  111. <select id="findList" resultMap="baseMap">
  112. SELECT
  113. <include refid="columns"/>
  114. FROM daily_record_foodbasicinfo_file a
  115. <if test="cityId !=null">
  116. left join house_info hou on hou.id = a.house_id
  117. left join sys_grain sg on sg.id = hou.grain_id
  118. </if>
  119. <include refid="joinCols"/>
  120. <where>
  121. <if test="cityId !=null">
  122. and sg.parentId = #{cityId}
  123. </if>
  124. <if test="id !=null">
  125. and id = #{id}
  126. </if>
  127. <if test="uuid !=null">
  128. and uuid = #{uuid}
  129. </if>
  130. <if test="recordUnite !=null">
  131. and record_unite = #{recordUnite}
  132. </if>
  133. <if test="keepUnite !=null">
  134. and keep_unite = #{keepUnite}
  135. </if>
  136. <if test="locationNum !=null">
  137. and location_num = #{locationNum}
  138. </if>
  139. <if test="quality !=null">
  140. and quality = #{quality}
  141. </if>
  142. <if test="type !=null">
  143. and `type` = #{type}
  144. </if>
  145. <if test="htype !=null">
  146. and htype = #{htype}
  147. </if>
  148. <if test="number !=null">
  149. and `number` = #{number}
  150. </if>
  151. <if test="standNumber !=null">
  152. and stand_number = #{standNumber}
  153. </if>
  154. <if test="inputYear !=null">
  155. and input_year = #{inputYear}
  156. </if>
  157. <if test="searchStartDate !=null">
  158. and STR_TO_DATE(input_year, '%Y-%m-%d') <![CDATA[ >= ]]> #{searchStartDate}
  159. </if>
  160. <if test="searchEndDate !=null">
  161. and STR_TO_DATE(input_year, '%Y-%m-%d') &lt;= #{searchEndDate}
  162. </if>
  163. <if test="outputYear !=null">
  164. and output_year = #{outputYear}
  165. </if>
  166. <if test="growYear !=null">
  167. and grow_year = #{growYear}
  168. </if>
  169. <if test="keepMethod !=null">
  170. and keep_method = #{keepMethod}
  171. </if>
  172. <if test="level !=null">
  173. and `level` = #{level}
  174. </if>
  175. <if test="weight !=null">
  176. and weight = #{weight}
  177. </if>
  178. <if test="impurity !=null">
  179. and impurity = #{impurity}
  180. </if>
  181. <if test="water !=null">
  182. and water = #{water}
  183. </if>
  184. <if test="unsound !=null">
  185. and unsound = #{unsound}
  186. </if>
  187. <if test="recorder !=null">
  188. and recorder = #{recorder}
  189. </if>
  190. <if test="houseType !=null">
  191. and house_type = #{houseType}
  192. </if>
  193. <if test="designHouseCapacity !=null">
  194. and design_house_capacity = #{designHouseCapacity}
  195. </if>
  196. <if test="validHouseCapacity !=null">
  197. and valid_house_capacity = #{validHouseCapacity}
  198. </if>
  199. <if test="price !=null">
  200. and price = #{price}
  201. </if>
  202. <if test="placeOfOrigin !=null">
  203. and place_of_origin = #{placeOfOrigin}
  204. </if>
  205. <if test="storageLocation !=null">
  206. and storage_location = #{storageLocation}
  207. </if>
  208. <if test="disperseCapacity !=null">
  209. and disperse_capacity = #{disperseCapacity}
  210. </if>
  211. <if test="length !=null">
  212. and `length` = #{length}
  213. </if>
  214. <if test="width !=null">
  215. and width = #{width}
  216. </if>
  217. <if test="height !=null">
  218. and height = #{height}
  219. </if>
  220. <if test="packNum !=null">
  221. and pack_num = #{packNum}
  222. </if>
  223. <if test="packAverageWeight !=null">
  224. and pack_average_weight = #{packAverageWeight}
  225. </if>
  226. <if test="fillingTime !=null">
  227. and filling_time = #{fillingTime}
  228. </if>
  229. <if test="cId !=null">
  230. and c_id = #{cId}
  231. </if>
  232. <if test="cTime !=null">
  233. and c_time = #{cTime}
  234. </if>
  235. <if test="uId !=null">
  236. and u_id = #{uId}
  237. </if>
  238. <if test="uTime !=null">
  239. and u_time = #{uTime}
  240. </if>
  241. <if test="version !=null">
  242. and version = #{version}
  243. </if>
  244. <if test="houseId !=null">
  245. and house_id = #{houseId}
  246. </if>
  247. <if test="lineHeight !=null">
  248. and line_height = #{lineHeight}
  249. </if>
  250. <if test="fileDate !=null">
  251. and file_date = #{fileDate}
  252. </if>
  253. <if test="fileMakerUuid !=null">
  254. and file_maker_uuid = #{fileMakerUuid}
  255. </if>
  256. </where>
  257. <choose>
  258. <when test="page !=null and page.count != null and page.orderBy != null and page.orderBy != ''">
  259. ORDER BY ${page.orderBy}
  260. </when>
  261. <otherwise>
  262. </otherwise>
  263. </choose>
  264. </select>
  265. <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
  266. parameterType="cn.ourwill.module.house.entity.daily.DailyRecordFoodbasicinfoFile">
  267. INSERT INTO daily_record_foodbasicinfo_file
  268. <trim prefix="(" suffix=")" suffixOverrides=",">
  269. <!-- <if test=" id != null">
  270. id,
  271. </if>-->
  272. <if test=" uuid != null">
  273. uuid,
  274. </if>
  275. <if test=" recordUnite != null">
  276. record_unite,
  277. </if>
  278. <if test=" keepUnite != null">
  279. keep_unite,
  280. </if>
  281. <if test=" locationNum != null">
  282. location_num,
  283. </if>
  284. <if test=" quality != null">
  285. quality,
  286. </if>
  287. <if test=" type != null">
  288. type,
  289. </if>
  290. <if test=" htype != null">
  291. htype,
  292. </if>
  293. <if test=" number != null">
  294. number,
  295. </if>
  296. <if test=" standNumber != null">
  297. stand_number,
  298. </if>
  299. <if test=" inputYear != null">
  300. input_year,
  301. </if>
  302. <if test="outputYear !=null">
  303. output_year,
  304. </if>
  305. <if test=" growYear != null">
  306. grow_year,
  307. </if>
  308. <if test=" keepMethod != null">
  309. keep_method,
  310. </if>
  311. <if test=" level != null">
  312. level,
  313. </if>
  314. <if test=" weight != null">
  315. weight,
  316. </if>
  317. <if test=" impurity != null">
  318. impurity,
  319. </if>
  320. <if test=" water != null">
  321. water,
  322. </if>
  323. <if test=" unsound != null">
  324. unsound,
  325. </if>
  326. <if test=" recorder != null">
  327. recorder,
  328. </if>
  329. <if test=" houseType != null">
  330. house_type,
  331. </if>
  332. <if test=" designHouseCapacity != null">
  333. design_house_capacity,
  334. </if>
  335. <if test=" validHouseCapacity != null">
  336. valid_house_capacity,
  337. </if>
  338. <if test=" price != null">
  339. price,
  340. </if>
  341. <if test=" placeOfOrigin != null">
  342. place_of_origin,
  343. </if>
  344. <if test=" storageLocation != null">
  345. storage_location,
  346. </if>
  347. <if test=" disperseCapacity != null">
  348. disperse_capacity,
  349. </if>
  350. <if test=" length != null">
  351. length,
  352. </if>
  353. <if test=" width != null">
  354. width,
  355. </if>
  356. <if test=" height != null">
  357. height,
  358. </if>
  359. <if test=" packNum != null">
  360. pack_num,
  361. </if>
  362. <if test=" packAverageWeight != null">
  363. pack_average_weight,
  364. </if>
  365. <if test=" fillingTime != null">
  366. filling_time,
  367. </if>
  368. <if test=" cId != null">
  369. c_id,
  370. </if>
  371. <if test=" cTime != null">
  372. c_time,
  373. </if>
  374. <if test=" uId != null">
  375. u_id,
  376. </if>
  377. <if test=" uTime != null">
  378. u_time,
  379. </if>
  380. <if test=" version != null">
  381. version,
  382. </if>
  383. <if test=" houseId != null">
  384. house_id,
  385. </if>
  386. <if test="lineHeight !=null">
  387. line_height,
  388. </if>
  389. <if test=" fileDate != null">
  390. file_date,
  391. </if>
  392. <if test="fileMakerUuid !=null">
  393. file_maker_uuid
  394. </if>
  395. </trim>
  396. <trim prefix="values (" suffix=")" suffixOverrides=",">
  397. <!--<if test="id !=null">
  398. #{id},
  399. </if>-->
  400. <if test=" uuid != null">
  401. #{uuid}, </if>
  402. <if test=" recordUnite != null">
  403. #{recordUnite}, </if>
  404. <if test=" keepUnite != null">
  405. #{keepUnite}, </if>
  406. <if test=" locationNum != null">
  407. #{locationNum}, </if>
  408. <if test=" quality != null">
  409. #{quality}, </if>
  410. <if test=" type != null">
  411. #{type}, </if>
  412. <if test=" htype != null">
  413. #{htype}, </if>
  414. <if test=" number != null">
  415. #{number}, </if>
  416. <if test=" standNumber != null">
  417. #{standNumber}, </if>
  418. <if test=" inputYear != null">
  419. #{inputYear}, </if>
  420. <if test="outputYear !=null">
  421. #{outputYear}, </if>
  422. <if test=" growYear != null">
  423. #{growYear}, </if>
  424. <if test=" keepMethod != null">
  425. #{keepMethod}, </if>
  426. <if test=" level != null">
  427. #{level}, </if>
  428. <if test=" weight != null">
  429. #{weight}, </if>
  430. <if test=" impurity != null">
  431. #{impurity}, </if>
  432. <if test=" water != null">
  433. #{water}, </if>
  434. <if test=" unsound != null">
  435. #{unsound}, </if>
  436. <if test=" recorder != null">
  437. #{recorder}, </if>
  438. <if test=" houseType != null">
  439. #{houseType}, </if>
  440. <if test=" designHouseCapacity != null">
  441. #{designHouseCapacity}, </if>
  442. <if test=" validHouseCapacity != null">
  443. #{validHouseCapacity}, </if>
  444. <if test=" price != null">
  445. #{price}, </if>
  446. <if test=" placeOfOrigin != null">
  447. #{placeOfOrigin}, </if>
  448. <if test=" storageLocation != null">
  449. #{storageLocation}, </if>
  450. <if test=" disperseCapacity != null">
  451. #{disperseCapacity}, </if>
  452. <if test=" length != null">
  453. #{length}, </if>
  454. <if test=" width != null">
  455. #{width}, </if>
  456. <if test=" height != null">
  457. #{height}, </if>
  458. <if test=" packNum != null">
  459. #{packNum}, </if>
  460. <if test=" packAverageWeight != null">
  461. #{packAverageWeight}, </if>
  462. <if test=" fillingTime != null">
  463. #{fillingTime}, </if>
  464. <if test=" cId != null">
  465. #{cId}, </if>
  466. <if test=" cTime != null">
  467. #{cTime}, </if>
  468. <if test=" uId != null">
  469. #{uId}, </if>
  470. <if test=" uTime != null">
  471. #{uTime}, </if>
  472. <if test=" version != null">
  473. #{version}, </if>
  474. <if test=" houseId != null">
  475. #{houseId}, </if>
  476. <if test="lineHeight !=null">
  477. #{lineHeight}, </if>
  478. <if test=" fileDate != null">
  479. #{fileDate}, </if>
  480. <if test="fileMakerUuid !=null">
  481. #{fileMakerUuid} </if>
  482. </trim>
  483. </insert>
  484. </mapper>