FeeDetailServiceDaoImplMapper.xml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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 business_pay_fee_detail(
  9. operate,prime_rate,detail_id,receivable_amount,cycles,remark,received_amount,community_id,b_id,fee_id
  10. ) values (
  11. #{operate},#{primeRate},#{detailId},#{receivableAmount},#{cycles},#{remark},#{receivedAmount},#{communityId},#{bId},#{feeId}
  12. )
  13. </insert>
  14. <!-- 查询费用明细信息(Business) add by wuxw 2018-07-03 -->
  15. <select id="getBusinessFeeDetailInfo" parameterType="Map" resultType="Map">
  16. select t.operate,t.prime_rate,t.prime_rate primeRate,t.detail_id,t.detail_id detailId,t.receivable_amount,t.receivable_amount receivableAmount,t.cycles,t.remark,t.received_amount,t.received_amount receivedAmount,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.fee_id,t.fee_id feeId
  17. from business_pay_fee_detail t
  18. where 1 =1
  19. <if test="operate !=null and operate != ''">
  20. and t.operate= #{operate}
  21. </if>
  22. <if test="primeRate !=null and primeRate != ''">
  23. and t.prime_rate= #{primeRate}
  24. </if>
  25. <if test="detailId !=null and detailId != ''">
  26. and t.detail_id= #{detailId}
  27. </if>
  28. <if test="receivableAmount !=null and receivableAmount != ''">
  29. and t.receivable_amount= #{receivableAmount}
  30. </if>
  31. <if test="cycles !=null and cycles != ''">
  32. and t.cycles= #{cycles}
  33. </if>
  34. <if test="remark !=null and remark != ''">
  35. and t.remark= #{remark}
  36. </if>
  37. <if test="receivedAmount !=null and receivedAmount != ''">
  38. and t.received_amount= #{receivedAmount}
  39. </if>
  40. <if test="communityId !=null and communityId != ''">
  41. and t.community_id= #{communityId}
  42. </if>
  43. <if test="bId !=null and bId != ''">
  44. and t.b_id= #{bId}
  45. </if>
  46. <if test="feeId !=null and feeId != ''">
  47. and t.fee_id= #{feeId}
  48. </if>
  49. </select>
  50. <!-- 保存费用明细信息至 instance表中 add by wuxw 2018-07-03 -->
  51. <insert id="saveFeeDetailInfoInstance" parameterType="Map">
  52. insert into pay_fee_detail(
  53. prime_rate,detail_id,receivable_amount,cycles,remark,status_cd,received_amount,community_id,b_id,fee_id
  54. ) select 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 from business_pay_fee_detail t where 1=1
  55. and t.operate= 'ADD'
  56. <if test="primeRate !=null and primeRate != ''">
  57. and t.prime_rate= #{primeRate}
  58. </if>
  59. <if test="detailId !=null and detailId != ''">
  60. and t.detail_id= #{detailId}
  61. </if>
  62. <if test="receivableAmount !=null and receivableAmount != ''">
  63. and t.receivable_amount= #{receivableAmount}
  64. </if>
  65. <if test="cycles !=null and cycles != ''">
  66. and t.cycles= #{cycles}
  67. </if>
  68. <if test="remark !=null and remark != ''">
  69. and t.remark= #{remark}
  70. </if>
  71. <if test="receivedAmount !=null and receivedAmount != ''">
  72. and t.received_amount= #{receivedAmount}
  73. </if>
  74. <if test="communityId !=null and communityId != ''">
  75. and t.community_id= #{communityId}
  76. </if>
  77. <if test="bId !=null and bId != ''">
  78. and t.b_id= #{bId}
  79. </if>
  80. <if test="feeId !=null and feeId != ''">
  81. and t.fee_id= #{feeId}
  82. </if>
  83. </insert>
  84. <!-- 查询费用明细信息 add by wuxw 2018-07-03 -->
  85. <select id="getFeeDetailInfo" parameterType="Map" resultType="Map">
  86. select t.prime_rate,t.prime_rate primeRate,t.detail_id,t.detail_id detailId,t.receivable_amount,t.receivable_amount receivableAmount,
  87. t.cycles,t.remark,t.status_cd,t.status_cd statusCd,t.received_amount,t.received_amount receivedAmount,t.community_id,
  88. t.community_id communityId,t.b_id,t.b_id bId,t.fee_id,t.fee_id feeId ,t.create_time createTime
  89. from pay_fee_detail t
  90. where 1 =1
  91. <if test="primeRate !=null and primeRate != ''">
  92. and t.prime_rate= #{primeRate}
  93. </if>
  94. <if test="detailId !=null and detailId != ''">
  95. and t.detail_id= #{detailId}
  96. </if>
  97. <if test="receivableAmount !=null and receivableAmount != ''">
  98. and t.receivable_amount= #{receivableAmount}
  99. </if>
  100. <if test="cycles !=null and cycles != ''">
  101. and t.cycles= #{cycles}
  102. </if>
  103. <if test="remark !=null and remark != ''">
  104. and t.remark= #{remark}
  105. </if>
  106. <if test="statusCd !=null and statusCd != ''">
  107. and t.status_cd= #{statusCd}
  108. </if>
  109. <if test="receivedAmount !=null and receivedAmount != ''">
  110. and t.received_amount= #{receivedAmount}
  111. </if>
  112. <if test="communityId !=null and communityId != ''">
  113. and t.community_id= #{communityId}
  114. </if>
  115. <if test="bId !=null and bId != ''">
  116. and t.b_id= #{bId}
  117. </if>
  118. <if test="feeId !=null and feeId != ''">
  119. and t.fee_id= #{feeId}
  120. </if>
  121. <if test="startTime !=null ">
  122. and t.create_time &gt;= #{startTime}
  123. </if>
  124. <if test="endTime !=null ">
  125. and t.create_time &lt;= #{endTime}
  126. </if>
  127. order by t.create_time desc
  128. <if test="page != -1 and page != null ">
  129. limit #{page}, #{row}
  130. </if>
  131. </select>
  132. <!-- 修改费用明细信息 add by wuxw 2018-07-03 -->
  133. <update id="updateFeeDetailInfoInstance" parameterType="Map">
  134. update pay_fee_detail t set t.status_cd = #{statusCd}
  135. <if test="newBId != null and newBId != ''">
  136. ,t.b_id = #{newBId}
  137. </if>
  138. <if test="primeRate !=null and primeRate != ''">
  139. , t.prime_rate= #{primeRate}
  140. </if>
  141. <if test="receivableAmount !=null and receivableAmount != ''">
  142. , t.receivable_amount= #{receivableAmount}
  143. </if>
  144. <if test="cycles !=null and cycles != ''">
  145. , t.cycles= #{cycles}
  146. </if>
  147. <if test="remark !=null and remark != ''">
  148. , t.remark= #{remark}
  149. </if>
  150. <if test="receivedAmount !=null and receivedAmount != ''">
  151. , t.received_amount= #{receivedAmount}
  152. </if>
  153. <if test="communityId !=null and communityId != ''">
  154. , t.community_id= #{communityId}
  155. </if>
  156. <if test="feeId !=null and feeId != ''">
  157. , t.fee_id= #{feeId}
  158. </if>
  159. where 1=1 <if test="detailId !=null and detailId != ''">
  160. and t.detail_id= #{detailId}
  161. </if>
  162. <if test="bId !=null and bId != ''">
  163. and t.b_id= #{bId}
  164. </if>
  165. </update>
  166. <!-- 查询费用明细数量 add by wuxw 2018-07-03 -->
  167. <select id="queryFeeDetailsCount" parameterType="Map" resultType="Map">
  168. select count(1) count
  169. from pay_fee_detail t
  170. where 1 =1
  171. <if test="primeRate !=null and primeRate != ''">
  172. and t.prime_rate= #{primeRate}
  173. </if>
  174. <if test="detailId !=null and detailId != ''">
  175. and t.detail_id= #{detailId}
  176. </if>
  177. <if test="receivableAmount !=null and receivableAmount != ''">
  178. and t.receivable_amount= #{receivableAmount}
  179. </if>
  180. <if test="cycles !=null and cycles != ''">
  181. and t.cycles= #{cycles}
  182. </if>
  183. <if test="remark !=null and remark != ''">
  184. and t.remark= #{remark}
  185. </if>
  186. <if test="statusCd !=null and statusCd != ''">
  187. and t.status_cd= #{statusCd}
  188. </if>
  189. <if test="receivedAmount !=null and receivedAmount != ''">
  190. and t.received_amount= #{receivedAmount}
  191. </if>
  192. <if test="communityId !=null and communityId != ''">
  193. and t.community_id= #{communityId}
  194. </if>
  195. <if test="bId !=null and bId != ''">
  196. and t.b_id= #{bId}
  197. </if>
  198. <if test="feeId !=null and feeId != ''">
  199. and t.fee_id= #{feeId}
  200. </if>
  201. <if test="startTime !=null ">
  202. and t.create_time &gt;= #{startTime}
  203. </if>
  204. <if test="endTime !=null ">
  205. and t.create_time &lt;= #{endTime}
  206. </if>
  207. </select>
  208. </mapper>