FeeServiceDaoImplMapper.xml 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  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="feeServiceDaoImpl">
  6. <!-- 保存费用信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessFeeInfo" parameterType="Map">
  8. insert into business_pay_fee(
  9. amount,operate,income_obj_id,fee_type_cd,start_time,end_time,community_id,b_id,fee_id,user_id,payer_obj_id
  10. ) values (
  11. #{amount},#{operate},#{incomeObjId},#{feeTypeCd},#{startTime},#{endTime},#{communityId},#{bId},#{feeId},#{userId},#{payerObjId}
  12. )
  13. </insert>
  14. <!-- 查询费用信息(Business) add by wuxw 2018-07-03 -->
  15. <select id="getBusinessFeeInfo" parameterType="Map" resultType="Map">
  16. select t.amount,t.operate,t.income_obj_id,t.income_obj_id incomeObjId,t.fee_type_cd,t.fee_type_cd
  17. feeTypeCd,t.start_time,t.start_time startTime,t.end_time,t.end_time endTime,t.community_id,t.community_id
  18. communityId,t.b_id,t.b_id bId,t.fee_id,t.fee_id feeId,t.user_id,t.user_id userId,t.payer_obj_id,t.payer_obj_id
  19. payerObjId
  20. from business_pay_fee t
  21. where 1 =1
  22. <if test="amount !=null and amount != ''">
  23. and t.amount= #{amount}
  24. </if>
  25. <if test="operate !=null and operate != ''">
  26. and t.operate= #{operate}
  27. </if>
  28. <if test="incomeObjId !=null and incomeObjId != ''">
  29. and t.income_obj_id= #{incomeObjId}
  30. </if>
  31. <if test="feeTypeCd !=null and feeTypeCd != ''">
  32. and t.fee_type_cd= #{feeTypeCd}
  33. </if>
  34. <if test="startTime !=null ">
  35. and t.start_time= #{startTime}
  36. </if>
  37. <if test="endTime !=null ">
  38. and t.end_time= #{endTime}
  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. <if test="userId !=null and userId != ''">
  50. and t.user_id= #{userId}
  51. </if>
  52. <if test="payerObjId !=null and payerObjId != ''">
  53. and t.payer_obj_id= #{payerObjId}
  54. </if>
  55. </select>
  56. <!-- 保存费用信息至 instance表中 add by wuxw 2018-07-03 -->
  57. <insert id="saveFeeInfoInstance" parameterType="Map">
  58. insert into pay_fee(
  59. amount,income_obj_id,fee_type_cd,start_time,status_cd,end_time,community_id,b_id,fee_id,user_id,payer_obj_id
  60. ) select
  61. t.amount,t.income_obj_id,t.fee_type_cd,t.start_time,'0',t.end_time,t.community_id,t.b_id,t.fee_id,t.user_id,t.payer_obj_id
  62. from business_pay_fee t where 1=1
  63. <if test="amount !=null and amount != ''">
  64. and t.amount= #{amount}
  65. </if>
  66. and t.operate= 'ADD'
  67. <if test="incomeObjId !=null and incomeObjId != ''">
  68. and t.income_obj_id= #{incomeObjId}
  69. </if>
  70. <if test="feeTypeCd !=null and feeTypeCd != ''">
  71. and t.fee_type_cd= #{feeTypeCd}
  72. </if>
  73. <if test="startTime !=null ">
  74. and t.start_time= #{startTime}
  75. </if>
  76. <if test="endTime !=null ">
  77. and t.end_time= #{endTime}
  78. </if>
  79. <if test="communityId !=null and communityId != ''">
  80. and t.community_id= #{communityId}
  81. </if>
  82. <if test="bId !=null and bId != ''">
  83. and t.b_id= #{bId}
  84. </if>
  85. <if test="feeId !=null and feeId != ''">
  86. and t.fee_id= #{feeId}
  87. </if>
  88. <if test="userId !=null and userId != ''">
  89. and t.user_id= #{userId}
  90. </if>
  91. <if test="payerObjId !=null and payerObjId != ''">
  92. and t.payer_obj_id= #{payerObjId}
  93. </if>
  94. </insert>
  95. <!-- 查询费用信息 add by wuxw 2018-07-03 -->
  96. <select id="getFeeInfo" parameterType="Map" resultType="Map">
  97. select t.amount,t.income_obj_id,t.income_obj_id incomeObjId,t.fee_type_cd,t.fee_type_cd
  98. feeTypeCd,t.start_time,t.start_time startTime,t.status_cd,t.status_cd statusCd,t.end_time,t.end_time
  99. endTime,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.fee_id,t.fee_id feeId,t.user_id,t.user_id
  100. userId,t.payer_obj_id,t.payer_obj_id payerObjId,pfc.square_price squarePrice,pfc.additional_amount additionalAmount
  101. from pay_fee t,pay_fee_config pfc
  102. where 1 =1
  103. and t.fee_type_cd = pfc.fee_type_cd
  104. and pfc.status_cd = '0'
  105. <if test="amount !=null and amount != ''">
  106. and t.amount= #{amount}
  107. </if>
  108. <if test="incomeObjId !=null and incomeObjId != ''">
  109. and t.income_obj_id= #{incomeObjId}
  110. </if>
  111. <if test="feeTypeCd !=null and feeTypeCd != ''">
  112. and t.fee_type_cd= #{feeTypeCd}
  113. </if>
  114. <if test="feeTypeCds != null ">
  115. and t.fee_type_cd in
  116. <foreach collection="feeTypeCds" item="item" open="(" close=")" separator=",">
  117. #{item}
  118. </foreach>
  119. </if>
  120. <if test="startTime !=null ">
  121. and t.start_time= #{startTime}
  122. </if>
  123. <if test="statusCd !=null and statusCd != ''">
  124. and t.status_cd= #{statusCd}
  125. </if>
  126. <if test="endTime !=null ">
  127. and t.end_time= #{endTime}
  128. </if>
  129. <if test="arrearsEndTime != null">
  130. and t.end_time &lt; #{arrearsEndTime}
  131. </if>
  132. <if test="communityId !=null and communityId != ''">
  133. and t.community_id= #{communityId}
  134. </if>
  135. <if test="bId !=null and bId != ''">
  136. and t.b_id= #{bId}
  137. </if>
  138. <if test="feeId !=null and feeId != ''">
  139. and t.fee_id= #{feeId}
  140. </if>
  141. <if test="userId !=null and userId != ''">
  142. and t.user_id= #{userId}
  143. </if>
  144. <if test="payerObjId !=null and payerObjId != ''">
  145. and t.payer_obj_id= #{payerObjId}
  146. </if>
  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="updateFeeInfoInstance" parameterType="Map">
  153. update pay_fee t set t.status_cd = #{statusCd}
  154. <if test="newBId != null and newBId != ''">
  155. ,t.b_id = #{newBId}
  156. </if>
  157. <if test="amount !=null and amount != ''">
  158. , t.amount= #{amount}
  159. </if>
  160. <if test="incomeObjId !=null and incomeObjId != ''">
  161. , t.income_obj_id= #{incomeObjId}
  162. </if>
  163. <if test="feeTypeCd !=null and feeTypeCd != ''">
  164. , t.fee_type_cd= #{feeTypeCd}
  165. </if>
  166. <if test="startTime !=null ">
  167. , t.start_time= #{startTime}
  168. </if>
  169. <if test="endTime !=null">
  170. , t.end_time= #{endTime}
  171. </if>
  172. <if test="communityId !=null and communityId != ''">
  173. , t.community_id= #{communityId}
  174. </if>
  175. <if test="userId !=null and userId != ''">
  176. , t.user_id= #{userId}
  177. </if>
  178. <if test="payerObjId !=null and payerObjId != ''">
  179. , t.payer_obj_id= #{payerObjId}
  180. </if>
  181. where 1=1
  182. <if test="bId !=null and bId != ''">
  183. and t.b_id= #{bId}
  184. </if>
  185. <if test="feeId !=null and feeId != ''">
  186. and t.fee_id= #{feeId}
  187. </if>
  188. </update>
  189. <!-- 查询费用数量 add by wuxw 2018-07-03 -->
  190. <select id="queryFeesCount" parameterType="Map" resultType="Map">
  191. select count(1) count
  192. from pay_fee t,pay_fee_config pfc
  193. where 1 =1
  194. and t.fee_type_cd = pfc.fee_type_cd
  195. and pfc.status_cd = '0'
  196. <if test="amount !=null and amount != ''">
  197. and t.amount= #{amount}
  198. </if>
  199. <if test="incomeObjId !=null and incomeObjId != ''">
  200. and t.income_obj_id= #{incomeObjId}
  201. </if>
  202. <if test="feeTypeCd !=null and feeTypeCd != ''">
  203. and t.fee_type_cd= #{feeTypeCd}
  204. </if>
  205. <if test="feeTypeCds != null ">
  206. and t.fee_type_cd in
  207. <foreach collection="feeTypeCds" item="item" open="(" close=")" separator=",">
  208. #{item}
  209. </foreach>
  210. </if>
  211. <if test="startTime !=null">
  212. and t.start_time= #{startTime}
  213. </if>
  214. <if test="statusCd !=null and statusCd != ''">
  215. and t.status_cd= #{statusCd}
  216. </if>
  217. <if test="endTime !=null ">
  218. and t.end_time= #{endTime}
  219. </if>
  220. <if test="arrearsEndTime != null">
  221. and t.end_time &lt; #{arrearsEndTime}
  222. </if>
  223. <if test="communityId !=null and communityId != ''">
  224. and t.community_id= #{communityId}
  225. </if>
  226. <if test="bId !=null and bId != ''">
  227. and t.b_id= #{bId}
  228. </if>
  229. <if test="feeId !=null and feeId != ''">
  230. and t.fee_id= #{feeId}
  231. </if>
  232. <if test="userId !=null and userId != ''">
  233. and t.user_id= #{userId}
  234. </if>
  235. <if test="payerObjId !=null and payerObjId != ''">
  236. and t.payer_obj_id= #{payerObjId}
  237. </if>
  238. </select>
  239. </mapper>