DailyRecordHouseIncDecFileDao.xml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  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.DailyRecordHouseIncDecFileDao">
  4. <resultMap id="baseMap" type="cn.ourwill.module.house.entity.daily.DailyRecordHouseIncDecFile">
  5. <result column="id" property="id"/>
  6. <result column="report_organ" property="reportOrgan"/>
  7. <result column="house_no" property="houseNo"/>
  8. <result column="grain_id" property="grainId"/>
  9. <result column="table_no" property="tableNo"/>
  10. <result column="in_count" property="inCount"/>
  11. <result column="in_water" property="inWater"/>
  12. <result column="in_sub" property="inSub"/>
  13. <result column="in_date" property="inDate"/>
  14. <result column="out_count" property="outCount"/>
  15. <result column="out_water" property="outWater"/>
  16. <result column="out_sub" property="outSub"/>
  17. <result column="out_date" property="outDate"/>
  18. <result column="real_consum" property="realConsum"/>
  19. <result column="nature_consum" property="natureConsum"/>
  20. <result column="sub_consum" property="subConsum"/>
  21. <result column="tran_consum" property="tranConsum"/>
  22. <result column="deal_solu" property="dealSolu"/>
  23. <result column="leader_solu" property="leaderSolu"/>
  24. <result column="above_count" property="aboveCount"/>
  25. <result column="excess_quantity" property="excessQuantity"/>
  26. <result column="uuid" property="uuid"/>
  27. <result column="c_id" property="cId"/>
  28. <result column="c_time" property="cTime"/>
  29. <result column="u_id" property="uId"/>
  30. <result column="u_time" property="uTime"/>
  31. <result column="version" property="version"/>
  32. <result column="house_name" property="houseName"/>
  33. <result column="file_uuid" property="fileUuid"/>
  34. </resultMap>
  35. <sql id="columns">
  36. a.id,
  37. a.report_organ,
  38. a.house_no,
  39. a.grain_id,
  40. a.table_no,
  41. a.in_count,
  42. a.in_water,
  43. a.in_sub,
  44. a.in_date,
  45. a.out_count,
  46. a.out_water,
  47. a.out_sub,
  48. a.out_date,
  49. a.real_consum,
  50. a.nature_consum,
  51. a.sub_consum,
  52. a.tran_consum,
  53. a.deal_solu,
  54. a.leader_solu,
  55. above_count,
  56. excess_quantity,
  57. a.uuid,
  58. a.c_id,
  59. a.c_time,
  60. a.u_id,
  61. a.u_time,
  62. a.version,
  63. a.file_uuid
  64. </sql>
  65. <select id="get" resultMap="baseMap">
  66. SELECT b.house_name,<include refid="columns"/>
  67. FROM outhouse_inc_dec_file a LEFT JOIN house_info b ON a.house_no=b.id
  68. WHERE a.id=#{id}
  69. </select>
  70. <select id="getByHouseNo" resultMap="baseMap">
  71. SELECT
  72. <include refid="columns"/>
  73. FROM outhouse_inc_dec_file a
  74. <where>
  75. <if test="houseNo !=null">
  76. and house_no = #{houseNo}
  77. </if>
  78. <if test="fileUuid !=null">
  79. and file_uuid = #{fileUuid}
  80. </if>
  81. limit 1
  82. </where>
  83. </select>
  84. <insert id="insert" parameterType="cn.ourwill.module.house.entity.daily.DailyRecordHouseIncDecFile">
  85. INSERT INTO outhouse_inc_dec_file
  86. <trim prefix="(" suffix=")" suffixOverrides=",">
  87. <!-- <if test=" id != null">
  88. id,
  89. </if>-->
  90. <if test=" reportOrgan != null">
  91. report_organ,
  92. </if>
  93. <if test=" houseNo != null">
  94. house_no,
  95. </if>
  96. <if test=" grainId != null">
  97. grain_id,
  98. </if>
  99. <if test=" tableNo != null">
  100. table_no,
  101. </if>
  102. <if test=" inCount != null">
  103. in_count,
  104. </if>
  105. <if test=" inWater != null">
  106. in_water,
  107. </if>
  108. <if test=" inSub != null">
  109. in_sub,
  110. </if>
  111. <if test=" inDate != null">
  112. in_date,
  113. </if>
  114. <if test=" outCount != null">
  115. out_count,
  116. </if>
  117. <if test=" outWater != null">
  118. out_water,
  119. </if>
  120. <if test=" outSub != null">
  121. out_sub,
  122. </if>
  123. <if test=" outDate != null">
  124. out_date,
  125. </if>
  126. <if test=" realConsum != null">
  127. real_consum,
  128. </if>
  129. <if test=" natureConsum != null">
  130. nature_consum,
  131. </if>
  132. <if test=" subConsum != null">
  133. sub_consum,
  134. </if>
  135. <if test=" tranConsum != null">
  136. tran_consum,
  137. </if>
  138. <if test=" dealSolu != null">
  139. deal_solu,
  140. </if>
  141. <if test=" leaderSolu != null">
  142. leader_solu,
  143. </if>
  144. <if test=" aboveCount != null">
  145. above_count,
  146. </if>
  147. <if test=" excessQuantity != null">
  148. excess_quantity,
  149. </if>
  150. <if test="uuid != null">
  151. uuid,
  152. </if>
  153. <if test="cId != null">
  154. c_id,
  155. </if>
  156. <if test="cTime != null">
  157. c_time,
  158. </if>
  159. <if test="uId != null">
  160. u_id,
  161. </if>
  162. <if test="uTime != null">
  163. u_time,
  164. </if>
  165. <if test="version !=null">
  166. version,
  167. </if>
  168. <if test="fileUuid !=null">
  169. file_uuid
  170. </if>
  171. </trim>
  172. <trim prefix="values (" suffix=")" suffixOverrides=",">
  173. <!--<if test="id !=null">
  174. #{id},
  175. </if>-->
  176. <if test=" reportOrgan != null">
  177. #{reportOrgan},
  178. </if>
  179. <if test=" houseNo != null">
  180. #{houseNo},
  181. </if>
  182. <if test=" grainId != null">
  183. #{grainId},
  184. </if>
  185. <if test=" tableNo != null">
  186. #{tableNo},
  187. </if>
  188. <if test=" inCount != null">
  189. #{inCount},
  190. </if>
  191. <if test=" inWater != null">
  192. #{inWater},
  193. </if>
  194. <if test=" inSub != null">
  195. #{inSub},
  196. </if>
  197. <if test=" inDate != null">
  198. #{inDate},
  199. </if>
  200. <if test=" outCount != null">
  201. #{outCount},
  202. </if>
  203. <if test=" outWater != null">
  204. #{outWater},
  205. </if>
  206. <if test=" outSub != null">
  207. #{outSub},
  208. </if>
  209. <if test=" outDate != null">
  210. #{ outDate},
  211. </if>
  212. <if test=" realConsum != null">
  213. #{ realConsum},
  214. </if>
  215. <if test=" natureConsum != null">
  216. #{ natureConsum},
  217. </if>
  218. <if test=" subConsum != null">
  219. #{ subConsum},
  220. </if>
  221. <if test=" tranConsum != null">
  222. #{tranConsum},
  223. </if>
  224. <if test=" dealSolu != null">
  225. #{dealSolu},
  226. </if>
  227. <if test=" leaderSolu != null">
  228. #{leaderSolu},
  229. </if>
  230. <if test=" aboveCount != null">
  231. #{aboveCount},
  232. </if>
  233. <if test=" excessQuantity != null">
  234. #{excessQuantity},
  235. </if>
  236. <if test="uuid != null">
  237. #{uuid},
  238. </if>
  239. <if test="cId != null">
  240. #{cId},
  241. </if>
  242. <if test="cTime != null">
  243. #{cTime},
  244. </if>
  245. <if test="uId != null">
  246. #{uId},
  247. </if>
  248. <if test="uTime != null">
  249. #{uTime},
  250. </if>
  251. <if test="version !=null">
  252. #{version},
  253. </if>
  254. <if test="fileUuid !=null">
  255. #{fileUuid}
  256. </if>
  257. </trim>
  258. </insert>
  259. </mapper>