DailyRecordPaymentFileDao.xml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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.DailyRecordPaymentFileDao">
  4. <resultMap type="cn.ourwill.module.house.entity.daily.DailyRecordPaymentFile" id="baseMap">
  5. <result column="id" property="id"/>
  6. <result column="house_id" property="houseId"/>
  7. <result column="htype" property="htype"/>
  8. <result column="uuid" property="uuid"/>
  9. <result column="recorder" property="recorder"/>
  10. <result column="count" property="count"/>
  11. <result column="type" property="type"/>
  12. <result column="sub_type" property="subType"/>
  13. <result column="pay_time" property="payTime"/>
  14. <result column="price" property="price"/>
  15. <result column="unit" property="unit"/>
  16. <result column="number" property="number"/>
  17. <result column="pay_content" property="payContent"/>
  18. <result column="c_id" property="cId"/>
  19. <result column="c_time" property="cTime"/>
  20. <result column="u_id" property="uId"/>
  21. <result column="u_time" property="uTime"/>
  22. <result column="version" property="version"/>
  23. <result column="file_uuid" property="fileUuid"/>
  24. </resultMap>
  25. <resultMap type="cn.ourwill.module.house.entity.daily.DailyRecordPayment" id="mapForStatistics">
  26. <result column="grain_id" property="grainId"/>
  27. <result column="grain_name" property="grainName"/>
  28. <result column="feeType" property="feeType"/>
  29. <result column="fee" property="fee"/>
  30. <result column="feeDate" property="feeDate"/>
  31. </resultMap>
  32. <sql id="columns">
  33. id ,
  34. house_id ,
  35. htype ,
  36. uuid ,
  37. recorder ,
  38. `count` ,
  39. `type` ,
  40. sub_type ,
  41. pay_time ,
  42. price ,
  43. unit ,
  44. `number` ,
  45. pay_content ,
  46. c_id ,
  47. c_time ,
  48. u_id ,
  49. u_time ,
  50. version,
  51. file_uuid
  52. </sql>
  53. <sql id="joinCols">
  54. </sql>
  55. <select id="get" resultMap="baseMap">
  56. SELECT
  57. <include refid="columns"/>
  58. FROM daily_record_payment_file a
  59. <include refid="joinCols"/>
  60. WHERE a.id = #{id}
  61. </select>
  62. <select id="getByUuid" resultMap="baseMap">
  63. SELECT
  64. <include refid="columns"/>
  65. FROM daily_record_payment_file a
  66. <include refid="joinCols"/>
  67. WHERE a.uuid = #{uuid}
  68. </select>
  69. <select id="findList" resultMap="baseMap">
  70. SELECT
  71. <include refid="columns"/>
  72. FROM daily_record_payment_file a
  73. <include refid="joinCols"/>
  74. <where>
  75. <if test="id !=null">
  76. and id = #{id}
  77. </if>
  78. <if test="houseId !=null">
  79. and house_id = #{houseId}
  80. </if>
  81. <if test="htype !=null">
  82. and htype = #{htype}
  83. </if>
  84. <if test="uuid !=null">
  85. and uuid = #{uuid}
  86. </if>
  87. <if test="recorder !=null">
  88. and recorder = #{recorder}
  89. </if>
  90. <if test="count !=null">
  91. and `count` = #{count}
  92. </if>
  93. <if test="type !=null">
  94. and `type` = #{type}
  95. </if>
  96. <if test="subType !=null">
  97. and sub_type = #{subType}
  98. </if>
  99. <if test="payTime !=null">
  100. and pay_time = #{payTime}
  101. </if>
  102. <if test="searchStartDate !=null">
  103. and STR_TO_DATE(pay_time, '%Y-%m-%d') <![CDATA[ >= ]]> #{searchStartDate}
  104. </if>
  105. <if test="searchEndDate !=null">
  106. and STR_TO_DATE(pay_time, '%Y-%m-%d') &lt;= #{searchEndDate}
  107. </if>
  108. <if test="price !=null">
  109. and price = #{price}
  110. </if>
  111. <if test="unit !=null">
  112. and unit = #{unit}
  113. </if>
  114. <if test="number !=null">
  115. and `number` = #{number}
  116. </if>
  117. <if test="payContent !=null">
  118. and pay_content = #{payContent}
  119. </if>
  120. <if test="cId !=null">
  121. and c_id = #{cId}
  122. </if>
  123. <if test="cTime !=null">
  124. and c_time = #{cTime}
  125. </if>
  126. <if test="uId !=null">
  127. and u_id = #{uId}
  128. </if>
  129. <if test="uTime !=null">
  130. and u_time = #{uTime}
  131. </if>
  132. <if test="version !=null">
  133. and version = #{version}
  134. </if>
  135. <if test="fileUuid !=null">
  136. and file_uuid = #{fileUuid}
  137. </if>
  138. </where>
  139. <choose>
  140. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  141. ORDER BY ${page.orderBy}
  142. </when>
  143. <otherwise>
  144. </otherwise>
  145. </choose>
  146. </select>
  147. <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
  148. parameterType="cn.ourwill.module.house.entity.daily.DailyRecordPaymentFile">
  149. INSERT INTO daily_record_payment_file
  150. <trim prefix="(" suffix=")" suffixOverrides=",">
  151. <!-- <if test=" id != null">
  152. id,
  153. </if>-->
  154. <if test=" houseId != null">
  155. house_id,
  156. </if>
  157. <if test=" htype != null">
  158. htype,
  159. </if>
  160. <if test=" uuid != null">
  161. uuid,
  162. </if>
  163. <if test=" recorder != null">
  164. recorder,
  165. </if>
  166. <if test=" count != null">
  167. `count`,
  168. </if>
  169. <if test=" type != null">
  170. `type`,
  171. </if>
  172. <if test=" subType != null">
  173. sub_type,
  174. </if>
  175. <if test=" payTime != null">
  176. pay_time,
  177. </if>
  178. <if test=" price != null">
  179. price,
  180. </if>
  181. <if test=" unit != null">
  182. unit,
  183. </if>
  184. <if test=" number != null">
  185. `number`,
  186. </if>
  187. <if test=" payContent != null">
  188. pay_content,
  189. </if>
  190. <if test=" cId != null">
  191. c_id,
  192. </if>
  193. <if test=" cTime != null">
  194. c_time,
  195. </if>
  196. <if test=" uId != null">
  197. u_id,
  198. </if>
  199. <if test=" uTime != null">
  200. u_time,
  201. </if>
  202. <if test=" version != null">
  203. version,
  204. </if>
  205. <if test=" fileUuid != null">
  206. file_uuid
  207. </if>
  208. </trim>
  209. <trim prefix="values (" suffix=")" suffixOverrides=",">
  210. <!--<if test="id !=null">
  211. #{id},
  212. </if>-->
  213. <if test=" houseId != null">
  214. #{houseId}, </if>
  215. <if test=" htype != null">
  216. #{htype}, </if>
  217. <if test=" uuid != null">
  218. #{uuid}, </if>
  219. <if test=" recorder != null">
  220. #{recorder}, </if>
  221. <if test=" count != null">
  222. #{count}, </if>
  223. <if test=" type != null">
  224. #{type}, </if>
  225. <if test=" subType != null">
  226. #{subType}, </if>
  227. <if test=" payTime != null">
  228. #{payTime}, </if>
  229. <if test=" price != null">
  230. #{price}, </if>
  231. <if test=" unit != null">
  232. #{unit}, </if>
  233. <if test=" number != null">
  234. #{number}, </if>
  235. <if test=" payContent != null">
  236. #{payContent}, </if>
  237. <if test=" cId != null">
  238. #{cId}, </if>
  239. <if test=" cTime != null">
  240. #{cTime}, </if>
  241. <if test=" uId != null">
  242. #{uId}, </if>
  243. <if test=" uTime != null">
  244. #{uTime}, </if>
  245. <if test=" version != null">
  246. #{version}, </if>
  247. <if test=" fileUuid != null">
  248. #{fileUuid}
  249. </if>
  250. </trim>
  251. </insert>
  252. </mapper>