DailyRecordTransferFileDao.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  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.DailyRecordTransferFileDao">
  4. <resultMap type="cn.ourwill.module.house.entity.daily.DailyRecordTransferFile" id="baseMap">
  5. <result column="id" property="id"/>
  6. <result column="house_name" property="houseName"/>
  7. <result column="house_id" property="houseId"/>
  8. <result column="house_property" property="houseProperty"/>
  9. <result column="grain_name" property="grainName"/>
  10. <result column="trans_time" property="transTime"/>
  11. <result column="trans_user" property="transUser"/>
  12. <result column="receive_user" property="receiveUser"/>
  13. <result column="superior_user" property="superiorUser"/>
  14. <result column="type" property="type"/>
  15. <result column="count" property="count"/>
  16. <result column="quality" property="quality"/>
  17. <result column="condition" property="condition"/>
  18. <result column="responsible_user" property="responsibleUser"/>
  19. <result column="remark" property="remark"/>
  20. <result column="c_id" property="cId"/>
  21. <result column="c_time" property="cTime"/>
  22. <result column="u_id" property="uId"/>
  23. <result column="u_time" property="uTime"/>
  24. <result column="version" property="version"/>
  25. <result column="pic" property="pic"/>
  26. <result column="location" property="location"/>
  27. <result column="run_time" property="runTime"/>
  28. <result column="receive_remark" property="receiveRemark"/>
  29. <result column="keeper" property="keeper"/>
  30. <result column="receive_num" property="receiveNum"/>
  31. <result column="file_uuid" property="fileUuid"/>
  32. </resultMap>
  33. <sql id="dailyRecordTransferColumns">
  34. id ,
  35. house_name ,
  36. house_id,
  37. house_property,
  38. grain_name ,
  39. trans_time ,
  40. trans_user ,
  41. receive_user ,
  42. superior_user ,
  43. `type`,
  44. `count`,
  45. quality ,
  46. `condition` ,
  47. responsible_user ,
  48. remark ,
  49. c_id ,
  50. c_time ,
  51. u_id ,
  52. u_time ,
  53. version ,
  54. pic,
  55. location,
  56. run_time,
  57. receive_remark,
  58. keeper,
  59. receive_num,
  60. file_uuid
  61. </sql>
  62. <sql id="dailyRecordTransferJoins">
  63. </sql>
  64. <select id="get" resultMap="baseMap" parameterType="java.lang.Long">
  65. SELECT
  66. <include refid="dailyRecordTransferColumns"/>
  67. FROM daily_record_transfer_file
  68. <!--<include refid="dailyRecordTransferJoins"/>-->
  69. WHERE id = #{id}
  70. </select>
  71. <select id="findList" resultMap="baseMap">
  72. SELECT
  73. <include refid="dailyRecordTransferColumns"/>
  74. FROM daily_record_transfer_file a
  75. <include refid="dailyRecordTransferJoins"/>
  76. <where>
  77. <if test="id !=null">
  78. and id = #{id}
  79. </if>
  80. <if test="houseName !=null">
  81. and house_name = #{houseName}
  82. </if>
  83. <if test="houseId !=null">
  84. and house_id = #{houseId}
  85. </if>
  86. <if test="houseName !=null">
  87. and house_property = #{houseProperty}
  88. </if>
  89. <if test="grainName !=null">
  90. and grain_name = #{grainName}
  91. </if>
  92. <if test="transTime !=null">
  93. and trans_time = #{transTime}
  94. </if>
  95. <if test="searchStartDate !=null">
  96. and STR_TO_DATE(trans_time, '%Y-%m-%d') <![CDATA[ >= ]]> #{searchStartDate}
  97. </if>
  98. <if test="searchEndDate !=null">
  99. and STR_TO_DATE(trans_time, '%Y-%m-%d') &lt;= #{searchEndDate}
  100. </if>
  101. <if test="transUser !=null">
  102. and trans_user = #{transUser}
  103. </if>
  104. <if test="receiveUser !=null">
  105. and receive_user = #{receiveUser}
  106. </if>
  107. <if test="superiorUser !=null">
  108. and superior_user = #{superiorUser}
  109. </if>
  110. <if test="type !=null">
  111. and type = #{type}
  112. </if>
  113. <if test="count !=null">
  114. and count = #{count}
  115. </if>
  116. <if test="quality !=null">
  117. and quality = #{quality}
  118. </if>
  119. <if test="condition !=null">
  120. and condition = #{condition}
  121. </if>
  122. <if test="responsibleUser !=null">
  123. and responsible_user = #{responsibleUser}
  124. </if>
  125. <if test="remark !=null">
  126. and remark = #{remark}
  127. </if>
  128. <!--<if test="searchStartDate!=null and searchEndDate !=null ">-->
  129. <!--and trans_time BETWEEN #{searchStartDate} AND #{searchEndDate}-->
  130. <!--</if>-->
  131. <if test="searchStartDate !=null ">
  132. and trans_time &gt;= #{searchStartDate}
  133. </if>
  134. <if test=" searchEndDate !=null ">
  135. and trans_time &lt;= #{searchEndDate}
  136. </if>
  137. <if test=" fileUuid !=null ">
  138. and file_uuid &lt;= #{fileUuid}
  139. </if>
  140. </where>
  141. order by id desc
  142. </select>
  143. <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
  144. INSERT INTO daily_record_transfer_file
  145. <trim prefix="(" suffix=")" suffixOverrides=",">
  146. <!-- <if test=" id != null">
  147. id,
  148. </if>-->
  149. <if test=" uuid != null">
  150. uuid,
  151. </if>
  152. <if test=" houseName != null">
  153. house_name,
  154. </if>
  155. <if test=" houseId != null">
  156. house_id,
  157. </if>
  158. <if test=" houseProperty != null">
  159. house_property,
  160. </if>
  161. <if test=" grainName != null">
  162. grain_name,
  163. </if>
  164. <if test=" transTime != null">
  165. trans_time,
  166. </if>
  167. <if test=" transUser != null">
  168. trans_user,
  169. </if>
  170. <if test=" receiveUser != null">
  171. receive_user,
  172. </if>
  173. <if test=" superiorUser != null">
  174. superior_user,
  175. </if>
  176. <if test=" type != null">
  177. `type`,
  178. </if>
  179. <if test=" count != null">
  180. `count`,
  181. </if>
  182. <if test=" quality != null">
  183. quality,
  184. </if>
  185. <if test=" condition != null">
  186. `condition`,
  187. </if>
  188. <if test=" responsibleUser != null">
  189. responsible_user,
  190. </if>
  191. <if test=" remark != null">
  192. remark,
  193. </if>
  194. <if test=" cId != null">
  195. c_id,
  196. </if>
  197. c_time,
  198. <if test=" uId != null">
  199. u_id,
  200. </if>
  201. <if test=" uTime != null">
  202. u_time,
  203. </if>
  204. <if test=" version != null">
  205. version,
  206. </if>
  207. <if test=" pic != null">
  208. pic,
  209. </if>
  210. <if test=" location != null">
  211. location,
  212. </if>
  213. <if test=" runTime != null">
  214. run_time,
  215. </if>
  216. <if test=" receiveRemark != null">
  217. receive_remark,
  218. </if>
  219. <if test=" keeper != null">
  220. keeper,
  221. </if>
  222. <if test=" receiveNum != null">
  223. receive_num,
  224. </if>
  225. <if test=" fileUuid != null">
  226. file_uuid
  227. </if>
  228. </trim>
  229. <trim prefix="values (" suffix=")" suffixOverrides=",">
  230. <!--<if test="id !=null">
  231. #{id},
  232. </if>-->
  233. <if test=" uuid != null">
  234. #{uuid},
  235. </if>
  236. <if test=" houseName != null">
  237. #{houseName},
  238. </if>
  239. <if test=" houseId != null">
  240. #{houseId},
  241. </if>
  242. <if test=" houseProperty != null">
  243. #{houseProperty},
  244. </if>
  245. <if test=" grainName != null">
  246. #{grainName},
  247. </if>
  248. <if test=" transTime != null">
  249. #{transTime},
  250. </if>
  251. <if test=" transUser != null">
  252. #{transUser},
  253. </if>
  254. <if test=" receiveUser != null">
  255. #{receiveUser},
  256. </if>
  257. <if test=" superiorUser != null">
  258. #{superiorUser},
  259. </if>
  260. <if test=" type != null">
  261. #{type},
  262. </if>
  263. <if test=" count != null">
  264. #{count},
  265. </if>
  266. <if test=" quality != null">
  267. #{quality},
  268. </if>
  269. <if test=" condition != null">
  270. #{condition},
  271. </if>
  272. <if test=" responsibleUser != null">
  273. #{responsibleUser},
  274. </if>
  275. <if test=" remark != null">
  276. #{remark},
  277. </if>
  278. <if test=" cId != null">
  279. #{cId},
  280. </if>
  281. now(),
  282. <if test=" uId != null">
  283. #{uId},
  284. </if>
  285. <if test=" uTime != null">
  286. #{uTime},
  287. </if>
  288. <if test=" version != null">
  289. #{version},
  290. </if>
  291. <if test=" pic != null">
  292. #{pic},
  293. </if>
  294. <if test=" location != null">
  295. #{location},
  296. </if>
  297. <if test=" runTime != null">
  298. #{runTime},
  299. </if>
  300. <if test=" receiveRemark != null">
  301. #{receiveRemark},
  302. </if>
  303. <if test=" keeper != null">
  304. #{keeper},
  305. </if>
  306. <if test=" receiveNum != null">
  307. #{receiveNum},
  308. </if>
  309. <if test=" fileUuid != null">
  310. #{fileUuid},
  311. </if>
  312. </trim>
  313. </insert>
  314. </mapper>