PayFeeDetailMonthServiceDaoImplMapper.xml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  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="payFeeDetailMonthServiceDaoImpl">
  6. <!-- 保存月缴费表信息 add by wuxw 2018-07-03 -->
  7. <insert id="savePayFeeDetailMonthInfo" parameterType="Map">
  8. insert into pay_fee_detail_month(
  9. detail_month,detail_year,detail_id,receivable_amount,discount_amount,remark,received_amount,community_id,fee_id,month_id,
  10. obj_name,obj_id,owner_name,owner_id,link,state,pay_fee_time,cur_month_time,
  11. fee_name,config_id
  12. ) values (
  13. #{detailMonth},#{detailYear},#{detailId},#{receivableAmount},#{discountAmount},#{remark},#{receivedAmount},#{communityId},#{feeId},#{monthId},
  14. #{objName},#{objId},#{ownerName},#{ownerId},#{link},#{state},#{payFeeTime},#{curMonthTime},
  15. #{feeName},#{configId}
  16. )
  17. </insert>
  18. <!-- 保存月缴费表信息 add by wuxw 2018-07-03 -->
  19. <insert id="savePayFeeDetailMonthInfos" parameterType="Map">
  20. insert into pay_fee_detail_month(
  21. detail_month,detail_year,detail_id,receivable_amount,discount_amount,remark,received_amount,community_id,fee_id,month_id,
  22. obj_name,obj_id,owner_name,owner_id,link,state,pay_fee_time,cur_month_time,
  23. fee_name,config_id,deadline_time
  24. ) values
  25. <foreach collection="payFeeDetailMonthPos" item="item" index="index" separator=",">
  26. (
  27. #{item.detailMonth},#{item.detailYear},#{item.detailId},#{item.receivableAmount},#{item.discountAmount},
  28. #{item.remark},#{item.receivedAmount},#{item.communityId},#{item.feeId},#{item.monthId},
  29. #{item.objName},#{item.objId},#{item.ownerName},#{item.ownerId},#{item.link},#{item.state},#{item.payFeeTime},#{item.curMonthTime},
  30. #{item.feeName},#{item.configId},#{item.deadlineTime}
  31. )
  32. </foreach>
  33. </insert>
  34. <!-- 查询月缴费表信息 add by wuxw 2018-07-03 -->
  35. <select id="getPayFeeDetailMonthInfo" parameterType="Map" resultType="Map">
  36. select t.detail_month,t.detail_month detailMonth,t.detail_year,t.detail_year detailYear,t.detail_id,t.detail_id
  37. detailId,t.receivable_amount,t.receivable_amount receivableAmount,t.discount_amount,t.discount_amount
  38. discountAmount,t.remark,t.status_cd,t.status_cd statusCd,t.received_amount,t.received_amount
  39. receivedAmount,t.community_id,t.community_id communityId,t.fee_id,t.fee_id feeId,t.month_id,t.month_id monthId,
  40. t.obj_name objName,t.obj_id objId,t.owner_name ownerName,t.owner_id ownerId,t.link,t.state,t.pay_fee_time
  41. payFeeTime,
  42. t.cur_month_time curMonthTime,t.deadline_time deadlineTime
  43. from pay_fee_detail_month t
  44. where 1 =1
  45. <if test="detailMonth !=null and detailMonth != ''">
  46. and t.detail_month= #{detailMonth}
  47. </if>
  48. <if test="detailYear !=null and detailYear != ''">
  49. and t.detail_year= #{detailYear}
  50. </if>
  51. <if test="detailId !=null and detailId != ''">
  52. and t.detail_id= #{detailId}
  53. </if>
  54. <if test="receivableAmount !=null and receivableAmount != ''">
  55. and t.receivable_amount= #{receivableAmount}
  56. </if>
  57. <if test="discountAmount !=null and discountAmount != ''">
  58. and t.discount_amount= #{discountAmount}
  59. </if>
  60. <if test="remark !=null and remark != ''">
  61. and t.remark= #{remark}
  62. </if>
  63. <if test="statusCd !=null and statusCd != ''">
  64. and t.status_cd= #{statusCd}
  65. </if>
  66. <if test="receivedAmount !=null and receivedAmount != ''">
  67. and t.received_amount= #{receivedAmount}
  68. </if>
  69. <if test="communityId !=null and communityId != ''">
  70. and t.community_id= #{communityId}
  71. </if>
  72. <if test="feeId !=null and feeId != ''">
  73. and t.fee_id= #{feeId}
  74. </if>
  75. <if test="monthId !=null and monthId != ''">
  76. and t.month_id= #{monthId}
  77. </if>
  78. <if test="objName !=null and objName != ''">
  79. and t.obj_name= #{objName}
  80. </if>
  81. <if test="objId !=null and objId != ''">
  82. and t.obj_id= #{objId}
  83. </if>
  84. <if test="ownerName !=null and ownerName != ''">
  85. and t.owner_name= #{ownerName}
  86. </if>
  87. <if test="ownerId !=null and ownerId != ''">
  88. and t.owner_id= #{ownerId}
  89. </if>
  90. <if test="state !=null and state != ''">
  91. and t.state= #{state}
  92. </if>
  93. <if test="payFeeTime !=null and payFeeTime != ''">
  94. and t.pay_fee_time= #{payFeeTime}
  95. </if>
  96. order by t.create_time desc
  97. <if test="page != -1 and page != null ">
  98. limit #{page}, #{row}
  99. </if>
  100. </select>
  101. <!-- 修改月缴费表信息 add by wuxw 2018-07-03 -->
  102. <update id="updatePayFeeDetailMonthInfo" parameterType="Map">
  103. update pay_fee_detail_month t set t.status_cd = #{statusCd}
  104. <if test="newBId != null and newBId != ''">
  105. ,t.b_id = #{newBId}
  106. </if>
  107. <if test="detailMonth !=null and detailMonth != ''">
  108. , t.detail_month= #{detailMonth}
  109. </if>
  110. <if test="detailYear !=null and detailYear != ''">
  111. , t.detail_year= #{detailYear}
  112. </if>
  113. <if test="receivableAmount !=null and receivableAmount != ''">
  114. , t.receivable_amount= #{receivableAmount}
  115. </if>
  116. <if test="discountAmount !=null and discountAmount != ''">
  117. , t.discount_amount= #{discountAmount}
  118. </if>
  119. <if test="remark !=null and remark != ''">
  120. , t.remark= #{remark}
  121. </if>
  122. <if test="receivedAmount !=null and receivedAmount != ''">
  123. , t.received_amount= #{receivedAmount}
  124. </if>
  125. <if test="objName !=null and objName != ''">
  126. , t.obj_name= #{objName}
  127. </if>
  128. <if test="objId !=null and objId != ''">
  129. , t.obj_id= #{objId}
  130. </if>
  131. <if test="ownerName !=null and ownerName != ''">
  132. , t.owner_name= #{ownerName}
  133. </if>
  134. <if test="ownerId !=null and ownerId != ''">
  135. , t.owner_id= #{ownerId}
  136. </if>
  137. <if test="state !=null and state != ''">
  138. , t.state= #{state}
  139. </if>
  140. <if test="payFeeTime !=null and payFeeTime != ''">
  141. , t.pay_fee_time= #{payFeeTime}
  142. </if>
  143. where 1=1
  144. <if test="monthId !=null and monthId != ''">
  145. and t.month_id= #{monthId}
  146. </if>
  147. <if test="communityId !=null and communityId != ''">
  148. and t.community_id= #{communityId}
  149. </if>
  150. <if test="feeId !=null and feeId != ''">
  151. and t.fee_id= #{feeId}
  152. </if>
  153. <if test="detailId !=null and detailId != ''">
  154. and t.detail_id= #{detailId}
  155. </if>
  156. <if test="curMonthStartTime !=null and curMonthStartTime != ''">
  157. and t.cur_month_time &gt;= #{curMonthStartTime}
  158. and t.cur_month_time &lt;= #{curMonthEndTime}
  159. </if>
  160. </update>
  161. <!-- 删除离散数据 -->
  162. <update id="deletePayFeeDetailMonthInfo" parameterType="Map">
  163. delete from pay_fee_detail_month
  164. where 1=1
  165. and community_id= #{communityId}
  166. <if test="monthId !=null and monthId != ''">
  167. and month_id= #{monthId}
  168. </if>
  169. <if test="feeId !=null and feeId != ''">
  170. and fee_id= #{feeId}
  171. </if>
  172. <if test="detailId !=null and detailId != ''">
  173. and detail_id= #{detailId}
  174. </if>
  175. </update>
  176. <!-- 查询月缴费表数量 add by wuxw 2018-07-03 -->
  177. <select id="queryPayFeeDetailMonthsCount" parameterType="Map" resultType="Map">
  178. select count(1) count
  179. from pay_fee_detail_month t
  180. where 1 =1
  181. <if test="detailMonth !=null and detailMonth != ''">
  182. and t.detail_month= #{detailMonth}
  183. </if>
  184. <if test="detailYear !=null and detailYear != ''">
  185. and t.detail_year= #{detailYear}
  186. </if>
  187. <if test="detailId !=null and detailId != ''">
  188. and t.detail_id= #{detailId}
  189. </if>
  190. <if test="receivableAmount !=null and receivableAmount != ''">
  191. and t.receivable_amount= #{receivableAmount}
  192. </if>
  193. <if test="discountAmount !=null and discountAmount != ''">
  194. and t.discount_amount= #{discountAmount}
  195. </if>
  196. <if test="remark !=null and remark != ''">
  197. and t.remark= #{remark}
  198. </if>
  199. <if test="statusCd !=null and statusCd != ''">
  200. and t.status_cd= #{statusCd}
  201. </if>
  202. <if test="receivedAmount !=null and receivedAmount != ''">
  203. and t.received_amount= #{receivedAmount}
  204. </if>
  205. <if test="communityId !=null and communityId != ''">
  206. and t.community_id= #{communityId}
  207. </if>
  208. <if test="feeId !=null and feeId != ''">
  209. and t.fee_id= #{feeId}
  210. </if>
  211. <if test="monthId !=null and monthId != ''">
  212. and t.month_id= #{monthId}
  213. </if>
  214. <if test="objName !=null and objName != ''">
  215. and t.obj_name= #{objName}
  216. </if>
  217. <if test="objId !=null and objId != ''">
  218. and t.obj_id= #{objId}
  219. </if>
  220. <if test="ownerName !=null and ownerName != ''">
  221. and t.owner_name= #{ownerName}
  222. </if>
  223. <if test="ownerId !=null and ownerId != ''">
  224. and t.owner_id= #{ownerId}
  225. </if>
  226. <if test="state !=null and state != ''">
  227. and t.state= #{state}
  228. </if>
  229. <if test="payFeeTime !=null and payFeeTime != ''">
  230. and t.pay_fee_time= #{payFeeTime}
  231. </if>
  232. </select>
  233. <select id="queryPayFeeDetailMaxMonths" parameterType="Map" resultType="Map">
  234. select t.detail_month,t.detail_month detailMonth,t.detail_year,t.detail_year detailYear,t.detail_id,t.detail_id
  235. detailId,t.receivable_amount,t.receivable_amount receivableAmount,t.discount_amount,t.discount_amount
  236. discountAmount,t.remark,t.status_cd,t.status_cd statusCd,t.received_amount,t.received_amount
  237. receivedAmount,t.community_id,t.community_id communityId,t.fee_id,t.fee_id feeId,t.month_id,t.month_id monthId,
  238. t.obj_name objName,t.obj_id objId,t.owner_name ownerName,t.owner_id ownerId,t.link,t.state,t.pay_fee_time
  239. payFeeTime,
  240. t.cur_month_time curMonthTime
  241. from pay_fee_detail_month t
  242. where 1 =1
  243. <if test="detailMonth !=null and detailMonth != ''">
  244. and t.detail_month= #{detailMonth}
  245. </if>
  246. <if test="detailYear !=null and detailYear != ''">
  247. and t.detail_year= #{detailYear}
  248. </if>
  249. <if test="detailId !=null and detailId != ''">
  250. and t.detail_id= #{detailId}
  251. </if>
  252. <if test="receivableAmount !=null and receivableAmount != ''">
  253. and t.receivable_amount= #{receivableAmount}
  254. </if>
  255. <if test="discountAmount !=null and discountAmount != ''">
  256. and t.discount_amount= #{discountAmount}
  257. </if>
  258. <if test="remark !=null and remark != ''">
  259. and t.remark= #{remark}
  260. </if>
  261. <if test="statusCd !=null and statusCd != ''">
  262. and t.status_cd= #{statusCd}
  263. </if>
  264. <if test="receivedAmount !=null and receivedAmount != ''">
  265. and t.received_amount= #{receivedAmount}
  266. </if>
  267. <if test="communityId !=null and communityId != ''">
  268. and t.community_id= #{communityId}
  269. </if>
  270. <if test="feeId !=null and feeId != ''">
  271. and t.fee_id= #{feeId}
  272. </if>
  273. <if test="monthId !=null and monthId != ''">
  274. and t.month_id= #{monthId}
  275. </if>
  276. <if test="objName !=null and objName != ''">
  277. and t.obj_name= #{objName}
  278. </if>
  279. <if test="objId !=null and objId != ''">
  280. and t.obj_id= #{objId}
  281. </if>
  282. <if test="ownerName !=null and ownerName != ''">
  283. and t.owner_name= #{ownerName}
  284. </if>
  285. <if test="ownerId !=null and ownerId != ''">
  286. and t.owner_id= #{ownerId}
  287. </if>
  288. <if test="state !=null and state != ''">
  289. and t.state= #{state}
  290. </if>
  291. <if test="payFeeTime !=null and payFeeTime != ''">
  292. and t.pay_fee_time= #{payFeeTime}
  293. </if>
  294. order by t.detail_year desc,t.detail_month desc
  295. <if test="page != -1 and page != null ">
  296. limit #{page}, #{row}
  297. </if>
  298. </select>
  299. <!-- 查询需要离散的缴费记录 -->
  300. <select id="getWaitDispersedFeeDetail" parameterType="Map" resultType="Map">
  301. select t.prime_rate,t.prime_rate primeRate,
  302. t.detail_id,t.detail_id detailId,
  303. t.receivable_amount,t.receivable_amount receivableAmount,
  304. t.cycles,t.remark,t.status_cd,t.status_cd statusCd,t.received_amount,t.received_amount receivedAmount,
  305. t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.fee_id,t.fee_id feeId ,t.create_time createTime,
  306. t.state,d.name stateName,t.start_time,t.end_time,t.start_time startTime,t.end_time endTime,pfa.`value`
  307. importFeeName,pfc.fee_name feeName,t.payable_amount,t.payable_amount payableAmount,
  308. mw.cur_degrees curDegrees,mw.pre_degrees preDegrees, mw.pre_reading_time preReadingTime,mw.cur_reading_time
  309. curReadingTime,t.pay_order_id payOrderId,pfc.config_id configId,td.`name` primeRateName,pfao1.`value`
  310. payerObjName,
  311. t.cashier_id cashierId,t.cashier_name cashierName
  312. from pay_fee_detail t
  313. left join pay_fee_detail_month pfdm on t.fee_id = pfdm.fee_id and pfdm.detail_id = t.detail_id and
  314. pfdm.status_cd = '0' and t.community_id = pfdm.community_id
  315. left join pay_fee_attrs pfa on t.fee_id = pfa.fee_id and pfa.spec_cd = '390002'
  316. left join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
  317. left join pay_fee_config pfc on pf.config_id = pfc.config_id and pfc.status_cd = '0'
  318. LEFT JOIN meter_water mw on t.fee_id = mw.fee_id and mw.status_cd = '0' and mw.community_id = t.community_id
  319. left join pay_fee_attrs pfao1 on pfao1.fee_id = t.fee_id and pfao1.spec_cd = '390012' and pfao1.status_cd = '0'
  320. left join t_dict d on t.state = d.status_cd and d.table_name = 'pay_fee_detail' and d.table_columns = 'state'
  321. left join t_dict td on t.prime_rate = td.status_cd and td.table_name = 'pay_fee_detail' and td.table_columns =
  322. 'prime_rate'
  323. where t.status_cd = '0'
  324. and t.state in ('1000','1400')
  325. and t.community_id = #{communityId}
  326. and t.fee_id = #{feeId}
  327. and pfdm.detail_id is null
  328. </select>
  329. <!-- 查询月数据 -->
  330. <select id="queryPagePayFeeDetailMonths" parameterType="Map" resultType="Map">
  331. select t.detail_month detailMonth,t.detail_year detailYear,t.detail_id
  332. detailId,t.receivable_amount receivableAmount,t.discount_amount discountAmount,t.remark,t.received_amount receivedAmount,
  333. t.community_id communityId,t.fee_id feeId,t.month_id monthId,
  334. t.obj_name objName,t.obj_id objId,t.owner_name ownerName,t.owner_id ownerId,t.link,t.state,t.pay_fee_time
  335. payFeeTime,t.cur_month_time curMonthTime,pfc.square_price squarePrice,pfc.additional_amount
  336. additionalAmount,pfc.fee_flag,pfc.fee_flag feeFlag,
  337. pfc.fee_name feeName,td1.name feeTypeCdName,td3.name feeFlagName,pfc.computing_formula
  338. computingFormula,pfc.computing_formula_text computingFormulaText,
  339. pfc.bill_type billType,pf.payer_obj_type payerObjType,pfc.is_default isDefault,pfc.start_time
  340. configStartTime,pfc.end_time configEndTime,pfc.payment_cd paymentCd,pfc.payment_cycle paymentCycle,td4.name
  341. billTypeName,pfa.value importFeeName,mw.cur_degrees curDegrees,mw.pre_degrees
  342. preDegrees,
  343. mw.pre_reading_time preReadingTime,mw.cur_reading_time curReadingTime,pfa1.`value` deadlineTime,pfa1.`value` maxEndTime,mw.price
  344. mwPrice,
  345. pfa2.`value` ownerName,pf.batch_id batchId,
  346. pfc.pay_online payOnline,pfc.scale,pfc.decimal_place decimalPlace,pfc.units
  347. from pay_fee_detail_month t
  348. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
  349. INNER join pay_fee_config pfc on t.config_id = pfc.config_id and
  350. pfc.status_cd = '0'
  351. left join t_dict td1 on pfc.fee_type_cd = td1.status_cd and td1.table_name = 'pay_fee_config' and
  352. td1.table_columns = 'fee_type_cd'
  353. left join t_dict td3 on pfc.fee_flag = td3.status_cd and td3.table_name = 'pay_fee' and td3.table_columns =
  354. 'fee_flag'
  355. left join t_dict td4 on pfc.bill_type = td4.status_cd and td4.table_name = 'pay_fee_config' and
  356. td4.table_columns = 'bill_type'
  357. LEFT JOIN pay_fee_attrs pfa on t.fee_id = pfa.fee_id and pfa.spec_cd = '390002' and pfa.status_cd = '0'
  358. LEFT JOIN pay_fee_attrs pfa1 on t.fee_id = pfa1.fee_id and pfa1.spec_cd = '390010' and pfa1.status_cd = '0'
  359. LEFT JOIN pay_fee_attrs pfa2 on t.fee_id = pfa2.fee_id and pfa2.spec_cd = '390008' and pfa2.status_cd = '0'
  360. LEFT JOIN meter_water mw on t.fee_id = mw.fee_id and mw.status_cd = '0' and mw.community_id = t.community_id
  361. <if test="ownerId != null and ownerId != ''">
  362. LEFT JOIN pay_fee_attrs pfao on t.fee_id = pfao.fee_id and pfao.spec_cd = '390007' and pfao.status_cd = '0'
  363. </if>
  364. where 1 =1
  365. <if test="ownerId !=null and ownerId != ''">
  366. and pfao.value= #{ownerId}
  367. </if>
  368. <if test="detailMonth !=null and detailMonth != ''">
  369. and t.detail_month= #{detailMonth}
  370. </if>
  371. <if test="feeTypeCd !=null and feeTypeCd != ''">
  372. and pf.fee_type_cd= #{feeTypeCd}
  373. </if>
  374. <if test="feeTypeCds != null ">
  375. and pf.fee_type_cd in
  376. <foreach collection="feeTypeCds" item="item" open="(" close=")" separator=",">
  377. #{item}
  378. </foreach>
  379. </if>
  380. <if test="detailYear !=null and detailYear != ''">
  381. and t.detail_year= #{detailYear}
  382. </if>
  383. <if test="detailId !=null and detailId != ''">
  384. and t.detail_id= #{detailId}
  385. </if>
  386. <if test="receivableAmount !=null and receivableAmount != ''">
  387. and t.receivable_amount= #{receivableAmount}
  388. </if>
  389. <if test="discountAmount !=null and discountAmount != ''">
  390. and t.discount_amount= #{discountAmount}
  391. </if>
  392. <if test="remark !=null and remark != ''">
  393. and t.remark= #{remark}
  394. </if>
  395. <if test="statusCd !=null and statusCd != ''">
  396. and t.status_cd= #{statusCd}
  397. </if>
  398. <if test="receivedAmount !=null and receivedAmount != ''">
  399. and t.received_amount= #{receivedAmount}
  400. </if>
  401. <if test="communityId !=null and communityId != ''">
  402. and t.community_id= #{communityId}
  403. </if>
  404. <if test="feeId !=null and feeId != ''">
  405. and t.fee_id= #{feeId}
  406. </if>
  407. <if test="monthId !=null and monthId != ''">
  408. and t.month_id= #{monthId}
  409. </if>
  410. <if test="objName !=null and objName != ''">
  411. and t.obj_name= #{objName}
  412. </if>
  413. <if test="objId !=null and objId != ''">
  414. and t.obj_id= #{objId}
  415. </if>
  416. <if test="ownerName !=null and ownerName != ''">
  417. and t.owner_name= #{ownerName}
  418. </if>
  419. <if test="ownerId !=null and ownerId != ''">
  420. and t.owner_id= #{ownerId}
  421. </if>
  422. <if test="state !=null and state != ''">
  423. and t.state= #{state}
  424. </if>
  425. <if test="payFeeTime !=null and payFeeTime != ''">
  426. and t.pay_fee_time= #{payFeeTime}
  427. </if>
  428. order by t.detail_year,t.detail_month
  429. <if test="page != -1 and page != null ">
  430. limit #{page}, #{row}
  431. </if>
  432. </select>
  433. <!-- 查询月缴费表数量 add by wuxw 2018-07-03 -->
  434. <select id="queryPagePayFeeDetailMonthsCount" parameterType="Map" resultType="Map">
  435. select count(1) count
  436. from pay_fee_detail_month t
  437. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
  438. INNER join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  439. left join t_dict td1 on pfc.fee_type_cd = td1.status_cd and td1.table_name = 'pay_fee_config' and
  440. td1.table_columns = 'fee_type_cd'
  441. left join t_dict td3 on pfc.fee_flag = td3.status_cd and td3.table_name = 'pay_fee' and td3.table_columns =
  442. 'fee_flag'
  443. left join t_dict td4 on pfc.bill_type = td4.status_cd and td4.table_name = 'pay_fee_config' and
  444. td4.table_columns = 'bill_type'
  445. LEFT JOIN pay_fee_attrs pfa on t.fee_id = pfa.fee_id and pfa.spec_cd = '390002' and pfa.status_cd = '0'
  446. LEFT JOIN pay_fee_attrs pfa1 on t.fee_id = pfa1.fee_id and pfa1.spec_cd = '390010' and pfa1.status_cd = '0'
  447. LEFT JOIN pay_fee_attrs pfa2 on t.fee_id = pfa2.fee_id and pfa2.spec_cd = '390008' and pfa2.status_cd = '0'
  448. LEFT JOIN meter_water mw on t.fee_id = mw.fee_id and mw.status_cd = '0' and mw.community_id = t.community_id
  449. <if test="ownerId != null and ownerId != ''">
  450. LEFT JOIN pay_fee_attrs pfao on t.fee_id = pfao.fee_id and pfao.spec_cd = '390007' and pfao.status_cd = '0'
  451. </if>
  452. where 1 =1
  453. <if test="ownerId !=null and ownerId != ''">
  454. and pfao.value= #{ownerId}
  455. </if>
  456. <if test="detailMonth !=null and detailMonth != ''">
  457. and t.detail_month= #{detailMonth}
  458. </if>
  459. <if test="feeTypeCd !=null and feeTypeCd != ''">
  460. and pf.fee_type_cd= #{feeTypeCd}
  461. </if>
  462. <if test="feeTypeCds != null ">
  463. and pf.fee_type_cd in
  464. <foreach collection="feeTypeCds" item="item" open="(" close=")" separator=",">
  465. #{item}
  466. </foreach>
  467. </if>
  468. <if test="detailYear !=null and detailYear != ''">
  469. and t.detail_year= #{detailYear}
  470. </if>
  471. <if test="detailId !=null and detailId != ''">
  472. and t.detail_id= #{detailId}
  473. </if>
  474. <if test="receivableAmount !=null and receivableAmount != ''">
  475. and t.receivable_amount= #{receivableAmount}
  476. </if>
  477. <if test="discountAmount !=null and discountAmount != ''">
  478. and t.discount_amount= #{discountAmount}
  479. </if>
  480. <if test="remark !=null and remark != ''">
  481. and t.remark= #{remark}
  482. </if>
  483. <if test="statusCd !=null and statusCd != ''">
  484. and t.status_cd= #{statusCd}
  485. </if>
  486. <if test="receivedAmount !=null and receivedAmount != ''">
  487. and t.received_amount= #{receivedAmount}
  488. </if>
  489. <if test="communityId !=null and communityId != ''">
  490. and t.community_id= #{communityId}
  491. </if>
  492. <if test="feeId !=null and feeId != ''">
  493. and t.fee_id= #{feeId}
  494. </if>
  495. <if test="monthId !=null and monthId != ''">
  496. and t.month_id= #{monthId}
  497. </if>
  498. <if test="objName !=null and objName != ''">
  499. and t.obj_name= #{objName}
  500. </if>
  501. <if test="objId !=null and objId != ''">
  502. and t.obj_id= #{objId}
  503. </if>
  504. <if test="ownerName !=null and ownerName != ''">
  505. and t.owner_name= #{ownerName}
  506. </if>
  507. <if test="ownerId !=null and ownerId != ''">
  508. and t.owner_id= #{ownerId}
  509. </if>
  510. <if test="state !=null and state != ''">
  511. and t.state= #{state}
  512. </if>
  513. <if test="payFeeTime !=null and payFeeTime != ''">
  514. and t.pay_fee_time= #{payFeeTime}
  515. </if>
  516. </select>
  517. </mapper>