PayFeeSubV1ServiceDaoImplMapper.xml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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="payFeeSubV1ServiceDaoImpl">
  6. <!-- 保存费用拆分信息 add by wuxw 2018-07-03 -->
  7. <insert id="savePayFeeSubInfo" parameterType="Map">
  8. insert into pay_fee_sub(
  9. max_time,amount,fee_type_cd,batch_id,fee_id,user_id,pre_fee_id,payer_obj_name,income_obj_id,config_id,fee_flag,start_time,end_time,community_id,payer_obj_type,payer_obj_id
  10. ) values (
  11. #{maxTime},#{amount},#{feeTypeCd},#{batchId},#{feeId},#{userId},#{preFeeId},#{payerObjName},#{incomeObjId},#{configId},#{feeFlag},#{startTime},#{endTime},#{communityId},#{payerObjType},#{payerObjId}
  12. )
  13. </insert>
  14. <!-- 查询费用拆分信息 add by wuxw 2018-07-03 -->
  15. <select id="getPayFeeSubInfo" parameterType="Map" resultType="Map">
  16. select t.max_time,t.max_time maxTime,t.amount,t.fee_type_cd,t.fee_type_cd feeTypeCd,t.status_cd,t.status_cd
  17. statusCd,t.batch_id,t.batch_id batchId,t.fee_id,t.fee_id feeId,t.user_id,t.user_id
  18. userId,t.pre_fee_id,t.pre_fee_id preFeeId,t.payer_obj_name,t.payer_obj_name
  19. payerObjName,t.income_obj_id,t.income_obj_id incomeObjId,t.config_id,t.config_id configId,t.fee_flag,t.fee_flag
  20. feeFlag,t.start_time,t.start_time startTime,t.end_time,t.end_time endTime,t.community_id,t.community_id
  21. communityId,t.payer_obj_type,t.payer_obj_type payerObjType,t.payer_obj_id,t.payer_obj_id payerObjId,pfc.fee_name feeName,t.create_time createTime
  22. from pay_fee_sub t
  23. left join pay_fee_config pfc on t.config_id = pfc.config_id
  24. where 1 =1
  25. <if test="maxTime !=null and maxTime != ''">
  26. and t.max_time= #{maxTime}
  27. </if>
  28. <if test="amount !=null and amount != ''">
  29. and t.amount= #{amount}
  30. </if>
  31. <if test="feeTypeCd !=null and feeTypeCd != ''">
  32. and t.fee_type_cd= #{feeTypeCd}
  33. </if>
  34. <if test="statusCd !=null and statusCd != ''">
  35. and t.status_cd= #{statusCd}
  36. </if>
  37. <if test="batchId !=null and batchId != ''">
  38. and t.batch_id= #{batchId}
  39. </if>
  40. <if test="feeId !=null and feeId != ''">
  41. and t.fee_id= #{feeId}
  42. </if>
  43. <if test="pcFeeId !=null and pcFeeId != ''">
  44. and (t.fee_id = #{pcFeeId} or t.pre_fee_id = #{pcFeeId})
  45. </if>
  46. <if test="preFeeId !=null and preFeeId != ''">
  47. and t.pre_fee_id= #{preFeeId}
  48. </if>
  49. <if test="payerObjName !=null and payerObjName != ''">
  50. and t.payer_obj_name= #{payerObjName}
  51. </if>
  52. <if test="incomeObjId !=null and incomeObjId != ''">
  53. and t.income_obj_id= #{incomeObjId}
  54. </if>
  55. <if test="configId !=null and configId != ''">
  56. and t.config_id= #{configId}
  57. </if>
  58. <if test="feeFlag !=null and feeFlag != ''">
  59. and t.fee_flag= #{feeFlag}
  60. </if>
  61. <if test="startTime !=null and startTime != ''">
  62. and t.start_time= #{startTime}
  63. </if>
  64. <if test="endTime !=null and endTime != ''">
  65. and t.end_time= #{endTime}
  66. </if>
  67. <if test="communityId !=null and communityId != ''">
  68. and t.community_id= #{communityId}
  69. </if>
  70. <if test="payerObjType !=null and payerObjType != ''">
  71. and t.payer_obj_type= #{payerObjType}
  72. </if>
  73. <if test="payerObjId !=null and payerObjId != ''">
  74. and t.payer_obj_id= #{payerObjId}
  75. </if>
  76. order by t.create_time desc
  77. <if test="page != -1 and page != null ">
  78. limit #{page}, #{row}
  79. </if>
  80. </select>
  81. <!-- 修改费用拆分信息 add by wuxw 2018-07-03 -->
  82. <update id="updatePayFeeSubInfo" parameterType="Map">
  83. update pay_fee_sub t set t.status_cd = #{statusCd}
  84. <if test="newBId != null and newBId != ''">
  85. ,t.b_id = #{newBId}
  86. </if>
  87. <if test="maxTime !=null and maxTime != ''">
  88. , t.max_time= #{maxTime}
  89. </if>
  90. <if test="amount !=null and amount != ''">
  91. , t.amount= #{amount}
  92. </if>
  93. <if test="feeTypeCd !=null and feeTypeCd != ''">
  94. , t.fee_type_cd= #{feeTypeCd}
  95. </if>
  96. <if test="batchId !=null and batchId != ''">
  97. , t.batch_id= #{batchId}
  98. </if>
  99. <if test="userId !=null and userId != ''">
  100. , t.user_id= #{userId}
  101. </if>
  102. <if test="payerObjName !=null and payerObjName != ''">
  103. , t.payer_obj_name= #{payerObjName}
  104. </if>
  105. <if test="incomeObjId !=null and incomeObjId != ''">
  106. , t.income_obj_id= #{incomeObjId}
  107. </if>
  108. <if test="configId !=null and configId != ''">
  109. , t.config_id= #{configId}
  110. </if>
  111. <if test="feeFlag !=null and feeFlag != ''">
  112. , t.fee_flag= #{feeFlag}
  113. </if>
  114. <if test="startTime !=null and startTime != ''">
  115. , t.start_time= #{startTime}
  116. </if>
  117. <if test="endTime !=null and endTime != ''">
  118. , t.end_time= #{endTime}
  119. </if>
  120. <if test="payerObjType !=null and payerObjType != ''">
  121. , t.payer_obj_type= #{payerObjType}
  122. </if>
  123. <if test="payerObjId !=null and payerObjId != ''">
  124. , t.payer_obj_id= #{payerObjId}
  125. </if>
  126. where 1=1
  127. <if test="feeId !=null and feeId != ''">
  128. and t.fee_id= #{feeId}
  129. </if>
  130. <if test="communityId !=null and communityId != ''">
  131. and t.community_id= #{communityId}
  132. </if>
  133. <if test="preFeeId !=null and preFeeId != ''">
  134. and t.pre_fee_id= #{preFeeId}
  135. </if>
  136. </update>
  137. <!-- 查询费用拆分数量 add by wuxw 2018-07-03 -->
  138. <select id="queryPayFeeSubsCount" parameterType="Map" resultType="Map">
  139. select count(1) count
  140. from pay_fee_sub t
  141. where 1 =1
  142. <if test="maxTime !=null and maxTime != ''">
  143. and t.max_time= #{maxTime}
  144. </if>
  145. <if test="amount !=null and amount != ''">
  146. and t.amount= #{amount}
  147. </if>
  148. <if test="feeTypeCd !=null and feeTypeCd != ''">
  149. and t.fee_type_cd= #{feeTypeCd}
  150. </if>
  151. <if test="statusCd !=null and statusCd != ''">
  152. and t.status_cd= #{statusCd}
  153. </if>
  154. <if test="batchId !=null and batchId != ''">
  155. and t.batch_id= #{batchId}
  156. </if>
  157. <if test="feeId !=null and feeId != ''">
  158. and t.fee_id= #{feeId}
  159. </if>
  160. <if test="pcFeeId !=null and pcFeeId != ''">
  161. and (t.fee_id = #{pcFeeId} or t.pre_fee_id = #{pcFeeId})
  162. </if>
  163. <if test="preFeeId !=null and preFeeId != ''">
  164. and t.pre_fee_id= #{preFeeId}
  165. </if>
  166. <if test="payerObjName !=null and payerObjName != ''">
  167. and t.payer_obj_name= #{payerObjName}
  168. </if>
  169. <if test="incomeObjId !=null and incomeObjId != ''">
  170. and t.income_obj_id= #{incomeObjId}
  171. </if>
  172. <if test="configId !=null and configId != ''">
  173. and t.config_id= #{configId}
  174. </if>
  175. <if test="feeFlag !=null and feeFlag != ''">
  176. and t.fee_flag= #{feeFlag}
  177. </if>
  178. <if test="startTime !=null and startTime != ''">
  179. and t.start_time= #{startTime}
  180. </if>
  181. <if test="endTime !=null and endTime != ''">
  182. and t.end_time= #{endTime}
  183. </if>
  184. <if test="communityId !=null and communityId != ''">
  185. and t.community_id= #{communityId}
  186. </if>
  187. <if test="payerObjType !=null and payerObjType != ''">
  188. and t.payer_obj_type= #{payerObjType}
  189. </if>
  190. <if test="payerObjId !=null and payerObjId != ''">
  191. and t.payer_obj_id= #{payerObjId}
  192. </if>
  193. </select>
  194. </mapper>