DailyRecordFoodinfoFileDao.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  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.DailyRecordFoodinfoFileDao">
  4. <resultMap type="cn.ourwill.module.house.entity.daily.DailyRecordFoodinfoFile" id="baseMap">
  5. <result column="id" property="id"/>
  6. <result column="uuid" property="uuid"/>
  7. <result column="house_id" property="houseId"/>
  8. <result column="type" property="type"/>
  9. <result column="content" property="content"/>
  10. <result column="htype" property="htype"/>
  11. <result column="check_date" property="checkDate"/>
  12. <result column="food_color" property="foodColor"/>
  13. <result column="pest_position" property="pestPosition"/>
  14. <result column="pest_type" property="pestType"/>
  15. <result column="pest_volum" property="pestVolum"/>
  16. <result column="pest_level" property="pestLevel"/>
  17. <result column="water_position" property="waterPosition"/>
  18. <result column="water_area" property="waterArea"/>
  19. <result column="water_depth" property="waterDepth"/>
  20. <result column="water_heightest" property="waterHeightest"/>
  21. <result column="in_temp" property="inTemp"/>
  22. <result column="out_temp" property="outTemp"/>
  23. <result column="in_water" property="inWater"/>
  24. <result column="out_water" property="outWater"/>
  25. <result column="max_temp" property="maxTemp"/>
  26. <result column="maxtemp_position" property="maxtempPosition"/>
  27. <result column="check_situation" property="checkSituation"/>
  28. <result column="treatment_advice" property="treatmentAdvice"/>
  29. <result column="check_sign" property="checkSign"/>
  30. <result column="custodian_sign" property="custodianSign"/>
  31. <result column="remark" property="remark"/>
  32. <result column="c_id" property="cId"/>
  33. <result column="c_time" property="cTime"/>
  34. <result column="u_id" property="uId"/>
  35. <result column="u_time" property="uTime"/>
  36. <result column="version" property="version"/>
  37. <result column="xzflag" property="xzflag"/>
  38. <!--以下二期新增字段-->
  39. <result column="nonormal_type" property="nonormalType"/>
  40. <result column="nonormal_position" property="nonormalPosition"/>
  41. <result column="nonormal_domain" property="nonormalDomain"/>
  42. <result column="nonormal_temp" property="nonormalTemp"/>
  43. <result column="nonormal_water" property="nonormalWater"/>
  44. <result column="mouse_record" property="mouseRecord"/>
  45. <result column="sect_record" property="sectRecord"/>
  46. <result column="bad_record" property="badRecord"/>
  47. <result column="accident_record" property="accidentRecord"/>
  48. <result column="min_temp" property="minTemp"/>
  49. <result column="avg_temp" property="avgTemp"/>
  50. <result column="file_uuid" property="fileUuid"/>
  51. </resultMap>
  52. <sql id="columns">
  53. id ,
  54. uuid ,
  55. house_id ,
  56. `type` ,
  57. content ,
  58. htype ,
  59. check_date ,
  60. food_color ,
  61. pest_position ,
  62. pest_type ,
  63. pest_volum ,
  64. pest_level ,
  65. water_position ,
  66. water_area ,
  67. water_depth ,
  68. water_heightest ,
  69. in_temp ,
  70. out_temp ,
  71. in_water ,
  72. out_water ,
  73. max_temp ,
  74. maxtemp_position ,
  75. check_situation ,
  76. treatment_advice ,
  77. check_sign ,
  78. custodian_sign ,
  79. remark ,
  80. c_id ,
  81. c_time ,
  82. u_id ,
  83. u_time ,
  84. version,
  85. xzflag,
  86. nonormal_type,
  87. nonormal_position,
  88. nonormal_domain,
  89. nonormal_temp,
  90. nonormal_water,
  91. mouse_record,
  92. sect_record,
  93. bad_record,
  94. accident_record,
  95. min_temp,
  96. avg_temp,
  97. file_uuid
  98. </sql>
  99. <sql id="joinCols">
  100. </sql>
  101. <select id="getByUuid" resultMap="baseMap">
  102. SELECT
  103. <include refid="columns"/>
  104. FROM daily_record_foodcheckinfo_file a
  105. <include refid="joinCols"/>
  106. WHERE a.uuid = #{uuid}
  107. </select>
  108. <select id="get" resultMap="baseMap">
  109. SELECT
  110. <include refid="columns"/>
  111. FROM daily_record_foodcheckinfo_file a
  112. <include refid="joinCols"/>
  113. WHERE a.id = #{id}
  114. </select>
  115. <select id="findList" resultMap="baseMap">
  116. SELECT
  117. <include refid="columns"/>
  118. FROM daily_record_foodcheckinfo_file a
  119. <include refid="joinCols"/>
  120. <where>
  121. <if test="id !=null">
  122. and id = #{id}
  123. </if>
  124. <if test="searchStartDate !=null">
  125. and STR_TO_DATE(check_date, '%Y-%m-%d') <![CDATA[ >= ]]> #{searchStartDate}
  126. </if>
  127. <if test="searchEndDate !=null">
  128. and STR_TO_DATE(check_date, '%Y-%m-%d') &lt;= #{searchEndDate}
  129. </if>
  130. <if test="uuid !=null">
  131. and uuid = #{uuid}
  132. </if>
  133. <if test="houseId !=null">
  134. and house_id = #{houseId}
  135. </if>
  136. <if test="type !=null">
  137. and `type` = #{type}
  138. </if>
  139. <if test="content !=null">
  140. and content = #{content}
  141. </if>
  142. <if test="htype !=null">
  143. and htype = #{htype}
  144. </if>
  145. <if test="checkDate !=null">
  146. and check_date = #{checkDate}
  147. </if>
  148. <if test="foodColor !=null">
  149. and food_color = #{foodColor}
  150. </if>
  151. <if test="pestPosition !=null">
  152. and pest_position = #{pestPosition}
  153. </if>
  154. <if test="pestType !=null">
  155. and pest_type = #{pestType}
  156. </if>
  157. <if test="pestVolum !=null">
  158. and pest_volum = #{pestVolum}
  159. </if>
  160. <if test="pestLevel !=null">
  161. and pest_level = #{pestLevel}
  162. </if>
  163. <if test="waterPosition !=null">
  164. and water_position = #{waterPosition}
  165. </if>
  166. <if test="waterArea !=null">
  167. and water_area = #{waterArea}
  168. </if>
  169. <if test="waterDepth !=null">
  170. and water_depth = #{waterDepth}
  171. </if>
  172. <if test="waterHeightest !=null">
  173. and water_heightest = #{waterHeightest}
  174. </if>
  175. <if test="inTemp !=null">
  176. and in_temp = #{inTemp}
  177. </if>
  178. <if test="outTemp !=null">
  179. and out_temp = #{outTemp}
  180. </if>
  181. <if test="inWater !=null">
  182. and in_water = #{inWater}
  183. </if>
  184. <if test="outWater !=null">
  185. and out_water = #{outWater}
  186. </if>
  187. <if test="maxTemp !=null">
  188. and max_temp = #{maxTemp}
  189. </if>
  190. <if test="maxtempPosition !=null">
  191. and maxtemp_position = #{maxtempPosition}
  192. </if>
  193. <if test="checkSituation !=null">
  194. and check_situation = #{checkSituation}
  195. </if>
  196. <if test="treatmentAdvice !=null">
  197. and treatment_advice = #{treatmentAdvice}
  198. </if>
  199. <if test="checkSign !=null">
  200. and check_sign = #{checkSign}
  201. </if>
  202. <if test="custodianSign !=null">
  203. and custodian_sign = #{custodianSign}
  204. </if>
  205. <if test="remark !=null">
  206. and remark = #{remark}
  207. </if>
  208. <if test="cId !=null">
  209. and c_id = #{cId}
  210. </if>
  211. <if test="cTime !=null">
  212. and c_time = #{cTime}
  213. </if>
  214. <if test="uId !=null">
  215. and u_id = #{uId}
  216. </if>
  217. <if test="uTime !=null">
  218. and u_time = #{uTime}
  219. </if>
  220. <if test="version !=null">
  221. and version = #{version}
  222. </if>
  223. <if test="xzflag !=null">
  224. and xzflag = #{xzflag}
  225. </if>
  226. <if test="fileUuid !=null">
  227. and file_uuid = #{fileUuid}
  228. </if>
  229. </where>
  230. <choose>
  231. <when test="checkOrder !=null and checkOrder = 'true'">
  232. order by STR_TO_DATE(check_date, '%Y-%m-%d') desc,id desc
  233. </when>
  234. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  235. ORDER BY ${page.orderBy}
  236. </when>
  237. </choose>
  238. </select>
  239. <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
  240. parameterType="cn.ourwill.module.house.entity.daily.DailyRecordFoodinfoFile">
  241. INSERT INTO daily_record_foodcheckinfo_file
  242. <trim prefix="(" suffix=")" suffixOverrides=",">
  243. <!-- <if test=" id != null">
  244. id,
  245. </if>-->
  246. <if test=" uuid != null">
  247. uuid,
  248. </if>
  249. <if test=" houseId != null">
  250. house_id,
  251. </if>
  252. <if test=" type != null">
  253. `type`,
  254. </if>
  255. <if test=" content != null">
  256. content,
  257. </if>
  258. <if test=" htype != null">
  259. htype,
  260. </if>
  261. <if test=" checkDate != null">
  262. check_date,
  263. </if>
  264. <if test=" foodColor != null">
  265. food_color,
  266. </if>
  267. <if test=" pestPosition != null">
  268. pest_position,
  269. </if>
  270. <if test=" pestType != null">
  271. pest_type,
  272. </if>
  273. <if test=" pestVolum != null">
  274. pest_volum,
  275. </if>
  276. <if test="pestLevel !=null">
  277. pest_level,
  278. </if>
  279. <if test=" waterPosition != null">
  280. water_position,
  281. </if>
  282. <if test=" waterArea != null">
  283. water_area,
  284. </if>
  285. <if test=" waterDepth != null">
  286. water_depth,
  287. </if>
  288. <if test=" waterHeightest != null">
  289. water_heightest,
  290. </if>
  291. <if test="inTemp !=null">
  292. in_temp,
  293. </if>
  294. <if test="outTemp !=null">
  295. out_temp,
  296. </if>
  297. <if test="inWater !=null">
  298. in_water,
  299. </if>
  300. <if test="outWater !=null">
  301. out_water,
  302. </if>
  303. <if test="maxTemp !=null">
  304. max_temp,
  305. </if>
  306. <if test="maxtempPosition !=null">
  307. maxtemp_position,
  308. </if>
  309. <if test=" checkSituation != null">
  310. check_situation,
  311. </if>
  312. <if test=" treatmentAdvice != null">
  313. treatment_advice,
  314. </if>
  315. <if test=" checkSign != null">
  316. check_sign,
  317. </if>
  318. <if test=" custodianSign != null">
  319. custodian_sign,
  320. </if>
  321. <if test=" remark != null">
  322. remark,
  323. </if>
  324. <if test=" cId != null">
  325. c_id,
  326. </if>
  327. <if test=" cTime != null">
  328. c_time,
  329. </if>
  330. <if test=" uId != null">
  331. u_id,
  332. </if>
  333. <if test=" uTime != null">
  334. u_time,
  335. </if>
  336. <if test=" version != null">
  337. version,
  338. </if>
  339. <if test="xzflag !=null">
  340. xzflag,
  341. </if>
  342. <if test="nonormalType !=null">
  343. nonormal_type,
  344. </if>
  345. <if test="nonormalPosition !=null">
  346. nonormal_position,
  347. </if>
  348. <if test="nonormalDomain !=null">
  349. nonormal_domain,
  350. </if>
  351. <if test="nonormalTemp !=null">
  352. nonormal_temp,
  353. </if>
  354. <if test="nonormalWater !=null">
  355. nonormal_water,
  356. </if>
  357. <if test="mouseRecord !=null">
  358. mouse_record,
  359. </if>
  360. <if test="sectRecord !=null">
  361. sect_record,
  362. </if>
  363. <if test="badRecord !=null">
  364. bad_record,
  365. </if>
  366. <if test="accidentRecord !=null">
  367. accident_record,
  368. </if>
  369. <if test="minTemp !=null">
  370. min_temp,
  371. </if>
  372. <if test="avgTemp !=null">
  373. avg_temp,
  374. </if>
  375. <if test="fileUuid !=null">
  376. file_uuid
  377. </if>
  378. </trim>
  379. <trim prefix="values (" suffix=")" suffixOverrides=",">
  380. <!--<if test="id !=null">
  381. #{id},
  382. </if>-->
  383. <if test=" uuid != null">
  384. #{uuid}, </if>
  385. <if test=" houseId != null">
  386. #{houseId}, </if>
  387. <if test=" type != null">
  388. #{type}, </if>
  389. <if test=" content != null">
  390. #{content}, </if>
  391. <if test=" htype != null">
  392. #{htype}, </if>
  393. <if test=" checkDate != null">
  394. #{checkDate}, </if>
  395. <if test=" foodColor != null">
  396. #{foodColor}, </if>
  397. <if test=" pestPosition != null">
  398. #{pestPosition}, </if>
  399. <if test=" pestType != null">
  400. #{pestType}, </if>
  401. <if test=" pestVolum != null">
  402. #{pestVolum}, </if>
  403. <if test="pestLevel !=null">
  404. #{pestLevel}, </if>
  405. <if test=" waterPosition != null">
  406. #{waterPosition}, </if>
  407. <if test=" waterArea != null">
  408. #{waterArea}, </if>
  409. <if test=" waterDepth != null">
  410. #{waterDepth}, </if>
  411. <if test=" waterHeightest != null">
  412. #{waterHeightest}, </if>
  413. <if test="inTemp !=null">
  414. #{inTemp}, </if>
  415. <if test="outTemp !=null">
  416. #{outTemp}, </if>
  417. <if test="inWater !=null">
  418. #{inWater}, </if>
  419. <if test="outWater !=null">
  420. #{outWater}, </if>
  421. <if test="maxTemp !=null">
  422. #{maxTemp}, </if>
  423. <if test="maxtempPosition !=null">
  424. #{maxtempPosition}, </if>
  425. <if test=" checkSituation != null">
  426. #{checkSituation}, </if>
  427. <if test=" treatmentAdvice != null">
  428. #{treatmentAdvice}, </if>
  429. <if test=" checkSign != null">
  430. #{checkSign}, </if>
  431. <if test=" custodianSign != null">
  432. #{custodianSign}, </if>
  433. <if test=" remark != null">
  434. #{remark}, </if>
  435. <if test=" cId != null">
  436. #{cId}, </if>
  437. <if test=" cTime != null">
  438. #{cTime}, </if>
  439. <if test=" uId != null">
  440. #{uId}, </if>
  441. <if test=" uTime != null">
  442. #{uTime}, </if>
  443. <if test=" version != null">
  444. #{version}, </if>
  445. <if test=" xzflag != null">
  446. #{xzflag}, </if>
  447. <if test=" nonormalType != null">
  448. #{nonormalType},
  449. </if>
  450. <if test=" nonormalPosition != null">
  451. #{nonormalPosition},
  452. </if>
  453. <if test=" nonormalDomain != null">
  454. #{nonormalDomain},
  455. </if>
  456. <if test=" nonormalTemp != null">
  457. #{nonormalTemp},
  458. </if>
  459. <if test=" nonormalWater != null">
  460. #{nonormalWater},
  461. </if>
  462. <if test=" mouseRecord != null">
  463. #{mouseRecord},
  464. </if>
  465. <if test=" sectRecord != null">
  466. #{sectRecord},
  467. </if>
  468. <if test=" badRecord != null">
  469. #{badRecord},
  470. </if>
  471. <if test=" accidentRecord != null">
  472. #{accidentRecord},
  473. </if>
  474. <if test=" minTemp != null">
  475. #{minTemp},
  476. </if>
  477. <if test=" avgTemp != null">
  478. #{avgTemp},
  479. </if>
  480. <if test="fileUuid !=null">
  481. #{fileUuid}
  482. </if>
  483. </trim>
  484. </insert>
  485. </mapper>