ReportFeeMonthStatisticsServiceDaoImplMapper.xml 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085
  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="reportFeeMonthStatisticsServiceDaoImpl">
  6. <!-- 保存费用月统计信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveReportFeeMonthStatisticsInfo" parameterType="Map">
  8. insert into report_fee_month_statistics(
  9. receivable_amount,statistics_id,update_time,remark,obj_name,received_amount,fee_year,fee_month,fee_id,config_id,obj_id,fee_name,owe_amount,community_id,fee_create_time,obj_type
  10. ) values (
  11. #{receivableAmount},#{statisticsId},#{updateTime},#{remark},#{objName},#{receivedAmount},#{feeYear},#{feeMonth},#{feeId},#{configId},#{objId},#{feeName},#{oweAmount},#{communityId},#{feeCreateTime},#{objType}
  12. )
  13. </insert>
  14. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  15. <select id="getReportFeeMonthStatisticsInfo" parameterType="Map" resultType="Map">
  16. select t.receivable_amount,t.receivable_amount receivableAmount,t.statistics_id,t.statistics_id
  17. statisticsId,t.update_time,t.update_time updateTime,t.remark,t.status_cd,t.status_cd
  18. statusCd,t.obj_name,t.obj_name objName,t.received_amount,t.received_amount receivedAmount,t.fee_year,t.fee_year
  19. feeYear,t.fee_month,t.fee_month feeMonth,t.fee_id,t.fee_id feeId,t.config_id,t.config_id
  20. configId,t.obj_id,t.obj_id objId,t.fee_name,t.fee_name feeName,t.owe_amount,t.owe_amount
  21. oweAmount,t.community_id,t.community_id communityId,t.fee_create_time,t.fee_create_time
  22. feeCreateTime,t.obj_type,t.obj_type objType
  23. from report_fee_month_statistics t
  24. where 1 =1
  25. <if test="receivableAmount !=null and receivableAmount != ''">
  26. and t.receivable_amount= #{receivableAmount}
  27. </if>
  28. <if test="statisticsId !=null and statisticsId != ''">
  29. and t.statistics_id= #{statisticsId}
  30. </if>
  31. <if test="updateTime !=null and updateTime != ''">
  32. and t.update_time= #{updateTime}
  33. </if>
  34. <if test="remark !=null and remark != ''">
  35. and t.remark= #{remark}
  36. </if>
  37. <if test="statusCd !=null and statusCd != ''">
  38. and t.status_cd= #{statusCd}
  39. </if>
  40. <if test="objName !=null and objName != ''">
  41. and t.obj_name= #{objName}
  42. </if>
  43. <if test="receivedAmount !=null and receivedAmount != ''">
  44. and t.received_amount= #{receivedAmount}
  45. </if>
  46. <if test="feeYear !=null and feeYear != ''">
  47. and t.fee_year= #{feeYear}
  48. </if>
  49. <if test="feeMonth !=null and feeMonth != ''">
  50. and t.fee_month= #{feeMonth}
  51. </if>
  52. <if test="feeId !=null and feeId != ''">
  53. and t.fee_id= #{feeId}
  54. </if>
  55. <if test="configId !=null and configId != ''">
  56. and t.config_id= #{configId}
  57. </if>
  58. <if test="objId !=null and objId != ''">
  59. and t.obj_id= #{objId}
  60. </if>
  61. <if test="feeName !=null and feeName != ''">
  62. and t.fee_name= #{feeName}
  63. </if>
  64. <if test="oweAmount !=null and oweAmount != ''">
  65. and t.owe_amount= #{oweAmount}
  66. </if>
  67. <if test="communityId !=null and communityId != ''">
  68. and t.community_id= #{communityId}
  69. </if>
  70. <if test="feeCreateTime !=null and feeCreateTime != ''">
  71. and t.fee_create_time= #{feeCreateTime}
  72. </if>
  73. <if test="objType !=null and objType != ''">
  74. and t.obj_type= #{objType}
  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="updateReportFeeMonthStatisticsOwe" parameterType="Map">
  83. update report_fee_month_statistics t set
  84. t.owe_amount= #{oweAmount}
  85. where 1=1
  86. <if test="statisticsId !=null and statisticsId != ''">
  87. and t.statistics_id= #{statisticsId}
  88. </if>
  89. <if test="feeYear !=null ">
  90. and t.fee_year &lt;= #{feeYear}
  91. </if>
  92. <if test="feeMonth !=null ">
  93. and t.fee_month &lt;= #{feeMonth}
  94. </if>
  95. <if test="feeId !=null and feeId != ''">
  96. and t.fee_id= #{feeId}
  97. </if>
  98. </update>
  99. <!-- 修改费用月统计信息 add by wuxw 2018-07-03 -->
  100. <update id="updateReportFeeMonthStatisticsInfo" parameterType="Map">
  101. update report_fee_month_statistics t set t.status_cd = #{statusCd}
  102. <if test="newBId != null and newBId != ''">
  103. ,t.b_id = #{newBId}
  104. </if>
  105. <if test="receivableAmount !=null and receivableAmount != ''">
  106. , t.receivable_amount= #{receivableAmount}
  107. </if>
  108. <if test="updateTime !=null and updateTime != ''">
  109. , t.update_time= #{updateTime}
  110. </if>
  111. <if test="deadlineTime !=null ">
  112. , t.deadline_time= #{deadlineTime}
  113. </if>
  114. <if test="remark !=null and remark != ''">
  115. , t.remark= #{remark}
  116. </if>
  117. <if test="objName !=null and objName != ''">
  118. , t.obj_name= #{objName}
  119. </if>
  120. <if test="receivedAmount !=null and receivedAmount != ''">
  121. , t.received_amount= #{receivedAmount}
  122. </if>
  123. <if test="feeYear !=null and feeYear != ''">
  124. , t.fee_year= #{feeYear}
  125. </if>
  126. <if test="feeMonth !=null and feeMonth != ''">
  127. , t.fee_month= #{feeMonth}
  128. </if>
  129. <if test="feeId !=null and feeId != ''">
  130. , t.fee_id= #{feeId}
  131. </if>
  132. <if test="configId !=null and configId != ''">
  133. , t.config_id= #{configId}
  134. </if>
  135. <if test="objId !=null and objId != ''">
  136. , t.obj_id= #{objId}
  137. </if>
  138. <if test="feeName !=null and feeName != ''">
  139. , t.fee_name= #{feeName}
  140. </if>
  141. <if test="oweAmount !=null and oweAmount != ''">
  142. , t.owe_amount= #{oweAmount}
  143. </if>
  144. <if test="communityId !=null and communityId != ''">
  145. , t.community_id= #{communityId}
  146. </if>
  147. <if test="feeCreateTime !=null and feeCreateTime != ''">
  148. , t.fee_create_time= #{feeCreateTime}
  149. </if>
  150. <if test="objType !=null and objType != ''">
  151. , t.obj_type= #{objType}
  152. </if>
  153. where 1=1
  154. <if test="statisticsId !=null and statisticsId != ''">
  155. and t.statistics_id= #{statisticsId}
  156. </if>
  157. </update>
  158. <!-- 查询费用月统计数量 add by wuxw 2018-07-03 -->
  159. <select id="queryReportFeeMonthStatisticssCount" parameterType="Map" resultType="Map">
  160. select count(1) count
  161. from report_fee_month_statistics t
  162. where 1 =1
  163. <if test="receivableAmount !=null and receivableAmount != ''">
  164. and t.receivable_amount= #{receivableAmount}
  165. </if>
  166. <if test="statisticsId !=null and statisticsId != ''">
  167. and t.statistics_id= #{statisticsId}
  168. </if>
  169. <if test="updateTime !=null and updateTime != ''">
  170. and t.update_time= #{updateTime}
  171. </if>
  172. <if test="remark !=null and remark != ''">
  173. and t.remark= #{remark}
  174. </if>
  175. <if test="statusCd !=null and statusCd != ''">
  176. and t.status_cd= #{statusCd}
  177. </if>
  178. <if test="objName !=null and objName != ''">
  179. and t.obj_name= #{objName}
  180. </if>
  181. <if test="receivedAmount !=null and receivedAmount != ''">
  182. and t.received_amount= #{receivedAmount}
  183. </if>
  184. <if test="feeYear !=null and feeYear != ''">
  185. and t.fee_year= #{feeYear}
  186. </if>
  187. <if test="feeMonth !=null and feeMonth != ''">
  188. and t.fee_month= #{feeMonth}
  189. </if>
  190. <if test="feeId !=null and feeId != ''">
  191. and t.fee_id= #{feeId}
  192. </if>
  193. <if test="configId !=null and configId != ''">
  194. and t.config_id= #{configId}
  195. </if>
  196. <if test="objId !=null and objId != ''">
  197. and t.obj_id= #{objId}
  198. </if>
  199. <if test="feeName !=null and feeName != ''">
  200. and t.fee_name= #{feeName}
  201. </if>
  202. <if test="oweAmount !=null and oweAmount != ''">
  203. and t.owe_amount= #{oweAmount}
  204. </if>
  205. <if test="communityId !=null and communityId != ''">
  206. and t.community_id= #{communityId}
  207. </if>
  208. <if test="feeCreateTime !=null and feeCreateTime != ''">
  209. and t.fee_create_time= #{feeCreateTime}
  210. </if>
  211. <if test="objType !=null and objType != ''">
  212. and t.obj_type= #{objType}
  213. </if>
  214. </select>
  215. <!-- 查询费用月统计数量 add by wuxw 2018-07-03 -->
  216. <select id="queryReportFeeSummaryCount" parameterType="Map" resultType="Map">
  217. select count(1) count
  218. from (
  219. select t.fee_year,t.fee_month
  220. from report_fee_month_statistics t
  221. left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
  222. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  223. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  224. where t.status_cd = '0'
  225. <if test="roomNum !=null and roomNum != ''">
  226. and br.room_num= #{roomNum}
  227. </if>
  228. <if test="unitId !=null and unitId != ''">
  229. and bu.unit_id= #{unitId}
  230. </if>
  231. <if test="floorId !=null and floorId != ''">
  232. and f.floor_id = #{floorId}
  233. </if>
  234. <if test="objName !=null and objName != ''">
  235. and t.obj_name= #{objName}
  236. </if>
  237. <if test="feeYear !=null and feeYear != ''">
  238. and t.fee_year= #{feeYear}
  239. </if>
  240. <if test="feeMonth !=null and feeMonth != ''">
  241. and t.fee_month= #{feeMonth}
  242. </if>
  243. <if test="feeId !=null and feeId != ''">
  244. and t.fee_id= #{feeId}
  245. </if>
  246. <if test="configId !=null and configId != ''">
  247. and t.config_id= #{configId}
  248. </if>
  249. <if test="objId !=null and objId != ''">
  250. and t.obj_id= #{objId}
  251. </if>
  252. <if test="feeName !=null and feeName != ''">
  253. and t.fee_name= #{feeName}
  254. </if>
  255. <if test="communityId !=null and communityId != ''">
  256. and t.community_id= #{communityId}
  257. </if>
  258. <if test="startTime !=null">
  259. and t.create_time &gt;= #{startTime}
  260. </if>
  261. <if test="endTime !=null">
  262. and t.create_time &lt;= #{endTime}
  263. </if>
  264. group by t.fee_year,t.fee_month
  265. ) t
  266. </select>
  267. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  268. <select id="queryReportFeeSummary" parameterType="Map" resultType="Map">
  269. select t.fee_year feeYear,t.fee_month feeMonth,SUM(t.receivable_amount) receivableAmount,SUM(t.received_amount)
  270. receivedAmount,SUM(t.owe_amount) oweAmount
  271. from report_fee_month_statistics t
  272. left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
  273. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  274. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  275. where t.status_cd = '0'
  276. <if test="roomNum !=null and roomNum != ''">
  277. and br.room_num= #{roomNum}
  278. </if>
  279. <if test="unitId !=null and unitId != ''">
  280. and bu.unit_id= #{unitId}
  281. </if>
  282. <if test="floorId !=null and floorId != ''">
  283. and f.floor_id = #{floorId}
  284. </if>
  285. <if test="objName !=null and objName != ''">
  286. and t.obj_name= #{objName}
  287. </if>
  288. <if test="feeYear !=null and feeYear != ''">
  289. and t.fee_year= #{feeYear}
  290. </if>
  291. <if test="feeMonth !=null and feeMonth != ''">
  292. and t.fee_month= #{feeMonth}
  293. </if>
  294. <if test="feeId !=null and feeId != ''">
  295. and t.fee_id= #{feeId}
  296. </if>
  297. <if test="configId !=null and configId != ''">
  298. and t.config_id= #{configId}
  299. </if>
  300. <if test="objId !=null and objId != ''">
  301. and t.obj_id= #{objId}
  302. </if>
  303. <if test="feeName !=null and feeName != ''">
  304. and t.fee_name= #{feeName}
  305. </if>
  306. <if test="communityId !=null and communityId != ''">
  307. and t.community_id= #{communityId}
  308. </if>
  309. <if test="startTime !=null">
  310. and t.create_time &gt;= #{startTime}
  311. </if>
  312. <if test="endTime !=null">
  313. and t.create_time &lt;= #{endTime}
  314. </if>
  315. group by t.fee_year,t.fee_month
  316. <if test="page != -1 and page != null ">
  317. limit #{page}, #{row}
  318. </if>
  319. </select>
  320. <select id="queryReportFloorUnitFeeSummaryCount" parameterType="Map" resultType="Map">
  321. select count(1) count
  322. from (
  323. select t.fee_year feeYear,t.fee_month feeMonth, f.floor_num flooNum, bu.unit_num unitNum
  324. from report_fee_month_statistics t
  325. INNER JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0'
  326. inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  327. inner join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  328. where t.status_cd = '0'
  329. <if test="roomNum !=null and roomNum != ''">
  330. and br.room_num= #{roomNum}
  331. </if>
  332. <if test="unitId !=null and unitId != ''">
  333. and bu.unit_id= #{unitId}
  334. </if>
  335. <if test="floorId !=null and floorId != ''">
  336. and f.floor_id = #{floorId}
  337. </if>
  338. <if test="objName !=null and objName != ''">
  339. and t.obj_name= #{objName}
  340. </if>
  341. <if test="feeYear !=null and feeYear != ''">
  342. and t.fee_year= #{feeYear}
  343. </if>
  344. <if test="feeMonth !=null and feeMonth != ''">
  345. and t.fee_month= #{feeMonth}
  346. </if>
  347. <if test="feeId !=null and feeId != ''">
  348. and t.fee_id= #{feeId}
  349. </if>
  350. <if test="configId !=null and configId != ''">
  351. and t.config_id= #{configId}
  352. </if>
  353. <if test="objId !=null and objId != ''">
  354. and t.obj_id= #{objId}
  355. </if>
  356. <if test="feeName !=null and feeName != ''">
  357. and t.fee_name= #{feeName}
  358. </if>
  359. <if test="communityId !=null and communityId != ''">
  360. and t.community_id= #{communityId}
  361. </if>
  362. <if test="startTime !=null">
  363. and t.create_time &gt;= #{startTime}
  364. </if>
  365. <if test="endTime !=null">
  366. and t.create_time &lt;= #{endTime}
  367. </if>
  368. GROUP BY t.fee_year,t.fee_month,f.floor_num,bu.unit_id,bu.unit_num
  369. ) t
  370. </select>
  371. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  372. <select id="queryReportFloorUnitFeeSummary" parameterType="Map" resultType="Map">
  373. select t.fee_year feeYear,t.fee_month feeMonth, f.floor_num floorNum, bu.unit_num unitNum,
  374. SUM(t.receivable_amount) receivableAmount,SUM(t.received_amount) receivedAmount,SUM(t.owe_amount) oweAmount
  375. from report_fee_month_statistics t
  376. INNER JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0'
  377. inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  378. inner join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  379. where t.status_cd = '0'
  380. <if test="roomNum !=null and roomNum != ''">
  381. and br.room_num= #{roomNum}
  382. </if>
  383. <if test="unitId !=null and unitId != ''">
  384. and bu.unit_id= #{unitId}
  385. </if>
  386. <if test="floorId !=null and floorId != ''">
  387. and f.floor_id = #{floorId}
  388. </if>
  389. <if test="objName !=null and objName != ''">
  390. and t.obj_name= #{objName}
  391. </if>
  392. <if test="feeYear !=null and feeYear != ''">
  393. and t.fee_year= #{feeYear}
  394. </if>
  395. <if test="feeMonth !=null and feeMonth != ''">
  396. and t.fee_month= #{feeMonth}
  397. </if>
  398. <if test="feeId !=null and feeId != ''">
  399. and t.fee_id= #{feeId}
  400. </if>
  401. <if test="configId !=null and configId != ''">
  402. and t.config_id= #{configId}
  403. </if>
  404. <if test="objId !=null and objId != ''">
  405. and t.obj_id= #{objId}
  406. </if>
  407. <if test="feeName !=null and feeName != ''">
  408. and t.fee_name= #{feeName}
  409. </if>
  410. <if test="communityId !=null and communityId != ''">
  411. and t.community_id= #{communityId}
  412. </if>
  413. <if test="startTime !=null">
  414. and t.create_time &gt;= #{startTime}
  415. </if>
  416. <if test="endTime !=null">
  417. and t.create_time &lt;= #{endTime}
  418. </if>
  419. GROUP BY t.fee_year,t.fee_month,f.floor_num,bu.unit_id,bu.unit_num
  420. <if test="page != -1 and page != null ">
  421. limit #{page}, #{row}
  422. </if>
  423. </select>
  424. <select id="queryFeeBreakdownCount" parameterType="Map" resultType="Map">
  425. select count(1) count
  426. from (
  427. select t.fee_name,pfc.start_time
  428. from report_fee_month_statistics t
  429. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  430. left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
  431. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  432. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  433. where t.status_cd = '0'
  434. <if test="roomNum !=null and roomNum != ''">
  435. and br.room_num= #{roomNum}
  436. </if>
  437. <if test="unitId !=null and unitId != ''">
  438. and bu.unit_id= #{unitId}
  439. </if>
  440. <if test="floorId !=null and floorId != ''">
  441. and f.floor_id = #{floorId}
  442. </if>
  443. <if test="objName !=null and objName != ''">
  444. and t.obj_name= #{objName}
  445. </if>
  446. <if test="feeYear !=null and feeYear != ''">
  447. and t.fee_year= #{feeYear}
  448. </if>
  449. <if test="feeMonth !=null and feeMonth != ''">
  450. and t.fee_month= #{feeMonth}
  451. </if>
  452. <if test="feeId !=null and feeId != ''">
  453. and t.fee_id= #{feeId}
  454. </if>
  455. <if test="configId !=null and configId != ''">
  456. and t.config_id= #{configId}
  457. </if>
  458. <if test="objId !=null and objId != ''">
  459. and t.obj_id= #{objId}
  460. </if>
  461. <if test="feeName !=null and feeName != ''">
  462. and t.fee_name= #{feeName}
  463. </if>
  464. <if test="communityId !=null and communityId != ''">
  465. and t.community_id= #{communityId}
  466. </if>
  467. <if test="startTime !=null">
  468. and t.create_time &gt;= #{startTime}
  469. </if>
  470. <if test="endTime !=null">
  471. and t.create_time &lt;= #{endTime}
  472. </if>
  473. group by t.config_id,t.fee_name,pfc.start_time
  474. ) t
  475. </select>
  476. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  477. <select id="queryFeeBreakdown" parameterType="Map" resultType="Map">
  478. select t.fee_name feeName,pfc.start_time feeCreateTime,SUM(t.receivable_amount)
  479. receivableAmount,SUM(t.received_amount) receivedAmount,SUM(t.owe_amount) oweAmount
  480. from report_fee_month_statistics t
  481. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  482. left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
  483. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  484. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  485. where t.status_cd = '0'
  486. <if test="roomNum !=null and roomNum != ''">
  487. and br.room_num= #{roomNum}
  488. </if>
  489. <if test="unitId !=null and unitId != ''">
  490. and bu.unit_id= #{unitId}
  491. </if>
  492. <if test="floorId !=null and floorId != ''">
  493. and f.floor_id = #{floorId}
  494. </if>
  495. <if test="objName !=null and objName != ''">
  496. and t.obj_name= #{objName}
  497. </if>
  498. <if test="feeYear !=null and feeYear != ''">
  499. and t.fee_year= #{feeYear}
  500. </if>
  501. <if test="feeMonth !=null and feeMonth != ''">
  502. and t.fee_month= #{feeMonth}
  503. </if>
  504. <if test="feeId !=null and feeId != ''">
  505. and t.fee_id= #{feeId}
  506. </if>
  507. <if test="configId !=null and configId != ''">
  508. and t.config_id= #{configId}
  509. </if>
  510. <if test="objId !=null and objId != ''">
  511. and t.obj_id= #{objId}
  512. </if>
  513. <if test="feeName !=null and feeName != ''">
  514. and t.fee_name= #{feeName}
  515. </if>
  516. <if test="communityId !=null and communityId != ''">
  517. and t.community_id= #{communityId}
  518. </if>
  519. <if test="startTime !=null">
  520. and t.create_time &gt;= #{startTime}
  521. </if>
  522. <if test="endTime !=null">
  523. and t.create_time &lt;= #{endTime}
  524. </if>
  525. group by t.config_id,t.fee_name,pfc.start_time
  526. <if test="page != -1 and page != null ">
  527. limit #{page}, #{row}
  528. </if>
  529. </select>
  530. <select id="queryFeeDetailCount" parameterType="Map" resultType="Map">
  531. select count(1) count
  532. from (
  533. select t.obj_name objName,t.fee_name feeName,pfc.start_time
  534. from report_fee_month_statistics t
  535. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  536. left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
  537. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  538. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  539. where t.status_cd = '0'
  540. <if test="roomNum !=null and roomNum != ''">
  541. and br.room_num= #{roomNum}
  542. </if>
  543. <if test="unitId !=null and unitId != ''">
  544. and bu.unit_id= #{unitId}
  545. </if>
  546. <if test="floorId !=null and floorId != ''">
  547. and f.floor_id = #{floorId}
  548. </if>
  549. <if test="objName !=null and objName != ''">
  550. and t.obj_name= #{objName}
  551. </if>
  552. <if test="feeYear !=null and feeYear != ''">
  553. and t.fee_year= #{feeYear}
  554. </if>
  555. <if test="feeMonth !=null and feeMonth != ''">
  556. and t.fee_month= #{feeMonth}
  557. </if>
  558. <if test="feeId !=null and feeId != ''">
  559. and t.fee_id= #{feeId}
  560. </if>
  561. <if test="configId !=null and configId != ''">
  562. and t.config_id= #{configId}
  563. </if>
  564. <if test="objId !=null and objId != ''">
  565. and t.obj_id= #{objId}
  566. </if>
  567. <if test="feeName !=null and feeName != ''">
  568. and t.fee_name= #{feeName}
  569. </if>
  570. <if test="communityId !=null and communityId != ''">
  571. and t.community_id= #{communityId}
  572. </if>
  573. <if test="startTime !=null">
  574. and t.create_time &gt;= #{startTime}
  575. </if>
  576. <if test="endTime !=null">
  577. and t.create_time &lt;= #{endTime}
  578. </if>
  579. group by t.config_id,t.fee_name,pfc.start_time,t.obj_id,t.obj_name
  580. ) t
  581. </select>
  582. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  583. <select id="queryFeeDetail" parameterType="Map" resultType="Map">
  584. select t.obj_name objName,t.fee_name feeName,pfc.start_time feeCreateTime,SUM(t.receivable_amount)
  585. receivableAmount,SUM(t.received_amount) receivedAmount,SUM(t.owe_amount) oweAmount
  586. from report_fee_month_statistics t
  587. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  588. left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
  589. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  590. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  591. where t.status_cd = '0'
  592. <if test="roomNum !=null and roomNum != ''">
  593. and br.room_num= #{roomNum}
  594. </if>
  595. <if test="unitId !=null and unitId != ''">
  596. and bu.unit_id= #{unitId}
  597. </if>
  598. <if test="floorId !=null and floorId != ''">
  599. and f.floor_id = #{floorId}
  600. </if>
  601. <if test="objName !=null and objName != ''">
  602. and t.obj_name= #{objName}
  603. </if>
  604. <if test="feeYear !=null and feeYear != ''">
  605. and t.fee_year= #{feeYear}
  606. </if>
  607. <if test="feeMonth !=null and feeMonth != ''">
  608. and t.fee_month= #{feeMonth}
  609. </if>
  610. <if test="feeId !=null and feeId != ''">
  611. and t.fee_id= #{feeId}
  612. </if>
  613. <if test="configId !=null and configId != ''">
  614. and t.config_id= #{configId}
  615. </if>
  616. <if test="objId !=null and objId != ''">
  617. and t.obj_id= #{objId}
  618. </if>
  619. <if test="feeName !=null and feeName != ''">
  620. and t.fee_name= #{feeName}
  621. </if>
  622. <if test="communityId !=null and communityId != ''">
  623. and t.community_id= #{communityId}
  624. </if>
  625. <if test="startTime !=null">
  626. and t.create_time &gt;= #{startTime}
  627. </if>
  628. <if test="endTime !=null">
  629. and t.create_time &lt;= #{endTime}
  630. </if>
  631. group by t.config_id,t.fee_name,pfc.start_time,t.obj_id,t.obj_name
  632. <if test="page != -1 and page != null ">
  633. limit #{page}, #{row}
  634. </if>
  635. </select>
  636. <select id="queryOweFeeDetailCount" parameterType="Map" resultType="Map">
  637. select count(1) count
  638. from (
  639. select t.obj_name objName,t.fee_name feeName,pfc.start_time,SUM(t.owe_amount) oweAmount
  640. from report_fee_month_statistics t
  641. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  642. left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
  643. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  644. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  645. where t.status_cd = '0'
  646. <if test="roomNum !=null and roomNum != ''">
  647. and br.room_num= #{roomNum}
  648. </if>
  649. <if test="unitId !=null and unitId != ''">
  650. and bu.unit_id= #{unitId}
  651. </if>
  652. <if test="floorId !=null and floorId != ''">
  653. and f.floor_id = #{floorId}
  654. </if>
  655. <if test="objName !=null and objName != ''">
  656. and t.obj_name= #{objName}
  657. </if>
  658. <if test="feeYear !=null and feeYear != ''">
  659. and t.fee_year= #{feeYear}
  660. </if>
  661. <if test="feeMonth !=null and feeMonth != ''">
  662. and t.fee_month= #{feeMonth}
  663. </if>
  664. <if test="feeId !=null and feeId != ''">
  665. and t.fee_id= #{feeId}
  666. </if>
  667. <if test="configId !=null and configId != ''">
  668. and t.config_id= #{configId}
  669. </if>
  670. <if test="objId !=null and objId != ''">
  671. and t.obj_id= #{objId}
  672. </if>
  673. <if test="feeName !=null and feeName != ''">
  674. and t.fee_name= #{feeName}
  675. </if>
  676. <if test="communityId !=null and communityId != ''">
  677. and t.community_id= #{communityId}
  678. </if>
  679. <if test="startTime !=null">
  680. and t.create_time &gt;= #{startTime}
  681. </if>
  682. <if test="endTime !=null">
  683. and t.create_time &lt;= #{endTime}
  684. </if>
  685. group by t.config_id,t.fee_name,pfc.start_time,t.obj_id,t.obj_name
  686. HAVING oweAmount > 0
  687. ) t
  688. </select>
  689. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  690. <select id="queryOweFeeDetail" parameterType="Map" resultType="Map">
  691. select t.obj_name objName,t.fee_name feeName,pfc.start_time feeCreateTime,SUM(t.receivable_amount)
  692. receivableAmount,SUM(t.received_amount) receivedAmount,SUM(t.owe_amount) oweAmount
  693. from report_fee_month_statistics t
  694. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  695. left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
  696. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  697. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  698. where t.status_cd = '0'
  699. <if test="roomNum !=null and roomNum != ''">
  700. and br.room_num= #{roomNum}
  701. </if>
  702. <if test="unitId !=null and unitId != ''">
  703. and bu.unit_id= #{unitId}
  704. </if>
  705. <if test="floorId !=null and floorId != ''">
  706. and f.floor_id = #{floorId}
  707. </if>
  708. <if test="objName !=null and objName != ''">
  709. and t.obj_name= #{objName}
  710. </if>
  711. <if test="feeYear !=null and feeYear != ''">
  712. and t.fee_year= #{feeYear}
  713. </if>
  714. <if test="feeMonth !=null and feeMonth != ''">
  715. and t.fee_month= #{feeMonth}
  716. </if>
  717. <if test="feeId !=null and feeId != ''">
  718. and t.fee_id= #{feeId}
  719. </if>
  720. <if test="configId !=null and configId != ''">
  721. and t.config_id= #{configId}
  722. </if>
  723. <if test="objId !=null and objId != ''">
  724. and t.obj_id= #{objId}
  725. </if>
  726. <if test="feeName !=null and feeName != ''">
  727. and t.fee_name= #{feeName}
  728. </if>
  729. <if test="communityId !=null and communityId != ''">
  730. and t.community_id= #{communityId}
  731. </if>
  732. <if test="startTime !=null">
  733. and t.create_time &gt;= #{startTime}
  734. </if>
  735. <if test="endTime !=null">
  736. and t.create_time &lt;= #{endTime}
  737. </if>
  738. group by t.config_id,t.fee_name,pfc.start_time,t.obj_id,t.obj_name
  739. HAVING oweAmount > 0
  740. <if test="page != -1 and page != null ">
  741. limit #{page}, #{row}
  742. </if>
  743. </select>
  744. <select id="queryPayFeeDetailCount" parameterType="Map" resultType="Map">
  745. select count(1) count
  746. from (
  747. select pfc.fee_name feeName,f.floor_num floorNum,bu.unit_num unitNum,br.room_num roomNum,oc.car_num carNum,
  748. pf.payer_obj_type payerObjType,t.start_time startTime,t.end_time endTime,t.create_time createTime,
  749. t.receivable_amount receivableAmount,t.received_amount receivedAmount
  750. from pay_fee_detail t
  751. INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
  752. inner join pay_fee_config pfc on pf.config_id = pfc.config_id and pfc.status_cd = '0'
  753. left join building_room br on pf.payer_obj_id = br.room_id and pf.payer_obj_type = '3333' and br.status_cd = '0'
  754. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  755. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  756. left join owner_car oc on pf.payer_obj_id = oc.car_id and oc.status_cd = '0'
  757. where t.status_cd = '0'
  758. <if test="roomNum !=null and roomNum != ''">
  759. and br.room_num= #{roomNum}
  760. </if>
  761. <if test="unitId !=null and unitId != ''">
  762. and bu.unit_id= #{unitId}
  763. </if>
  764. <if test="floorId !=null and floorId != ''">
  765. and f.floor_id = #{floorId}
  766. </if>
  767. <if test="objName !=null and objName != ''">
  768. and t.obj_name= #{objName}
  769. </if>
  770. <if test="feeYear !=null and feeYear != ''">
  771. and t.fee_year= #{feeYear}
  772. </if>
  773. <if test="feeMonth !=null and feeMonth != ''">
  774. and t.fee_month= #{feeMonth}
  775. </if>
  776. <if test="feeId !=null and feeId != ''">
  777. and t.fee_id= #{feeId}
  778. </if>
  779. <if test="configId !=null and configId != ''">
  780. and t.config_id= #{configId}
  781. </if>
  782. <if test="objId !=null and objId != ''">
  783. and t.obj_id= #{objId}
  784. </if>
  785. <if test="feeName !=null and feeName != ''">
  786. and t.fee_name= #{feeName}
  787. </if>
  788. <if test="communityId !=null and communityId != ''">
  789. and t.community_id= #{communityId}
  790. </if>
  791. <if test="startTime !=null">
  792. and t.create_time &gt;= #{startTime}
  793. </if>
  794. <if test="endTime !=null">
  795. and t.create_time &lt;= #{endTime}
  796. </if>
  797. ) t
  798. </select>
  799. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  800. <select id="queryPayFeeDetail" parameterType="Map" resultType="Map">
  801. select pfc.fee_name feeName,f.floor_num floorNum,bu.unit_num unitNum,br.room_num roomNum,oc.car_num carNum,
  802. pf.payer_obj_type payerObjType,t.start_time startTime,t.end_time endTime,t.create_time createTime,
  803. t.receivable_amount receivableAmount,t.received_amount receivedAmount
  804. from pay_fee_detail t
  805. INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
  806. inner join pay_fee_config pfc on pf.config_id = pfc.config_id and pfc.status_cd = '0'
  807. left join building_room br on pf.payer_obj_id = br.room_id and pf.payer_obj_type = '3333' and br.status_cd = '0'
  808. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  809. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  810. left join owner_car oc on pf.payer_obj_id = oc.car_id and oc.status_cd = '0'
  811. where t.status_cd = '0'
  812. <if test="roomNum !=null and roomNum != ''">
  813. and br.room_num= #{roomNum}
  814. </if>
  815. <if test="unitId !=null and unitId != ''">
  816. and bu.unit_id= #{unitId}
  817. </if>
  818. <if test="floorId !=null and floorId != ''">
  819. and f.floor_id = #{floorId}
  820. </if>
  821. <if test="objName !=null and objName != ''">
  822. and t.obj_name= #{objName}
  823. </if>
  824. <if test="feeYear !=null and feeYear != ''">
  825. and t.fee_year= #{feeYear}
  826. </if>
  827. <if test="feeMonth !=null and feeMonth != ''">
  828. and t.fee_month= #{feeMonth}
  829. </if>
  830. <if test="feeId !=null and feeId != ''">
  831. and t.fee_id= #{feeId}
  832. </if>
  833. <if test="configId !=null and configId != ''">
  834. and t.config_id= #{configId}
  835. </if>
  836. <if test="objId !=null and objId != ''">
  837. and t.obj_id= #{objId}
  838. </if>
  839. <if test="feeName !=null and feeName != ''">
  840. and t.fee_name= #{feeName}
  841. </if>
  842. <if test="communityId !=null and communityId != ''">
  843. and t.community_id= #{communityId}
  844. </if>
  845. <if test="startTime !=null">
  846. and t.create_time &gt;= #{startTime}
  847. </if>
  848. <if test="endTime !=null">
  849. and t.create_time &lt;= #{endTime}
  850. </if>
  851. order by t.create_time desc
  852. <if test="page != -1 and page != null ">
  853. limit #{page}, #{row}
  854. </if>
  855. </select>
  856. <select id="queryDeadlineFeeCount" parameterType="Map" resultType="Map">
  857. select count(1) count
  858. from (
  859. SELECT
  860. t.obj_name objName,
  861. t.fee_name feeName,
  862. t.deadline_time deadlineTime
  863. FROM
  864. report_fee_month_statistics t
  865. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  866. left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
  867. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  868. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  869. where t.status_cd = '0'
  870. <if test="roomNum !=null and roomNum != ''">
  871. and br.room_num= #{roomNum}
  872. </if>
  873. <if test="unitId !=null and unitId != ''">
  874. and bu.unit_id= #{unitId}
  875. </if>
  876. <if test="floorId !=null and floorId != ''">
  877. and f.floor_id = #{floorId}
  878. </if>
  879. <if test="objName !=null and objName != ''">
  880. and t.obj_name= #{objName}
  881. </if>
  882. <if test="feeYear !=null and feeYear != ''">
  883. and t.fee_year= #{feeYear}
  884. </if>
  885. <if test="feeMonth !=null and feeMonth != ''">
  886. and t.fee_month= #{feeMonth}
  887. </if>
  888. <if test="feeId !=null and feeId != ''">
  889. and t.fee_id= #{feeId}
  890. </if>
  891. <if test="configId !=null and configId != ''">
  892. and t.config_id= #{configId}
  893. </if>
  894. <if test="objId !=null and objId != ''">
  895. and t.obj_id= #{objId}
  896. </if>
  897. <if test="feeName !=null and feeName != ''">
  898. and t.fee_name= #{feeName}
  899. </if>
  900. <if test="communityId !=null and communityId != ''">
  901. and t.community_id= #{communityId}
  902. </if>
  903. <if test="startTime !=null">
  904. and t.deadline_time &gt;= #{startTime}
  905. </if>
  906. <if test="endTime !=null">
  907. and t.deadline_time &lt;= #{endTime}
  908. </if>
  909. ) t
  910. </select>
  911. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  912. <select id="queryDeadlineFee" parameterType="Map" resultType="Map">
  913. SELECT
  914. t.obj_name objName,
  915. t.fee_name feeName,
  916. t.deadline_time deadlineTime
  917. FROM
  918. report_fee_month_statistics t
  919. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  920. left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
  921. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  922. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  923. where t.status_cd = '0'
  924. <if test="roomNum !=null and roomNum != ''">
  925. and br.room_num= #{roomNum}
  926. </if>
  927. <if test="unitId !=null and unitId != ''">
  928. and bu.unit_id= #{unitId}
  929. </if>
  930. <if test="floorId !=null and floorId != ''">
  931. and f.floor_id = #{floorId}
  932. </if>
  933. <if test="objName !=null and objName != ''">
  934. and t.obj_name= #{objName}
  935. </if>
  936. <if test="feeYear !=null and feeYear != ''">
  937. and t.fee_year= #{feeYear}
  938. </if>
  939. <if test="feeMonth !=null and feeMonth != ''">
  940. and t.fee_month= #{feeMonth}
  941. </if>
  942. <if test="feeId !=null and feeId != ''">
  943. and t.fee_id= #{feeId}
  944. </if>
  945. <if test="configId !=null and configId != ''">
  946. and t.config_id= #{configId}
  947. </if>
  948. <if test="objId !=null and objId != ''">
  949. and t.obj_id= #{objId}
  950. </if>
  951. <if test="feeName !=null and feeName != ''">
  952. and t.fee_name= #{feeName}
  953. </if>
  954. <if test="communityId !=null and communityId != ''">
  955. and t.community_id= #{communityId}
  956. </if>
  957. <if test="startTime !=null">
  958. and t.deadline_time &gt;= #{startTime}
  959. </if>
  960. <if test="endTime !=null">
  961. and t.deadline_time &lt;= #{endTime}
  962. </if>
  963. order by t.deadline_time
  964. <if test="page != -1 and page != null ">
  965. limit #{page}, #{row}
  966. </if>
  967. </select>
  968. <select id="queryPrePaymentNewCount" parameterType="Map" resultType="Map">
  969. select count(1) count
  970. from (
  971. select pfc.fee_name feeName, f.floor_num floorNum,bu.unit_num unitNum,br.room_num roomNum,t.end_time endTime
  972. ,oc.car_num carNum
  973. from pay_fee t
  974. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  975. left join building_room br on t.payer_obj_id = br.room_id and t.payer_obj_type = '3333' and br.status_cd = '0'
  976. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  977. left join f_floor f on f.floor_id = bu.floor_id and f.status_cd = '0'
  978. left join owner_car oc on t.payer_obj_id = oc.car_id and t.payer_obj_type = '6666' and oc.status_cd = '0'
  979. where t.state = '2008001'
  980. and t.status_cd = '0'
  981. <if test="communityId !=null and communityId != ''">
  982. and t.community_id= #{communityId}
  983. </if>
  984. <if test="startTime !=null">
  985. and t.end_time &gt;= #{startTime}
  986. </if>
  987. <if test="endTime !=null">
  988. and t.end_time &lt;= #{endTime}
  989. </if>
  990. ) t
  991. </select>
  992. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  993. <select id="queryPrePayment" parameterType="Map" resultType="Map">
  994. select pfc.fee_name feeName, f.floor_num floorNum,bu.unit_num unitNum,br.room_num roomNum,t.end_time endTime ,
  995. oc.car_num carNum,t.payer_obj_type payerObjType
  996. from pay_fee t
  997. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  998. left join building_room br on t.payer_obj_id = br.room_id and t.payer_obj_type = '3333' and br.status_cd = '0'
  999. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  1000. left join f_floor f on f.floor_id = bu.floor_id and f.status_cd = '0'
  1001. left join owner_car oc on t.payer_obj_id = oc.car_id and t.payer_obj_type = '6666' and oc.status_cd = '0'
  1002. where t.state = '2008001'
  1003. and t.status_cd = '0'
  1004. <if test="communityId !=null and communityId != ''">
  1005. and t.community_id= #{communityId}
  1006. </if>
  1007. <if test="startTime !=null">
  1008. and t.end_time &gt;= #{startTime}
  1009. </if>
  1010. <if test="endTime !=null">
  1011. and t.end_time &lt;= #{endTime}
  1012. </if>
  1013. <if test="page != -1 and page != null ">
  1014. limit #{page}, #{row}
  1015. </if>
  1016. </select>
  1017. <select id="queryPrePaymentCount" parameterType="Map" resultType="Map">
  1018. select pfc.fee_name feeName,count(t.payer_obj_id) objCount from pay_fee t
  1019. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  1020. where t.state = '2008001'
  1021. and t.status_cd = '0'
  1022. and t.end_time &gt; #{startTime}
  1023. and t.end_time &lt; #{endTime}
  1024. and t.community_id= #{communityId}
  1025. group by pfc.fee_name ,pfc.config_id
  1026. order by objCount
  1027. </select>
  1028. <select id="queryDeadlinePaymentCount" parameterType="Map" resultType="Map">
  1029. SELECT
  1030. t.fee_name feeName,
  1031. count(t.obj_id) objCount
  1032. FROM
  1033. report_fee_month_statistics t
  1034. WHERE
  1035. 1 = 1
  1036. AND t.status_cd = '0'
  1037. and t.community_id= #{communityId}
  1038. AND t.deadline_time &gt; #{startTime}
  1039. AND t.deadline_time &lt; #{endTime}
  1040. group by t.config_id,t.fee_name
  1041. order by objCount desc
  1042. </select>
  1043. <select id="queryOwePaymentCount" parameterType="Map" resultType="Map">
  1044. select t.fee_name feeName,count(t.obj_id) objCount
  1045. from report_fee_month_statistics t
  1046. where t.community_id = #{communityId}
  1047. group by t.config_id,t.fee_name
  1048. order by objCount desc
  1049. </select>
  1050. </mapper>