FeeDetailServiceDaoImplMapper.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="feeDetailServiceDaoImpl">
  6. <!-- 保存费用明细信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessFeeDetailInfo" parameterType="Map">
  8. insert into
  9. business_pay_fee_detail(
  10. operate,prime_rate,detail_id,
  11. receivable_amount,cycles,remark,
  12. received_amount,community_id,b_id,fee_id,state,start_time,end_time) values (
  13. #{operate},#{primeRate},#{detailId},#{receivableAmount},
  14. #{cycles},#{remark},#{receivedAmount},#{communityId},#{bId},#{feeId},#{state},#{startTime},#{endTime})
  15. </insert>
  16. <!-- 查询费用明细信息(Business) add by wuxw 2018-07-03 -->
  17. <select id="getBusinessFeeDetailInfo" parameterType="Map" resultType="Map">
  18. select
  19. t.operate,t.prime_rate,t.prime_rate primeRate,t.detail_id,
  20. t.detail_id detailId,t.receivable_amount,
  21. t.receivable_amount receivableAmount,t.cycles,
  22. t.remark,t.received_amount,t.received_amount receivedAmount,
  23. t.community_id,t.community_id communityId,t.b_id,t.b_id bId,
  24. t.fee_id,t.fee_id feeId,t.state,t.start_time,t.end_time,t.start_time startTime,t.end_time endTime
  25. from business_pay_fee_detail t
  26. where 1 =1
  27. <if test="operate !=null and operate != ''">
  28. and t.operate= #{operate}
  29. </if>
  30. <if test="primeRate !=null and primeRate != ''">
  31. and t.prime_rate= #{primeRate}
  32. </if>
  33. <if test="detailId !=null and detailId != ''">
  34. and t.detail_id= #{detailId}
  35. </if>
  36. <if test="receivableAmount !=null and receivableAmount != ''">
  37. and t.receivable_amount= #{receivableAmount}
  38. </if>
  39. <if test="cycles !=null and cycles != ''">
  40. and t.cycles= #{cycles}
  41. </if>
  42. <if test="remark !=null and remark != ''">
  43. and t.remark= #{remark}
  44. </if>
  45. <if test="receivedAmount !=null and receivedAmount != ''">
  46. and t.received_amount= #{receivedAmount}
  47. </if>
  48. <if test="communityId !=null and communityId != ''">
  49. and t.community_id= #{communityId}
  50. </if>
  51. <if test="bId !=null and bId != ''">
  52. and t.b_id= #{bId}
  53. </if>
  54. <if test="feeId !=null and feeId != ''">
  55. and t.fee_id= #{feeId}
  56. </if>
  57. </select>
  58. <!-- 保存费用明细信息至 instance表中 add by wuxw 2018-07-03 -->
  59. <insert id="saveFeeDetailInfoInstance" parameterType="Map">
  60. insert into
  61. pay_fee_detail(
  62. prime_rate,detail_id,receivable_amount,cycles,remark,status_cd,received_amount,community_id,b_id,fee_id,state,start_time,end_time)
  63. select
  64. t.prime_rate,t.detail_id,t.receivable_amount,t.cycles,t.remark,'0',t.received_amount,t.community_id,t.b_id,t.fee_id,state,t.start_time,t.end_time
  65. from business_pay_fee_detail t where 1=1
  66. and t.operate= 'ADD'
  67. <if test="primeRate !=null and primeRate != ''">
  68. and t.prime_rate= #{primeRate}
  69. </if>
  70. <if test="detailId !=null and detailId != ''">
  71. and t.detail_id= #{detailId}
  72. </if>
  73. <if test="receivableAmount !=null and receivableAmount != ''">
  74. and t.receivable_amount= #{receivableAmount}
  75. </if>
  76. <if test="cycles !=null and cycles != ''">
  77. and t.cycles= #{cycles}
  78. </if>
  79. <if test="remark !=null and remark != ''">
  80. and t.remark= #{remark}
  81. </if>
  82. <if test="receivedAmount !=null and receivedAmount != ''">
  83. and t.received_amount= #{receivedAmount}
  84. </if>
  85. <if test="communityId !=null and communityId != ''">
  86. and t.community_id= #{communityId}
  87. </if>
  88. <if test="bId !=null and bId != ''">
  89. and t.b_id= #{bId}
  90. </if>
  91. <if test="feeId !=null and feeId != ''">
  92. and t.fee_id= #{feeId}
  93. </if>
  94. </insert>
  95. <!-- 查询费用明细信息 add by wuxw 2018-07-03 -->
  96. <select id="getFeeDetailInfo" parameterType="Map" resultType="Map">
  97. select
  98. t.prime_rate,t.prime_rate primeRate,
  99. t.detail_id,t.detail_id detailId,
  100. t.receivable_amount,t.receivable_amount receivableAmount,
  101. t.cycles,t.remark,t.status_cd,t.status_cd statusCd,t.received_amount,t.received_amount receivedAmount,
  102. t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.fee_id,t.fee_id feeId ,t.create_time createTime,
  103. t.state,d.name stateName,t.start_time,t.end_time,t.start_time startTime,t.end_time endTime
  104. from pay_fee_detail t
  105. left join t_dict d on t.state = d.status_cd and d.table_name = 'pay_fee_detail' and d.table_columns = 'state'
  106. where 1 =1
  107. <if test="primeRate !=null and primeRate != ''">
  108. and t.prime_rate= #{primeRate}
  109. </if>
  110. <if test="detailId !=null and detailId != ''">
  111. and t.detail_id= #{detailId}
  112. </if>
  113. <if test="receivableAmount !=null and receivableAmount != ''">
  114. and t.receivable_amount= #{receivableAmount}
  115. </if>
  116. <if test="cycles !=null and cycles != ''">
  117. and t.cycles= #{cycles}
  118. </if>
  119. <if test="remark !=null and remark != ''">
  120. and t.remark= #{remark}
  121. </if>
  122. <if test="statusCd !=null and statusCd != ''">
  123. and t.status_cd= #{statusCd}
  124. </if>
  125. <if test="receivedAmount !=null and receivedAmount != ''">
  126. and t.received_amount= #{receivedAmount}
  127. </if>
  128. <if test="communityId !=null and communityId != ''">
  129. and t.community_id= #{communityId}
  130. </if>
  131. <if test="bId !=null and bId != ''">
  132. and t.b_id= #{bId}
  133. </if>
  134. <if test="feeId !=null and feeId != ''">
  135. and t.fee_id= #{feeId}
  136. </if>
  137. <if test="startTime !=null ">
  138. and t.create_time &gt;= #{startTime}
  139. </if>
  140. <if test="endTime !=null ">
  141. and t.create_time &lt;= #{endTime}
  142. </if>
  143. <if test="curYear != null and curYear != ''">
  144. and DATE_FORMAT(t.end_time,'%Y') = #{curYear}
  145. </if>
  146. order by t.create_time desc
  147. <if test="page != -1 and page != null ">
  148. limit #{page}, #{row}
  149. </if>
  150. </select>
  151. <!-- 修改费用明细信息 add by wuxw 2018-07-03 -->
  152. <update id="updateFeeDetailInfoInstance" parameterType="Map">
  153. update pay_fee_detail t set t.status_cd = #{statusCd}
  154. <if test="newBId != null and newBId != ''">
  155. ,t.b_id = #{newBId}
  156. </if>
  157. <if test="primeRate !=null and primeRate != ''">
  158. , t.prime_rate= #{primeRate}
  159. </if>
  160. <if test="receivableAmount !=null and receivableAmount != ''">
  161. , t.receivable_amount= #{receivableAmount}
  162. </if>
  163. <if test="cycles !=null and cycles != ''">
  164. , t.cycles= #{cycles}
  165. </if>
  166. <if test="remark !=null and remark != ''">
  167. , t.remark= #{remark}
  168. </if>
  169. <if test="receivedAmount !=null and receivedAmount != ''">
  170. , t.received_amount= #{receivedAmount}
  171. </if>
  172. <if test="communityId !=null and communityId != ''">
  173. , t.community_id= #{communityId}
  174. </if>
  175. <if test="state !=null and state != ''">
  176. , t.state= #{state}
  177. </if>
  178. <if test="feeId !=null and feeId != ''">
  179. , t.fee_id= #{feeId}
  180. </if>
  181. where 1=1
  182. <if test="detailId !=null and detailId != ''">
  183. and t.detail_id= #{detailId}
  184. </if>
  185. <if test="bId !=null and bId != ''">
  186. and t.b_id= #{bId}
  187. </if>
  188. </update>
  189. <!-- 查询费用明细数量 add by wuxw 2018-07-03 -->
  190. <select id="queryFeeDetailsCount" parameterType="Map" resultType="Map">
  191. select count(1) count
  192. from pay_fee_detail t
  193. where 1 =1
  194. <if test="primeRate !=null and primeRate != ''">
  195. and t.prime_rate= #{primeRate}
  196. </if>
  197. <if test="detailId !=null and detailId != ''">
  198. and t.detail_id= #{detailId}
  199. </if>
  200. <if test="receivableAmount !=null and receivableAmount != ''">
  201. and t.receivable_amount= #{receivableAmount}
  202. </if>
  203. <if test="cycles !=null and cycles != ''">
  204. and t.cycles= #{cycles}
  205. </if>
  206. <if test="remark !=null and remark != ''">
  207. and t.remark= #{remark}
  208. </if>
  209. <if test="statusCd !=null and statusCd != ''">
  210. and t.status_cd= #{statusCd}
  211. </if>
  212. <if test="receivedAmount !=null and receivedAmount != ''">
  213. and t.received_amount= #{receivedAmount}
  214. </if>
  215. <if test="communityId !=null and communityId != ''">
  216. and t.community_id= #{communityId}
  217. </if>
  218. <if test="bId !=null and bId != ''">
  219. and t.b_id= #{bId}
  220. </if>
  221. <if test="feeId !=null and feeId != ''">
  222. and t.fee_id= #{feeId}
  223. </if>
  224. <if test="startTime !=null ">
  225. and t.create_time &gt;= #{startTime}
  226. </if>
  227. <if test="endTime !=null ">
  228. and t.create_time &lt;= #{endTime}
  229. </if>
  230. <if test="curYear != null and curYear != ''">
  231. and DATE_FORMAT(t.end_time,'%Y') = #{curYear}
  232. </if>
  233. </select>
  234. <!-- 保存费用明细信息至 instance表中 add by wuxw 2018-07-03 -->
  235. <insert id="saveFeeDetail" parameterType="Map">
  236. insert into
  237. pay_fee_detail(
  238. prime_rate,detail_id,receivable_amount,cycles,remark,status_cd,received_amount,community_id,b_id,fee_id,state,start_time,end_time
  239. <if test="createTime != null and createTime != ''">
  240. ,create_time
  241. </if>
  242. )
  243. values(#{primeRate},#{detailId},#{receivableAmount},#{cycles},#{remark},'0',#{receivedAmount},#{communityId},'-1',#{feeId},#{state},
  244. #{startTime},#{endTime}
  245. <if test="createTime != null and createTime != ''">
  246. ,#{createTime}
  247. </if>
  248. )
  249. </insert>
  250. </mapper>