FeeConfigServiceDaoImplMapper.xml 14 KB

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