FeeConfigServiceDaoImplMapper.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  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="feeConfigServiceDaoImpl">
  6. <!-- 保存费用配置信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessFeeConfigInfo" parameterType="Map">
  8. insert into business_pay_fee_config(
  9. fee_type_cd,computing_formula,additional_amount,square_price,is_default,operate,config_id,fee_flag,fee_name,
  10. start_time,end_time,community_id,b_id,bill_type,payment_cd,payment_cycle
  11. ) values (
  12. #{feeTypeCd},#{computingFormula},#{additionalAmount},#{squarePrice},#{isDefault},#{operate},#{configId},
  13. #{feeFlag},#{feeName},#{startTime},#{endTime},#{communityId},#{bId},#{billType},#{paymentCd},#{paymentCycle}
  14. )
  15. </insert>
  16. <!-- 查询费用配置信息(Business) add by wuxw 2018-07-03 -->
  17. <select id="getBusinessFeeConfigInfo" parameterType="Map" resultType="Map">
  18. select t.fee_type_cd,t.fee_type_cd feeTypeCd,t.computing_formula,t.computing_formula
  19. computingFormula,t.additional_amount,t.additional_amount additionalAmount,t.square_price,t.square_price
  20. squarePrice,t.is_default,t.is_default isDefault,t.operate,t.config_id,t.config_id configId,t.fee_flag,t.fee_flag
  21. feeFlag,t.fee_name,t.fee_name feeName,t.start_time,t.start_time startTime,t.end_time,t.end_time
  22. endTime,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.bill_type,t.bill_type billType,
  23. t.payment_cd,t.payment_cycle
  24. from business_pay_fee_config t
  25. where 1 =1
  26. <if test="feeTypeCd !=null and feeTypeCd != ''">
  27. and t.fee_type_cd= #{feeTypeCd}
  28. </if>
  29. <if test="computingFormula !=null and computingFormula != ''">
  30. and t.computing_formula= #{computingFormula}
  31. </if>
  32. <if test="additionalAmount !=null and additionalAmount != '' or additionalAmount == 0">
  33. and t.additional_amount= #{additionalAmount}
  34. </if>
  35. <if test="squarePrice !=null and squarePrice != '' or squarePrice == 0">
  36. and t.square_price= #{squarePrice}
  37. </if>
  38. <if test="isDefault !=null and isDefault != ''">
  39. and t.is_default= #{isDefault}
  40. </if>
  41. <if test="operate !=null and operate != ''">
  42. and t.operate= #{operate}
  43. </if>
  44. <if test="configId !=null and configId != ''">
  45. and t.config_id= #{configId}
  46. </if>
  47. <if test="feeFlag !=null and feeFlag != ''">
  48. and t.fee_flag= #{feeFlag}
  49. </if>
  50. <if test="feeName !=null and feeName != ''">
  51. and t.fee_name= #{feeName}
  52. </if>
  53. <if test="billType !=null and billType != ''">
  54. and t.bill_type= #{billType}
  55. </if>
  56. <if test="startTime !=null ">
  57. and t.start_time= #{startTime}
  58. </if>
  59. <if test="endTime !=null ">
  60. and t.end_time= #{endTime}
  61. </if>
  62. <if test="communityId !=null and communityId != ''">
  63. and t.community_id= #{communityId}
  64. </if>
  65. <if test="bId !=null and bId != ''">
  66. and t.b_id= #{bId}
  67. </if>
  68. </select>
  69. <!-- 保存费用配置信息至 instance表中 add by wuxw 2018-07-03 -->
  70. <insert id="saveFeeConfigInfoInstance" parameterType="Map">
  71. insert into pay_fee_config(
  72. fee_type_cd,computing_formula,additional_amount,status_cd,square_price,is_default,config_id,fee_flag,fee_name,
  73. start_time,end_time,community_id,b_id,bill_type,payment_cd,payment_cycle
  74. ) select
  75. t.fee_type_cd,t.computing_formula,t.additional_amount,'0',t.square_price,t.is_default,t.config_id,t.fee_flag,t.fee_name,
  76. t.start_time,t.end_time,t.community_id,
  77. t.b_id,t.bill_type,t.payment_cd,t.payment_cycle
  78. from business_pay_fee_config t where 1=1
  79. <if test="feeTypeCd !=null and feeTypeCd != ''">
  80. and t.fee_type_cd= #{feeTypeCd}
  81. </if>
  82. <if test="computingFormula !=null and computingFormula != ''">
  83. and t.computing_formula= #{computingFormula}
  84. </if>
  85. <if test="additionalAmount !=null and additionalAmount != ''">
  86. and t.additional_amount= #{additionalAmount}
  87. </if>
  88. <if test="squarePrice !=null and squarePrice != ''">
  89. and t.square_price= #{squarePrice}
  90. </if>
  91. <if test="isDefault !=null and isDefault != ''">
  92. and t.is_default= #{isDefault}
  93. </if>
  94. and t.operate= 'ADD'
  95. <if test="configId !=null and configId != ''">
  96. and t.config_id= #{configId}
  97. </if>
  98. <if test="feeFlag !=null and feeFlag != ''">
  99. and t.fee_flag= #{feeFlag}
  100. </if>
  101. <if test="feeName !=null and feeName != ''">
  102. and t.fee_name= #{feeName}
  103. </if>
  104. <if test="billType !=null and billType != ''">
  105. and t.bill_type= #{billType}
  106. </if>
  107. <if test="startTime !=null ">
  108. and t.start_time= #{startTime}
  109. </if>
  110. <if test="endTime !=null ">
  111. and t.end_time= #{endTime}
  112. </if>
  113. <if test="communityId !=null and communityId != ''">
  114. and t.community_id= #{communityId}
  115. </if>
  116. <if test="bId !=null and bId != ''">
  117. and t.b_id= #{bId}
  118. </if>
  119. </insert>
  120. <!-- 查询费用配置信息 add by wuxw 2018-07-03 -->
  121. <select id="getFeeConfigInfo" parameterType="Map" resultType="Map">
  122. select t.fee_type_cd,t.fee_type_cd feeTypeCd,t.computing_formula,t.computing_formula
  123. computingFormula,t.additional_amount,t.additional_amount additionalAmount,t.status_cd,t.status_cd
  124. statusCd,t.square_price,t.square_price squarePrice,t.is_default,t.is_default isDefault,t.config_id,t.config_id
  125. configId,t.fee_flag,t.fee_flag feeFlag,t.fee_name,t.fee_name feeName,t.start_time,t.start_time
  126. startTime,t.end_time,t.end_time endTime,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,
  127. td1.name feeTypeCdName,td2.name feeFlagName,t.bill_type billType,t.bill_type,td3.name billTypeName,
  128. t.payment_cd,t.payment_cycle,t.payment_cd paymentCd,t.payment_cycle paymentCycle
  129. from pay_fee_config t,t_dict td1,t_dict td2,t_dict td3
  130. where 1 =1
  131. and t.fee_type_cd = td1.status_cd
  132. and td1.table_name = 'pay_fee_config'
  133. and td1.table_columns = 'fee_type_cd'
  134. and t.fee_flag = td2.status_cd
  135. and td2.table_name = 'pay_fee_config'
  136. and td2.table_columns = 'fee_flag'
  137. and t.bill_type = td3.status_cd
  138. and td3.table_name = 'pay_fee_config'
  139. and td3.table_columns = 'bill_type'
  140. <if test="feeTypeCd !=null and feeTypeCd != ''">
  141. and t.fee_type_cd= #{feeTypeCd}
  142. </if>
  143. <if test="computingFormula !=null and computingFormula != ''">
  144. and t.computing_formula= #{computingFormula}
  145. </if>
  146. <if test="additionalAmount !=null and additionalAmount != ''">
  147. and t.additional_amount= #{additionalAmount}
  148. </if>
  149. <if test="statusCd !=null and statusCd != ''">
  150. and t.status_cd= #{statusCd}
  151. </if>
  152. <if test="squarePrice !=null and squarePrice != ''">
  153. and t.square_price= #{squarePrice}
  154. </if>
  155. <if test="isDefault !=null and isDefault != ''">
  156. and t.is_default= #{isDefault}
  157. </if>
  158. <if test="configId !=null and configId != ''">
  159. and t.config_id= #{configId}
  160. </if>
  161. <if test="feeFlag !=null and feeFlag != ''">
  162. and t.fee_flag= #{feeFlag}
  163. </if>
  164. <if test="feeName !=null and feeName != ''">
  165. and t.fee_name= #{feeName}
  166. </if>
  167. <if test="startTime !=null ">
  168. and t.start_time= #{startTime}
  169. </if>
  170. <if test="endTime !=null ">
  171. and t.end_time= #{endTime}
  172. </if>
  173. <if test="valid !=null and valid == 1">
  174. and t.end_time &gt; now()
  175. </if>
  176. <if test="curTime !=null ">
  177. and t.end_time &gt; #{curTime}
  178. and t.start_time &lt; #{curTime}
  179. </if>
  180. <if test="communityId !=null and communityId != ''">
  181. and t.community_id= #{communityId}
  182. </if>
  183. <if test="bId !=null and bId != ''">
  184. and t.b_id= #{bId}
  185. </if>
  186. <if test="paymentCd !=null and paymentCd != ''">
  187. and t.payment_cd= #{paymentCd}
  188. </if>
  189. <if test="paymentCycle !=null and paymentCycle != ''">
  190. and t.payment_cycle= #{paymentCycle}
  191. </if>
  192. <if test="billType !=null and billType != ''">
  193. and t.bill_type= #{billType}
  194. </if>
  195. order by t.create_time desc
  196. <if test="page != -1 and page != null ">
  197. limit #{page}, #{row}
  198. </if>
  199. </select>
  200. <!-- 修改费用配置信息 add by wuxw 2018-07-03 -->
  201. <update id="updateFeeConfigInfoInstance" parameterType="Map">
  202. update pay_fee_config t set t.status_cd = #{statusCd}
  203. <if test="newBId != null and newBId != ''">
  204. ,t.b_id = #{newBId}
  205. </if>
  206. <if test="feeTypeCd !=null and feeTypeCd != ''">
  207. , t.fee_type_cd= #{feeTypeCd}
  208. </if>
  209. <if test="computingFormula !=null and computingFormula != ''">
  210. , t.computing_formula= #{computingFormula}
  211. </if>
  212. <if test="additionalAmount !=null and additionalAmount != '' or additionalAmount == 0">
  213. , t.additional_amount= #{additionalAmount}
  214. </if>
  215. <if test="squarePrice !=null and squarePrice != '' or squarePrice == 0">
  216. , t.square_price= #{squarePrice}
  217. </if>
  218. <if test="paymentCd !=null and paymentCd != ''">
  219. , t.payment_cd= #{paymentCd}
  220. </if>
  221. <if test="paymentCycle !=null and paymentCycle != ''">
  222. , t.payment_cycle= #{paymentCycle}
  223. </if>
  224. <if test="isDefault !=null and isDefault != ''">
  225. , t.is_default= #{isDefault}
  226. </if>
  227. <if test="feeFlag !=null and feeFlag != ''">
  228. , t.fee_flag= #{feeFlag}
  229. </if>
  230. <if test="feeName !=null and feeName != ''">
  231. , t.fee_name= #{feeName}
  232. </if>
  233. <if test="billType !=null and billType != ''">
  234. , t.bill_type= #{billType}
  235. </if>
  236. <if test="startTime !=null ">
  237. , t.start_time= #{startTime}
  238. </if>
  239. <if test="endTime !=null ">
  240. , t.end_time= #{endTime}
  241. </if>
  242. <if test="communityId !=null and communityId != ''">
  243. , t.community_id= #{communityId}
  244. </if>
  245. where 1=1
  246. <if test="configId !=null and configId != ''">
  247. and t.config_id= #{configId}
  248. </if>
  249. <if test="bId !=null and bId != ''">
  250. and t.b_id= #{bId}
  251. </if>
  252. </update>
  253. <!-- 查询费用配置数量 add by wuxw 2018-07-03 -->
  254. <select id="queryFeeConfigsCount" parameterType="Map" resultType="Map">
  255. select count(1) count
  256. from pay_fee_config t,t_dict td1,t_dict td2,t_dict td3
  257. where 1 =1
  258. and t.fee_type_cd = td1.status_cd
  259. and td1.table_name = 'pay_fee_config'
  260. and td1.table_columns = 'fee_type_cd'
  261. and t.fee_flag = td2.status_cd
  262. and td2.table_name = 'pay_fee_config'
  263. and td2.table_columns = 'fee_flag'
  264. and t.bill_type = td3.status_cd
  265. and td3.table_name = 'pay_fee_config'
  266. and td3.table_columns = 'bill_type'
  267. <if test="feeTypeCd !=null and feeTypeCd != ''">
  268. and t.fee_type_cd= #{feeTypeCd}
  269. </if>
  270. <if test="computingFormula !=null and computingFormula != ''">
  271. and t.computing_formula= #{computingFormula}
  272. </if>
  273. <if test="additionalAmount !=null and additionalAmount != ''">
  274. and t.additional_amount= #{additionalAmount}
  275. </if>
  276. <if test="statusCd !=null and statusCd != ''">
  277. and t.status_cd= #{statusCd}
  278. </if>
  279. <if test="squarePrice !=null and squarePrice != ''">
  280. and t.square_price= #{squarePrice}
  281. </if>
  282. <if test="isDefault !=null and isDefault != ''">
  283. and t.is_default= #{isDefault}
  284. </if>
  285. <if test="configId !=null and configId != ''">
  286. and t.config_id= #{configId}
  287. </if>
  288. <if test="feeFlag !=null and feeFlag != ''">
  289. and t.fee_flag= #{feeFlag}
  290. </if>
  291. <if test="feeName !=null and feeName != ''">
  292. and t.fee_name= #{feeName}
  293. </if>
  294. <if test="startTime !=null ">
  295. and t.start_time= #{startTime}
  296. </if>
  297. <if test="endTime !=null ">
  298. and t.end_time= #{endTime}
  299. </if>
  300. <if test="valid !=null and valid == 1">
  301. and t.end_time &gt; now()
  302. </if>
  303. <if test="communityId !=null and communityId != ''">
  304. and t.community_id= #{communityId}
  305. </if>
  306. <if test="bId !=null and bId != ''">
  307. and t.b_id= #{bId}
  308. </if>
  309. <if test="paymentCd !=null and paymentCd != ''">
  310. and t.payment_cd= #{paymentCd}
  311. </if>
  312. <if test="paymentCycle !=null and paymentCycle != ''">
  313. and t.payment_cycle= #{paymentCycle}
  314. </if>
  315. <if test="billType !=null and billType != ''">
  316. and t.bill_type= #{billType}
  317. </if>
  318. </select>
  319. <!-- 保存费用配置信息 add by wuxw 2018-07-03 -->
  320. <insert id="saveFeeConfig" parameterType="Map">
  321. insert into pay_fee_config(
  322. fee_type_cd,computing_formula,additional_amount,status_cd,square_price,is_default,config_id,fee_flag,fee_name,
  323. start_time,end_time,community_id,b_id,bill_type,payment_cd,payment_cycle
  324. ) values (
  325. #{feeTypeCd},#{computingFormula},#{additionalAmount},'0',#{squarePrice},#{isDefault},#{configId},
  326. #{feeFlag},#{feeName},#{startTime},#{endTime},#{communityId},'-1',#{billType},#{paymentCd},#{paymentCycle}
  327. )
  328. </insert>
  329. </mapper>