ReportFeeMonthStatisticsServiceDaoImplMapper.xml 43 KB

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