PayFeeRuleV1ServiceDaoImplMapper.xml 8.6 KB

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