ReportFeeMonthStatisticsServiceDaoImplMapper.xml 140 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191
  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(receivable_amount, statistics_id, update_time, remark, obj_name,
  9. received_amount, fee_year, fee_month, fee_id, config_id,
  10. obj_id, fee_name, owe_amount, community_id, fee_create_time, obj_type,
  11. deadline_time, cur_max_time,
  12. his_owe_amount, cur_receivable_amount, cur_received_amount,
  13. his_owe_received_amount, pre_received_amount, obj_name_num)
  14. values (#{receivableAmount}, #{statisticsId}, #{updateTime}, #{remark}, #{objName}, #{receivedAmount},
  15. #{feeYear}, #{feeMonth},
  16. #{feeId}, #{configId}, #{objId}, #{feeName}, #{oweAmount}, #{communityId}, #{feeCreateTime}, #{objType},
  17. #{deadlineTime}, #{curMaxTime},
  18. #{hisOweAmount}, #{curReceivableAmount}, #{curReceivedAmount}, #{hisOweReceivedAmount},
  19. #{preReceivedAmount}, #{objNameNum})
  20. </insert>
  21. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  22. <select id="getReportFeeMonthStatisticsInfo" parameterType="Map" resultType="Map">
  23. select t.receivable_amount,t.receivable_amount receivableAmount,t.statistics_id,t.statistics_id
  24. statisticsId,t.update_time,t.update_time updateTime,t.remark,t.status_cd,t.status_cd
  25. statusCd,t.obj_name,t.obj_name objName,t.received_amount,t.received_amount receivedAmount,t.fee_year,t.fee_year
  26. feeYear,t.fee_month,t.fee_month feeMonth,t.fee_id,t.fee_id feeId,t.config_id,t.config_id
  27. configId,t.obj_id,t.obj_id objId,t.fee_name,t.fee_name feeName,t.owe_amount,t.owe_amount
  28. oweAmount,t.community_id,t.community_id communityId,t.fee_create_time,t.fee_create_time
  29. feeCreateTime,t.obj_type,t.obj_type objType,t.cur_max_time curMaxTime,
  30. t.his_owe_amount hisOweAmount,t.cur_receivable_amount curReceivableAmount,t.cur_received_amount
  31. curReceivedAmount,t.obj_name_num,t.obj_name_num objNameNum,
  32. t.his_owe_received_amount hisOweReceivedAmount,t.pre_received_amount preReceivedAmount
  33. from report_fee_month_statistics t
  34. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  35. where 1 =1
  36. <if test="receivableAmount !=null and receivableAmount != ''">
  37. and t.receivable_amount= #{receivableAmount}
  38. </if>
  39. <if test="statisticsId !=null and statisticsId != ''">
  40. and t.statistics_id= #{statisticsId}
  41. </if>
  42. <if test="updateTime !=null and updateTime != ''">
  43. and t.update_time= #{updateTime}
  44. </if>
  45. <if test="remark !=null and remark != ''">
  46. and t.remark= #{remark}
  47. </if>
  48. <if test="statusCd !=null and statusCd != ''">
  49. and t.status_cd= #{statusCd}
  50. </if>
  51. <if test="objName !=null and objName != ''">
  52. and t.obj_name= #{objName}
  53. </if>
  54. <if test="objNameNum != null and objNameNum != ''">
  55. and t.obj_name_num = #{objNameNum}
  56. </if>
  57. <if test="receivedAmount !=null and receivedAmount != ''">
  58. and t.received_amount= #{receivedAmount}
  59. </if>
  60. <if test="feeYear !=null and feeYear != ''">
  61. and t.fee_year= #{feeYear}
  62. </if>
  63. <if test="feeMonth !=null and feeMonth != ''">
  64. and t.fee_month= #{feeMonth}
  65. </if>
  66. <if test="feeId !=null and feeId != ''">
  67. and t.fee_id= #{feeId}
  68. </if>
  69. <if test="configId !=null and configId != ''">
  70. and t.config_id= #{configId}
  71. </if>
  72. <if test="objId !=null and objId != ''">
  73. and t.obj_id= #{objId}
  74. </if>
  75. <if test="feeName !=null and feeName != ''">
  76. and t.fee_name= #{feeName}
  77. </if>
  78. <if test="oweAmount !=null and oweAmount != ''">
  79. and t.owe_amount= #{oweAmount}
  80. </if>
  81. <if test="communityId !=null and communityId != ''">
  82. and t.community_id= #{communityId}
  83. </if>
  84. <if test="feeCreateTime !=null and feeCreateTime != ''">
  85. and t.fee_create_time= #{feeCreateTime}
  86. </if>
  87. <if test="objType !=null and objType != ''">
  88. and t.obj_type= #{objType}
  89. </if>
  90. order by t.create_time desc
  91. <if test="page != -1 and page != null ">
  92. limit #{page}, #{row}
  93. </if>
  94. </select>
  95. <!-- 修改费用月统计信息 add by wuxw 2018-07-03 -->
  96. <update id="updateReportFeeMonthStatisticsOwe" parameterType="Map">
  97. update report_fee_month_statistics t set
  98. t.owe_amount= #{oweAmount}
  99. where 1=1
  100. <if test="statisticsId !=null and statisticsId != ''">
  101. and t.statistics_id= #{statisticsId}
  102. </if>
  103. <if test="curMaxTime !=null ">
  104. and t.cur_max_time &lt;= #{curMaxTime}
  105. </if>
  106. <if test="feeId !=null and feeId != ''">
  107. and t.fee_id= #{feeId}
  108. </if>
  109. </update>
  110. <!-- 修改费用月统计信息 add by wuxw 2018-07-03 -->
  111. <update id="updateReportFeeMonthStatisticsInfo" parameterType="Map">
  112. update report_fee_month_statistics t set t.status_cd = #{statusCd}
  113. <if test="newBId != null and newBId != ''">
  114. ,t.b_id = #{newBId}
  115. </if>
  116. <if test="receivableAmount !=null and receivableAmount != ''">
  117. , t.receivable_amount= #{receivableAmount}
  118. </if>
  119. <if test="updateTime !=null and updateTime != ''">
  120. , t.update_time= #{updateTime}
  121. </if>
  122. <if test="deadlineTime !=null ">
  123. , t.deadline_time= #{deadlineTime}
  124. </if>
  125. <if test="remark !=null and remark != ''">
  126. , t.remark= #{remark}
  127. </if>
  128. <if test="objName !=null and objName != ''">
  129. , t.obj_name= #{objName}
  130. </if>
  131. <if test="objNameNum != null and objNameNum != ''">
  132. , t.obj_name_num= #{objNameNum}
  133. </if>
  134. <if test="receivedAmount !=null and receivedAmount != ''">
  135. , t.received_amount= #{receivedAmount}
  136. </if>
  137. <if test="feeYear !=null and feeYear != ''">
  138. , t.fee_year= #{feeYear}
  139. </if>
  140. <if test="feeMonth !=null and feeMonth != ''">
  141. , t.fee_month= #{feeMonth}
  142. </if>
  143. <if test="feeId !=null and feeId != ''">
  144. , t.fee_id= #{feeId}
  145. </if>
  146. <if test="configId !=null and configId != ''">
  147. , t.config_id= #{configId}
  148. </if>
  149. <if test="objId !=null and objId != ''">
  150. , t.obj_id= #{objId}
  151. </if>
  152. <if test="feeName !=null and feeName != ''">
  153. , t.fee_name= #{feeName}
  154. </if>
  155. <if test="oweAmount !=null and oweAmount != ''">
  156. , t.owe_amount= #{oweAmount}
  157. </if>
  158. <if test="feeCreateTime !=null and feeCreateTime != ''">
  159. , t.fee_create_time= #{feeCreateTime}
  160. </if>
  161. <if test="objType !=null and objType != ''">
  162. , t.obj_type= #{objType}
  163. </if>
  164. <if test="hisOweAmount !=null and hisOweAmount != ''">
  165. , t.his_owe_amount= #{hisOweAmount}
  166. </if>
  167. <if test="curReceivableAmount !=null and curReceivableAmount != ''">
  168. , t.cur_receivable_amount= #{curReceivableAmount}
  169. </if>
  170. <if test="curReceivedAmount !=null and curReceivedAmount != ''">
  171. , t.cur_received_amount= #{curReceivedAmount}
  172. </if>
  173. <if test="hisOweReceivedAmount !=null and hisOweReceivedAmount != ''">
  174. , t.his_owe_received_amount= #{hisOweReceivedAmount}
  175. </if>
  176. <if test="preReceivedAmount !=null and preReceivedAmount != ''">
  177. , t.pre_received_amount= #{preReceivedAmount}
  178. </if>
  179. where 1=1
  180. and t.statistics_id= #{statisticsId}
  181. <if test="communityId !=null and communityId != ''">
  182. and t.community_id= #{communityId}
  183. </if>
  184. </update>
  185. <!-- 修改费用月统计信息 add by wuxw 2018-07-03 -->
  186. <update id="deleteReportFeeMonthStatisticsInfo" parameterType="Map">
  187. update report_fee_month_statistics t set t.status_cd = '1'
  188. where 1=1
  189. <if test="statisticsId !=null and statisticsId != ''">
  190. and t.statistics_id= #{statisticsId}
  191. </if>
  192. <if test="communityId !=null and communityId != ''">
  193. and t.community_id= #{communityId}
  194. </if>
  195. <if test="feeId !=null and feeId != ''">
  196. and t.fee_id= #{feeId}
  197. </if>
  198. <if test="configId !=null and configId != ''">
  199. and t.config_id= #{configId}
  200. </if>
  201. </update>
  202. <!-- 查询费用月统计数量 add by wuxw 2018-07-03 -->
  203. <select id="queryReportFeeMonthStatisticssCount" parameterType="Map" resultType="Map">
  204. select count(1) count
  205. from report_fee_month_statistics t
  206. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  207. where 1 =1
  208. <if test="receivableAmount !=null and receivableAmount != ''">
  209. and t.receivable_amount= #{receivableAmount}
  210. </if>
  211. <if test="statisticsId !=null and statisticsId != ''">
  212. and t.statistics_id= #{statisticsId}
  213. </if>
  214. <if test="updateTime !=null and updateTime != ''">
  215. and t.update_time= #{updateTime}
  216. </if>
  217. <if test="remark !=null and remark != ''">
  218. and t.remark= #{remark}
  219. </if>
  220. <if test="statusCd !=null and statusCd != ''">
  221. and t.status_cd= #{statusCd}
  222. </if>
  223. <if test="objName !=null and objName != ''">
  224. and t.obj_name= #{objName}
  225. </if>
  226. <if test="objNameNum != null and objNameNum != ''">
  227. and t.obj_name_num= #{objNameNum}
  228. </if>
  229. <if test="receivedAmount !=null and receivedAmount != ''">
  230. and t.received_amount= #{receivedAmount}
  231. </if>
  232. <if test="feeYear !=null and feeYear != ''">
  233. and t.fee_year= #{feeYear}
  234. </if>
  235. <if test="feeMonth !=null and feeMonth != ''">
  236. and t.fee_month= #{feeMonth}
  237. </if>
  238. <if test="feeId !=null and feeId != ''">
  239. and t.fee_id= #{feeId}
  240. </if>
  241. <if test="configId !=null and configId != ''">
  242. and t.config_id= #{configId}
  243. </if>
  244. <if test="objId !=null and objId != ''">
  245. and t.obj_id= #{objId}
  246. </if>
  247. <if test="feeName !=null and feeName != ''">
  248. and t.fee_name= #{feeName}
  249. </if>
  250. <if test="oweAmount !=null and oweAmount != ''">
  251. and t.owe_amount= #{oweAmount}
  252. </if>
  253. <if test="communityId !=null and communityId != ''">
  254. and t.community_id= #{communityId}
  255. </if>
  256. <if test="feeCreateTime !=null and feeCreateTime != ''">
  257. and t.fee_create_time= #{feeCreateTime}
  258. </if>
  259. <if test="objType !=null and objType != ''">
  260. and t.obj_type= #{objType}
  261. </if>
  262. </select>
  263. <!-- 查询费用月统计数量 add by wuxw 2018-07-03 -->
  264. <select id="queryReportFeeSummaryCount" parameterType="Map" resultType="Map">
  265. select count(1) count
  266. from (
  267. select t.fee_year,t.fee_month
  268. from report_fee_month_statistics t
  269. left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
  270. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  271. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  272. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  273. where t.status_cd = '0'
  274. <if test="roomNum !=null and roomNum != ''">
  275. and br.room_num= #{roomNum}
  276. </if>
  277. <if test="unitId !=null and unitId != ''">
  278. and bu.unit_id= #{unitId}
  279. </if>
  280. <if test="unitIds !=null ">
  281. and bu.unit_id in
  282. <foreach collection="unitIds" item="item" open="(" close=")" separator=",">
  283. #{item}
  284. </foreach>
  285. </if>
  286. <if test="floorId !=null and floorId != ''">
  287. and f.floor_id = #{floorId}
  288. </if>
  289. <if test="objName !=null and objName != ''">
  290. and t.obj_name= #{objName}
  291. </if>
  292. <if test="objNameNum != null and objNameNum != ''">
  293. and t.obj_name_num= #{objNameNum}
  294. </if>
  295. <if test="feeYear !=null and feeYear != ''">
  296. and t.fee_year= #{feeYear}
  297. </if>
  298. <if test="feeMonth !=null and feeMonth != ''">
  299. and t.fee_month= #{feeMonth}
  300. </if>
  301. <if test="feeId !=null and feeId != ''">
  302. and t.fee_id= #{feeId}
  303. </if>
  304. <if test="configId !=null and configId != ''">
  305. and t.config_id= #{configId}
  306. </if>
  307. <if test="configIds !=null">
  308. and t.config_id in
  309. <foreach collection="configIds" item="item" open="(" close=")" separator=",">
  310. #{item}
  311. </foreach>
  312. </if>
  313. <if test="objId !=null and objId != ''">
  314. and t.obj_id= #{objId}
  315. </if>
  316. <if test="feeName !=null and feeName != ''">
  317. and t.fee_name= #{feeName}
  318. </if>
  319. <if test="communityId !=null and communityId != ''">
  320. and t.community_id= #{communityId}
  321. </if>
  322. <if test="startTime !=null and startTime != ''">
  323. and t.create_time &gt;= #{startTime}
  324. </if>
  325. <if test="endTime !=null and endTime != ''">
  326. and t.create_time &lt;= #{endTime}
  327. </if>
  328. group by t.fee_year,t.fee_month
  329. ) t
  330. </select>
  331. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  332. <select id="queryReportFeeSummary" parameterType="Map" resultType="Map">
  333. select t.fee_year feeYear,t.fee_month feeMonth,max(t.create_time) createTime
  334. <if test="configIds !=null">
  335. ,t.config_id configId
  336. </if>
  337. ,SUM(t.his_owe_amount) hisOweAmount,SUM(t.cur_receivable_amount) curReceivableAmount,
  338. SUM(t.cur_received_amount) curReceivedAmount,SUM(t.his_owe_received_amount)
  339. hisOweReceivedAmount,SUM(t.pre_received_amount) preReceivedAmount,
  340. max(t.update_time) updateTime,sum(t.his_owe_amount+t.cur_receivable_amount)
  341. receivableAmount,sum(t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount) receivedAmount
  342. from report_fee_month_statistics t
  343. left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
  344. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  345. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  346. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  347. where t.status_cd = '0'
  348. <if test="roomNum !=null and roomNum != ''">
  349. and br.room_num= #{roomNum}
  350. </if>
  351. <if test="unitId !=null and unitId != ''">
  352. and bu.unit_id= #{unitId}
  353. </if>
  354. <if test="unitIds !=null ">
  355. and bu.unit_id in
  356. <foreach collection="unitIds" item="item" open="(" close=")" separator=",">
  357. #{item}
  358. </foreach>
  359. </if>
  360. <if test="floorId !=null and floorId != ''">
  361. and f.floor_id = #{floorId}
  362. </if>
  363. <if test="objName !=null and objName != ''">
  364. and t.obj_name= #{objName}
  365. </if>
  366. <if test="objNameNum != null and objNameNum != ''">
  367. and t.obj_name_num= #{objNameNum}
  368. </if>
  369. <if test="feeYear !=null and feeYear != ''">
  370. and t.fee_year= #{feeYear}
  371. </if>
  372. <if test="feeMonth !=null and feeMonth != ''">
  373. and t.fee_month= #{feeMonth}
  374. </if>
  375. <if test="feeId !=null and feeId != ''">
  376. and t.fee_id= #{feeId}
  377. </if>
  378. <if test="configId !=null and configId != ''">
  379. and t.config_id= #{configId}
  380. </if>
  381. <if test="configIds !=null">
  382. and t.config_id in
  383. <foreach collection="configIds" item="item" open="(" close=")" separator=",">
  384. #{item}
  385. </foreach>
  386. </if>
  387. <if test="objId !=null and objId != ''">
  388. and t.obj_id= #{objId}
  389. </if>
  390. <if test="feeName !=null and feeName != ''">
  391. and t.fee_name= #{feeName}
  392. </if>
  393. <if test="communityId !=null and communityId != ''">
  394. and t.community_id= #{communityId}
  395. </if>
  396. <if test="startTime !=null and startTime != ''">
  397. and t.create_time &gt;= #{startTime}
  398. </if>
  399. <if test="endTime !=null and endTime != ''">
  400. and t.create_time &lt;= #{endTime}
  401. </if>
  402. group by t.fee_year,t.fee_month
  403. <if test="configIds !=null">
  404. ,t.config_id
  405. </if>
  406. order by CONVERT(t.fee_month,SIGNED),CONVERT(t.fee_year,SIGNED) desc
  407. <if test="page != -1 and page != null ">
  408. limit #{page}, #{row}
  409. </if>
  410. </select>
  411. <select id="queryReportFeeSummaryDetailCount" parameterType="Map" resultType="Map">
  412. select count(1) count
  413. from report_fee_month_statistics t
  414. left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
  415. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  416. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  417. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  418. where t.status_cd = '0'
  419. <if test="roomNum !=null and roomNum != ''">
  420. and br.room_num= #{roomNum}
  421. </if>
  422. <if test="unitId !=null and unitId != ''">
  423. and bu.unit_id= #{unitId}
  424. </if>
  425. <if test="unitIds !=null ">
  426. and bu.unit_id in
  427. <foreach collection="unitIds" item="item" open="(" close=")" separator=",">
  428. #{item}
  429. </foreach>
  430. </if>
  431. <if test="floorId !=null and floorId != ''">
  432. and f.floor_id = #{floorId}
  433. </if>
  434. <if test="objName !=null and objName != ''">
  435. and t.obj_name= #{objName}
  436. </if>
  437. <if test="objNameNum != null and objNameNum != ''">
  438. and t.obj_name_num= #{objNameNum}
  439. </if>
  440. <if test="feeYear !=null and feeYear != ''">
  441. and t.fee_year= #{feeYear}
  442. </if>
  443. <if test="feeMonth !=null and feeMonth != ''">
  444. and t.fee_month= #{feeMonth}
  445. </if>
  446. <if test="feeId !=null and feeId != ''">
  447. and t.fee_id= #{feeId}
  448. </if>
  449. <if test="configId !=null and configId != ''">
  450. and t.config_id= #{configId}
  451. </if>
  452. <if test="configIds !=null">
  453. and t.config_id in
  454. <foreach collection="configIds" item="item" open="(" close=")" separator=",">
  455. #{item}
  456. </foreach>
  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 and startTime != ''">
  468. and t.create_time &gt;= #{startTime}
  469. </if>
  470. <if test="endTime !=null and endTime != ''">
  471. and t.create_time &lt;= #{endTime}
  472. </if>
  473. </select>
  474. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  475. <select id="queryReportFeeSummaryDetail" parameterType="Map" resultType="Map">
  476. select t.obj_name objName,t.fee_name feeName,t.fee_year feeYear,t.fee_month feeMonth,t.create_time createTime
  477. ,t.config_id configId,t.obj_name_num objNameNum,t.his_owe_amount hisOweAmount,t.cur_receivable_amount
  478. curReceivableAmount,t.cur_received_amount curReceivedAmount,t.his_owe_received_amount
  479. hisOweReceivedAmount,t.pre_received_amount preReceivedAmount,
  480. t.update_time updateTime,t.his_owe_amount+t.cur_receivable_amount
  481. receivableAmount,t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount receivedAmount
  482. from report_fee_month_statistics t
  483. left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
  484. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  485. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  486. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.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="unitIds !=null ">
  495. and bu.unit_id in
  496. <foreach collection="unitIds" item="item" open="(" close=")" separator=",">
  497. #{item}
  498. </foreach>
  499. </if>
  500. <if test="floorId !=null and floorId != ''">
  501. and f.floor_id = #{floorId}
  502. </if>
  503. <if test="objName !=null and objName != ''">
  504. and t.obj_name= #{objName}
  505. </if>
  506. <if test="objNameNum != null and objNameNum != ''">
  507. and t.obj_name_num= #{objNameNum}
  508. </if>
  509. <if test="feeYear !=null and feeYear != ''">
  510. and t.fee_year= #{feeYear}
  511. </if>
  512. <if test="feeMonth !=null and feeMonth != ''">
  513. and t.fee_month= #{feeMonth}
  514. </if>
  515. <if test="feeId !=null and feeId != ''">
  516. and t.fee_id= #{feeId}
  517. </if>
  518. <if test="configId !=null and configId != ''">
  519. and t.config_id= #{configId}
  520. </if>
  521. <if test="configIds !=null">
  522. and t.config_id in
  523. <foreach collection="configIds" item="item" open="(" close=")" separator=",">
  524. #{item}
  525. </foreach>
  526. </if>
  527. <if test="objId !=null and objId != ''">
  528. and t.obj_id= #{objId}
  529. </if>
  530. <if test="feeName !=null and feeName != ''">
  531. and t.fee_name= #{feeName}
  532. </if>
  533. <if test="communityId !=null and communityId != ''">
  534. and t.community_id= #{communityId}
  535. </if>
  536. <if test="startTime !=null and startTime != ''">
  537. and t.create_time &gt;= #{startTime}
  538. </if>
  539. <if test="endTime !=null and endTime != ''">
  540. and t.create_time &lt;= #{endTime}
  541. </if>
  542. <if test="page != -1 and page != null ">
  543. limit #{page}, #{row}
  544. </if>
  545. </select>
  546. <!-- 查询费用月统计信息 大计 add by wuxw 2018-07-03 -->
  547. <select id="queryReportFeeSummaryMajor" parameterType="Map" resultType="Map">
  548. select
  549. sum(t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount) allReceivedAmount,
  550. sum(t.his_owe_received_amount) allHisOweReceivedAmount
  551. from report_fee_month_statistics t
  552. left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
  553. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  554. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  555. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  556. where t.status_cd = '0'
  557. <if test="roomNum !=null and roomNum != ''">
  558. and br.room_num= #{roomNum}
  559. </if>
  560. <if test="unitId !=null and unitId != ''">
  561. and bu.unit_id= #{unitId}
  562. </if>
  563. <if test="unitIds !=null ">
  564. and bu.unit_id in
  565. <foreach collection="unitIds" item="item" open="(" close=")" separator=",">
  566. #{item}
  567. </foreach>
  568. </if>
  569. <if test="floorId !=null and floorId != ''">
  570. and f.floor_id = #{floorId}
  571. </if>
  572. <if test="objName !=null and objName != ''">
  573. and t.obj_name= #{objName}
  574. </if>
  575. <if test="objNameNum != null and objNameNum != ''">
  576. and t.obj_name_num= #{objNameNum}
  577. </if>
  578. <if test="feeYear !=null and feeYear != ''">
  579. and t.fee_year= #{feeYear}
  580. </if>
  581. <if test="feeMonth !=null and feeMonth != ''">
  582. and t.fee_month= #{feeMonth}
  583. </if>
  584. <if test="feeId !=null and feeId != ''">
  585. and t.fee_id= #{feeId}
  586. </if>
  587. <if test="configId !=null and configId != ''">
  588. and t.config_id= #{configId}
  589. </if>
  590. <if test="configIds !=null">
  591. and t.config_id in
  592. <foreach collection="configIds" item="item" open="(" close=")" separator=",">
  593. #{item}
  594. </foreach>
  595. </if>
  596. <if test="objId !=null and objId != ''">
  597. and t.obj_id= #{objId}
  598. </if>
  599. <if test="feeName !=null and feeName != ''">
  600. and t.fee_name= #{feeName}
  601. </if>
  602. <if test="communityId !=null and communityId != ''">
  603. and t.community_id= #{communityId}
  604. </if>
  605. <if test="startTime !=null and startTime != ''">
  606. and t.create_time &gt;= #{startTime}
  607. </if>
  608. <if test="endTime !=null and endTime != ''">
  609. and t.create_time &lt;= #{endTime}
  610. </if>
  611. </select>
  612. <select id="queryReportFloorUnitFeeSummaryCount" parameterType="Map" resultType="Map">
  613. select count(1) count
  614. from (
  615. select t.fee_year feeYear,t.fee_month feeMonth, f.floor_num flooNum, bu.unit_num unitNum
  616. from report_fee_month_statistics t
  617. INNER JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0'
  618. inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  619. inner join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  620. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  621. where t.status_cd = '0'
  622. <if test="roomNum !=null and roomNum != ''">
  623. and br.room_num= #{roomNum}
  624. </if>
  625. <if test="unitId !=null and unitId != ''">
  626. and bu.unit_id= #{unitId}
  627. </if>
  628. <if test="floorId !=null and floorId != ''">
  629. and f.floor_id = #{floorId}
  630. </if>
  631. <if test="objName !=null and objName != ''">
  632. and t.obj_name= #{objName}
  633. </if>
  634. <if test="objNameNum != null and objNameNum != ''">
  635. and t.obj_name_num= #{objNameNum}
  636. </if>
  637. <if test="feeYear !=null and feeYear != ''">
  638. and t.fee_year= #{feeYear}
  639. </if>
  640. <if test="feeMonth !=null and feeMonth != ''">
  641. and t.fee_month= #{feeMonth}
  642. </if>
  643. <if test="feeId !=null and feeId != ''">
  644. and t.fee_id= #{feeId}
  645. </if>
  646. <if test="configId !=null and configId != ''">
  647. and t.config_id= #{configId}
  648. </if>
  649. <if test="configIds !=null">
  650. and t.config_id in
  651. <foreach collection="configIds" item="item" open="(" close=")" separator=",">
  652. #{item}
  653. </foreach>
  654. </if>
  655. <if test="objId !=null and objId != ''">
  656. and t.obj_id= #{objId}
  657. </if>
  658. <if test="feeName !=null and feeName != ''">
  659. and t.fee_name= #{feeName}
  660. </if>
  661. <if test="communityId !=null and communityId != ''">
  662. and t.community_id= #{communityId}
  663. </if>
  664. <if test="startTime !=null and startTime != ''">
  665. and t.create_time &gt;= #{startTime}
  666. </if>
  667. <if test="endTime !=null and endTime != ''">
  668. and t.create_time &lt;= #{endTime}
  669. </if>
  670. GROUP BY t.fee_year,t.fee_month,f.floor_num,bu.unit_id,bu.unit_num
  671. ) t
  672. </select>
  673. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  674. <select id="queryReportFloorUnitFeeSummary" parameterType="Map" resultType="Map">
  675. select t.fee_year feeYear,t.fee_month feeMonth, f.floor_num floorNum, bu.unit_num unitNum,max(t.update_time)
  676. updateTime
  677. <if test="configIds !=null">
  678. ,t.config_id configId
  679. </if>
  680. ,SUM(t.his_owe_amount) hisOweAmount,SUM(t.cur_receivable_amount) curReceivableAmount,
  681. SUM(t.cur_received_amount) curReceivedAmount,SUM(t.his_owe_received_amount)
  682. hisOweReceivedAmount,SUM(t.pre_received_amount) preReceivedAmount,
  683. max(t.update_time) updateTime,sum(t.his_owe_amount+t.cur_receivable_amount) receivableAmount,
  684. sum(t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount) receivedAmount
  685. from report_fee_month_statistics t
  686. INNER JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0'
  687. inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  688. inner join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  689. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  690. where t.status_cd = '0'
  691. <if test="roomNum !=null and roomNum != ''">
  692. and br.room_num= #{roomNum}
  693. </if>
  694. <if test="unitId !=null and unitId != ''">
  695. and bu.unit_id= #{unitId}
  696. </if>
  697. <if test="floorId !=null and floorId != ''">
  698. and f.floor_id = #{floorId}
  699. </if>
  700. <if test="objName !=null and objName != ''">
  701. and t.obj_name= #{objName}
  702. </if>
  703. <if test="objNameNum != null and objNameNum != ''">
  704. and t.obj_name_num= #{objNameNum}
  705. </if>
  706. <if test="feeYear !=null and feeYear != ''">
  707. and t.fee_year= #{feeYear}
  708. </if>
  709. <if test="feeMonth !=null and feeMonth != ''">
  710. and t.fee_month= #{feeMonth}
  711. </if>
  712. <if test="feeId !=null and feeId != ''">
  713. and t.fee_id= #{feeId}
  714. </if>
  715. <if test="configId !=null and configId != ''">
  716. and t.config_id= #{configId}
  717. </if>
  718. <if test="configIds !=null">
  719. and t.config_id in
  720. <foreach collection="configIds" item="item" open="(" close=")" separator=",">
  721. #{item}
  722. </foreach>
  723. </if>
  724. <if test="objId !=null and objId != ''">
  725. and t.obj_id= #{objId}
  726. </if>
  727. <if test="feeName !=null and feeName != ''">
  728. and t.fee_name= #{feeName}
  729. </if>
  730. <if test="communityId !=null and communityId != ''">
  731. and t.community_id= #{communityId}
  732. </if>
  733. <if test="startTime !=null and startTime != ''">
  734. and t.create_time &gt;= #{startTime}
  735. </if>
  736. <if test="endTime !=null and endTime != ''">
  737. and t.create_time &lt;= #{endTime}
  738. </if>
  739. GROUP BY t.fee_year,t.fee_month,f.floor_num,bu.unit_id,bu.unit_num
  740. <if test="configIds !=null">
  741. ,t.config_id
  742. </if>
  743. <if test="page != -1 and page != null ">
  744. limit #{page}, #{row}
  745. </if>
  746. </select>
  747. <select id="queryReportFloorUnitFeeSummaryDetailCount" parameterType="Map" resultType="Map">
  748. select count(1) count
  749. from report_fee_month_statistics t
  750. INNER JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0'
  751. inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  752. inner join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  753. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  754. where t.status_cd = '0'
  755. <if test="roomNum !=null and roomNum != ''">
  756. and br.room_num= #{roomNum}
  757. </if>
  758. <if test="unitId !=null and unitId != ''">
  759. and bu.unit_id= #{unitId}
  760. </if>
  761. <if test="unitNum !=null and unitNum != ''">
  762. and bu.unit_num= #{unitNum}
  763. </if>
  764. <if test="floorId !=null and floorId != ''">
  765. and f.floor_id = #{floorId}
  766. </if>
  767. <if test="floorNum !=null and floorNum != ''">
  768. and f.floor_num = #{floorNum}
  769. </if>
  770. <if test="objName !=null and objName != ''">
  771. and t.obj_name= #{objName}
  772. </if>
  773. <if test="objNameNum != null and objNameNum != ''">
  774. and t.obj_name_num= #{objNameNum}
  775. </if>
  776. <if test="feeYear !=null and feeYear != ''">
  777. and t.fee_year= #{feeYear}
  778. </if>
  779. <if test="feeMonth !=null and feeMonth != ''">
  780. and t.fee_month= #{feeMonth}
  781. </if>
  782. <if test="feeId !=null and feeId != ''">
  783. and t.fee_id= #{feeId}
  784. </if>
  785. <if test="configId !=null and configId != ''">
  786. and t.config_id= #{configId}
  787. </if>
  788. <if test="configIds !=null">
  789. and t.config_id in
  790. <foreach collection="configIds" item="item" open="(" close=")" separator=",">
  791. #{item}
  792. </foreach>
  793. </if>
  794. <if test="objId !=null and objId != ''">
  795. and t.obj_id= #{objId}
  796. </if>
  797. <if test="feeName !=null and feeName != ''">
  798. and t.fee_name= #{feeName}
  799. </if>
  800. <if test="communityId !=null and communityId != ''">
  801. and t.community_id= #{communityId}
  802. </if>
  803. <if test="startTime !=null and startTime != ''">
  804. and t.create_time &gt;= #{startTime}
  805. </if>
  806. <if test="endTime !=null and endTime != ''">
  807. and t.create_time &lt;= #{endTime}
  808. </if>
  809. </select>
  810. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  811. <select id="queryReportFloorUnitFeeSummaryDetail" parameterType="Map" resultType="Map">
  812. select t.obj_name objName,t.fee_name feeName,t.fee_year feeYear,t.fee_month feeMonth,t.create_time createTime
  813. ,t.config_id configId,t.obj_name_num objNameNum,t.his_owe_amount hisOweAmount,t.cur_receivable_amount
  814. curReceivableAmount,t.cur_received_amount curReceivedAmount,t.his_owe_received_amount
  815. hisOweReceivedAmount,t.pre_received_amount preReceivedAmount,
  816. t.update_time updateTime,t.his_owe_amount+t.cur_receivable_amount receivableAmount,
  817. t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount receivedAmount
  818. from report_fee_month_statistics t
  819. INNER JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0'
  820. inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  821. inner join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  822. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  823. where t.status_cd = '0'
  824. <if test="roomNum !=null and roomNum != ''">
  825. and br.room_num= #{roomNum}
  826. </if>
  827. <if test="unitId !=null and unitId != ''">
  828. and bu.unit_id= #{unitId}
  829. </if>
  830. <if test="unitNum !=null and unitNum != ''">
  831. and bu.unit_num= #{unitNum}
  832. </if>
  833. <if test="floorId !=null and floorId != ''">
  834. and f.floor_id = #{floorId}
  835. </if>
  836. <if test="floorNum !=null and floorNum != ''">
  837. and f.floor_num = #{floorNum}
  838. </if>
  839. <if test="objName !=null and objName != ''">
  840. and t.obj_name= #{objName}
  841. </if>
  842. <if test="objNameNum != null and objNameNum != ''">
  843. and t.obj_name_num= #{objNameNum}
  844. </if>
  845. <if test="feeYear !=null and feeYear != ''">
  846. and t.fee_year= #{feeYear}
  847. </if>
  848. <if test="feeMonth !=null and feeMonth != ''">
  849. and t.fee_month= #{feeMonth}
  850. </if>
  851. <if test="feeId !=null and feeId != ''">
  852. and t.fee_id= #{feeId}
  853. </if>
  854. <if test="configId !=null and configId != ''">
  855. and t.config_id= #{configId}
  856. </if>
  857. <if test="configIds !=null">
  858. and t.config_id in
  859. <foreach collection="configIds" item="item" open="(" close=")" separator=",">
  860. #{item}
  861. </foreach>
  862. </if>
  863. <if test="objId !=null and objId != ''">
  864. and t.obj_id= #{objId}
  865. </if>
  866. <if test="feeName !=null and feeName != ''">
  867. and t.fee_name= #{feeName}
  868. </if>
  869. <if test="communityId !=null and communityId != ''">
  870. and t.community_id= #{communityId}
  871. </if>
  872. <if test="startTime !=null and startTime != ''">
  873. and t.create_time &gt;= #{startTime}
  874. </if>
  875. <if test="endTime !=null and endTime != ''">
  876. and t.create_time &lt;= #{endTime}
  877. </if>
  878. <if test="page != -1 and page != null ">
  879. limit #{page}, #{row}
  880. </if>
  881. </select>
  882. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  883. <select id="queryReportFloorUnitFeeSummaryMajor" parameterType="Map" resultType="Map">
  884. select
  885. sum(t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount) allReceivedAmount,
  886. sum(t.his_owe_received_amount) allHisOweReceivedAmount
  887. from report_fee_month_statistics t
  888. INNER JOIN building_room br on t.obj_id = br.room_id and br.status_cd = '0'
  889. inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  890. inner join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  891. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  892. where t.status_cd = '0'
  893. <if test="roomNum !=null and roomNum != ''">
  894. and br.room_num= #{roomNum}
  895. </if>
  896. <if test="unitId !=null and unitId != ''">
  897. and bu.unit_id= #{unitId}
  898. </if>
  899. <if test="floorId !=null and floorId != ''">
  900. and f.floor_id = #{floorId}
  901. </if>
  902. <if test="objName !=null and objName != ''">
  903. and t.obj_name= #{objName}
  904. </if>
  905. <if test="objNameNum != null and objNameNum != ''">
  906. and t.obj_name_num= #{objNameNum}
  907. </if>
  908. <if test="feeYear !=null and feeYear != ''">
  909. and t.fee_year= #{feeYear}
  910. </if>
  911. <if test="feeMonth !=null and feeMonth != ''">
  912. and t.fee_month= #{feeMonth}
  913. </if>
  914. <if test="feeId !=null and feeId != ''">
  915. and t.fee_id= #{feeId}
  916. </if>
  917. <if test="configId !=null and configId != ''">
  918. and t.config_id= #{configId}
  919. </if>
  920. <if test="objId !=null and objId != ''">
  921. and t.obj_id= #{objId}
  922. </if>
  923. <if test="feeName !=null and feeName != ''">
  924. and t.fee_name= #{feeName}
  925. </if>
  926. <if test="communityId !=null and communityId != ''">
  927. and t.community_id= #{communityId}
  928. </if>
  929. <if test="startTime !=null and startTime != ''">
  930. and t.create_time &gt;= #{startTime}
  931. </if>
  932. <if test="endTime !=null and endTime != ''">
  933. and t.create_time &lt;= #{endTime}
  934. </if>
  935. </select>
  936. <!--
  937. and t.receivable_amount >= 0 and t.received_amount >= 0 and t.owe_amount >= 0
  938. -->
  939. <select id="queryFeeBreakdownCount" parameterType="Map" resultType="Map">
  940. select count(1) count
  941. from (
  942. select t.fee_name feeName,td.name feeTypeCd,pfc.fee_type_cd,pfc.start_time feeCreateTime,t.create_time
  943. createTime
  944. from report_fee_month_statistics t
  945. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  946. left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
  947. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  948. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  949. left join t_dict td on pfc.fee_type_cd = td.status_cd and td.table_name='pay_fee_config' and
  950. td.table_columns='fee_type_cd'
  951. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  952. where t.status_cd = '0'
  953. <if test="roomNum !=null and roomNum != ''">
  954. and br.room_num= #{roomNum}
  955. </if>
  956. <if test="unitId !=null and unitId != ''">
  957. and bu.unit_id= #{unitId}
  958. </if>
  959. <if test="floorId !=null and floorId != ''">
  960. and f.floor_id = #{floorId}
  961. </if>
  962. <if test="objName !=null and objName != ''">
  963. and t.obj_name= #{objName}
  964. </if>
  965. <if test="objNameNum != null and objNameNum != ''">
  966. and t.obj_name_num= #{objNameNum}
  967. </if>
  968. <if test="feeYear !=null and feeYear != ''">
  969. and t.fee_year= #{feeYear}
  970. </if>
  971. <if test="feeMonth !=null and feeMonth != ''">
  972. and t.fee_month= #{feeMonth}
  973. </if>
  974. <if test="feeId !=null and feeId != ''">
  975. and t.fee_id= #{feeId}
  976. </if>
  977. <if test="configId !=null and configId != ''">
  978. and pfc.config_id= #{configId}
  979. </if>
  980. <if test="objId !=null and objId != ''">
  981. and t.obj_id= #{objId}
  982. </if>
  983. <if test="feeName !=null and feeName != ''">
  984. and t.fee_name= #{feeName}
  985. </if>
  986. <if test="feeTypeCd != null and feeTypeCd != ''">
  987. and pfc.fee_type_cd = #{feeTypeCd}
  988. </if>
  989. <if test="communityId !=null and communityId != ''">
  990. and t.community_id= #{communityId}
  991. </if>
  992. <if test="startTime !=null and startTime != ''">
  993. and pfc.start_time &gt;= #{startTime}
  994. </if>
  995. <if test="endTime !=null and endTime != ''">
  996. and pfc.start_time &lt;= #{endTime}
  997. </if>
  998. <if test="yearMonth !=null and yearMonth != ''">
  999. and concat(t.fee_year,lpad(t.fee_month,2,0)) = #{yearMonth}
  1000. </if>
  1001. group by t.fee_name ,td.name ,pfc.fee_type_cd,pfc.start_time ,t.create_time
  1002. ) t
  1003. </select>
  1004. <!-- 查询费用月统计信息 add by wuxw 2018-07-03
  1005. and t.receivable_amount >= 0 and t.received_amount >= 0 and t.owe_amount >= 0
  1006. -->
  1007. <select id="queryFeeBreakdown" parameterType="Map" resultType="Map">
  1008. select t.fee_name feeName,td.name feeTypeCd,pfc.fee_type_cd,t.config_id configId,SUM(t.his_owe_amount)
  1009. hisOweAmount,SUM(t.cur_receivable_amount) curReceivableAmount,
  1010. SUM(t.cur_received_amount) curReceivedAmount,SUM(t.his_owe_received_amount)
  1011. hisOweReceivedAmount,SUM(t.pre_received_amount) preReceivedAmount,
  1012. max(t.update_time) updateTime,sum(t.his_owe_amount+t.cur_receivable_amount) receivableAmount,
  1013. sum(t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount) receivedAmount,max(t.update_time)
  1014. updateTime
  1015. from report_fee_month_statistics t
  1016. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  1017. left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
  1018. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  1019. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  1020. left join t_dict td on pfc.fee_type_cd = td.status_cd and td.table_name='pay_fee_config' and
  1021. td.table_columns='fee_type_cd'
  1022. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  1023. where t.status_cd = '0'
  1024. <if test="roomNum !=null and roomNum != ''">
  1025. and br.room_num= #{roomNum}
  1026. </if>
  1027. <if test="unitId !=null and unitId != ''">
  1028. and bu.unit_id= #{unitId}
  1029. </if>
  1030. <if test="floorId !=null and floorId != ''">
  1031. and f.floor_id = #{floorId}
  1032. </if>
  1033. <if test="objName !=null and objName != ''">
  1034. and t.obj_name= #{objName}
  1035. </if>
  1036. <if test="objNameNum != null and objNameNum != ''">
  1037. and t.obj_name_num= #{objNameNum}
  1038. </if>
  1039. <if test="feeYear !=null and feeYear != ''">
  1040. and t.fee_year= #{feeYear}
  1041. </if>
  1042. <if test="feeMonth !=null and feeMonth != ''">
  1043. and t.fee_month= #{feeMonth}
  1044. </if>
  1045. <if test="feeId !=null and feeId != ''">
  1046. and t.fee_id= #{feeId}
  1047. </if>
  1048. <if test="configId !=null and configId != ''">
  1049. and pfc.config_id= #{configId}
  1050. </if>
  1051. <if test="objId !=null and objId != ''">
  1052. and t.obj_id= #{objId}
  1053. </if>
  1054. <if test="feeName !=null and feeName != ''">
  1055. and t.fee_name= #{feeName}
  1056. </if>
  1057. <if test="feeTypeCd != null and feeTypeCd != ''">
  1058. and pfc.fee_type_cd = #{feeTypeCd}
  1059. </if>
  1060. <if test="communityId !=null and communityId != ''">
  1061. and t.community_id= #{communityId}
  1062. </if>
  1063. <if test="startTime !=null and startTime != ''">
  1064. and pfc.start_time &gt;= #{startTime}
  1065. </if>
  1066. <if test="endTime !=null and endTime != ''">
  1067. and pfc.start_time &lt;= #{endTime}
  1068. </if>
  1069. <if test="yearMonth !=null and yearMonth != ''">
  1070. and concat(t.fee_year,lpad(t.fee_month,2,0)) = #{yearMonth}
  1071. </if>
  1072. group by t.fee_name,td.name ,pfc.fee_type_cd,t.config_id ,t.create_time
  1073. order by t.create_time desc
  1074. <if test="page != -1 and page != null ">
  1075. limit #{page}, #{row}
  1076. </if>
  1077. </select>
  1078. <select id="queryFeeBreakdownDetailCount" parameterType="Map" resultType="Map">
  1079. select count(1) count
  1080. from report_fee_month_statistics t
  1081. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  1082. left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
  1083. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  1084. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  1085. left join t_dict td on pfc.fee_type_cd = td.status_cd and td.table_name='pay_fee_config' and
  1086. td.table_columns='fee_type_cd'
  1087. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  1088. where t.status_cd = '0'
  1089. <if test="roomNum !=null and roomNum != ''">
  1090. and br.room_num= #{roomNum}
  1091. </if>
  1092. <if test="unitId !=null and unitId != ''">
  1093. and bu.unit_id= #{unitId}
  1094. </if>
  1095. <if test="floorId !=null and floorId != ''">
  1096. and f.floor_id = #{floorId}
  1097. </if>
  1098. <if test="objName !=null and objName != ''">
  1099. and t.obj_name= #{objName}
  1100. </if>
  1101. <if test="objNameNum != null and objNameNum != ''">
  1102. and t.obj_name_num= #{objNameNum}
  1103. </if>
  1104. <if test="feeYear !=null and feeYear != ''">
  1105. and t.fee_year= #{feeYear}
  1106. </if>
  1107. <if test="feeMonth !=null and feeMonth != ''">
  1108. and t.fee_month= #{feeMonth}
  1109. </if>
  1110. <if test="feeId !=null and feeId != ''">
  1111. and t.fee_id= #{feeId}
  1112. </if>
  1113. <if test="configId !=null and configId != ''">
  1114. and pfc.config_id= #{configId}
  1115. </if>
  1116. <if test="objId !=null and objId != ''">
  1117. and t.obj_id= #{objId}
  1118. </if>
  1119. <if test="feeName !=null and feeName != ''">
  1120. and t.fee_name= #{feeName}
  1121. </if>
  1122. <if test="feeTypeCd != null and feeTypeCd != ''">
  1123. and pfc.fee_type_cd = #{feeTypeCd}
  1124. </if>
  1125. <if test="communityId !=null and communityId != ''">
  1126. and t.community_id= #{communityId}
  1127. </if>
  1128. <if test="startTime !=null and startTime != ''">
  1129. and pfc.start_time &gt;= #{startTime}
  1130. </if>
  1131. <if test="endTime !=null and endTime != ''">
  1132. and pfc.start_time &lt;= #{endTime}
  1133. </if>
  1134. <if test="yearMonth !=null and yearMonth != ''">
  1135. and concat(t.fee_year,lpad(t.fee_month,2,0)) = #{yearMonth}
  1136. </if>
  1137. </select>
  1138. <!-- 查询费用月统计信息 add by wuxw 2018-07-03
  1139. and t.receivable_amount >= 0 and t.received_amount >= 0 and t.owe_amount >= 0
  1140. -->
  1141. <select id="queryFeeBreakdownDetail" parameterType="Map" resultType="Map">
  1142. select t.obj_name objName,t.fee_name feeName,t.fee_year feeYear,t.fee_month feeMonth,t.create_time createTime
  1143. ,t.config_id configId,t.his_owe_amount hisOweAmount,t.obj_name_num objNameNum,t.cur_receivable_amount
  1144. curReceivableAmount,t.cur_received_amount curReceivedAmount,t.his_owe_received_amount
  1145. hisOweReceivedAmount,t.pre_received_amount preReceivedAmount,
  1146. t.update_time updateTime,t.his_owe_amount+t.cur_receivable_amount receivableAmount,
  1147. t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount receivedAmount,t.update_time
  1148. updateTime
  1149. from report_fee_month_statistics t
  1150. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  1151. left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
  1152. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  1153. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  1154. left join t_dict td on pfc.fee_type_cd = td.status_cd and td.table_name='pay_fee_config' and
  1155. td.table_columns='fee_type_cd'
  1156. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  1157. where t.status_cd = '0'
  1158. <if test="roomNum !=null and roomNum != ''">
  1159. and br.room_num= #{roomNum}
  1160. </if>
  1161. <if test="unitId !=null and unitId != ''">
  1162. and bu.unit_id= #{unitId}
  1163. </if>
  1164. <if test="floorId !=null and floorId != ''">
  1165. and f.floor_id = #{floorId}
  1166. </if>
  1167. <if test="objName !=null and objName != ''">
  1168. and t.obj_name= #{objName}
  1169. </if>
  1170. <if test="objNameNum != null and objNameNum != ''">
  1171. and t.obj_name_num= #{objNameNum}
  1172. </if>
  1173. <if test="feeYear !=null and feeYear != ''">
  1174. and t.fee_year= #{feeYear}
  1175. </if>
  1176. <if test="feeMonth !=null and feeMonth != ''">
  1177. and t.fee_month= #{feeMonth}
  1178. </if>
  1179. <if test="feeId !=null and feeId != ''">
  1180. and t.fee_id= #{feeId}
  1181. </if>
  1182. <if test="configId !=null and configId != ''">
  1183. and pfc.config_id= #{configId}
  1184. </if>
  1185. <if test="objId !=null and objId != ''">
  1186. and t.obj_id= #{objId}
  1187. </if>
  1188. <if test="feeName !=null and feeName != ''">
  1189. and t.fee_name= #{feeName}
  1190. </if>
  1191. <if test="feeTypeCd != null and feeTypeCd != ''">
  1192. and pfc.fee_type_cd = #{feeTypeCd}
  1193. </if>
  1194. <if test="communityId !=null and communityId != ''">
  1195. and t.community_id= #{communityId}
  1196. </if>
  1197. <if test="startTime !=null and startTime != ''">
  1198. and pfc.start_time &gt;= #{startTime}
  1199. </if>
  1200. <if test="endTime !=null and endTime != ''">
  1201. and pfc.start_time &lt;= #{endTime}
  1202. </if>
  1203. <if test="yearMonth !=null and yearMonth != ''">
  1204. and concat(t.fee_year,lpad(t.fee_month,2,0)) = #{yearMonth}
  1205. </if>
  1206. order by t.create_time desc
  1207. <if test="page != -1 and page != null ">
  1208. limit #{page}, #{row}
  1209. </if>
  1210. </select>
  1211. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 and t.receivable_amount >= 0 and t.received_amount >= 0 and t.owe_amount >= 0 -->
  1212. <select id="queryFeeBreakdownMajor" parameterType="Map" resultType="Map">
  1213. select
  1214. SUM(t.his_owe_amount + t.cur_receivable_amount) allReceivableAmount,
  1215. SUM(t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount) allReceivedAmount,
  1216. if(SUM(t.his_owe_amount + t.cur_receivable_amount - t.cur_received_amount - t.his_owe_received_amount) &lt; 0,0,
  1217. SUM(t.his_owe_amount + t.cur_receivable_amount - t.cur_received_amount - t.his_owe_received_amount))
  1218. allOweAmount,
  1219. SUM(t.his_owe_received_amount) allHisOweReceivedAmount
  1220. from report_fee_month_statistics t
  1221. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  1222. left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
  1223. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  1224. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  1225. left join t_dict td on pfc.fee_type_cd = td.status_cd and td.table_name='pay_fee_config' and
  1226. td.table_columns='fee_type_cd'
  1227. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  1228. where t.status_cd = '0'
  1229. <if test="roomNum !=null and roomNum != ''">
  1230. and br.room_num= #{roomNum}
  1231. </if>
  1232. <if test="unitId !=null and unitId != ''">
  1233. and bu.unit_id= #{unitId}
  1234. </if>
  1235. <if test="floorId !=null and floorId != ''">
  1236. and f.floor_id = #{floorId}
  1237. </if>
  1238. <if test="objName !=null and objName != ''">
  1239. and t.obj_name= #{objName}
  1240. </if>
  1241. <if test="objNameNum != null and objNameNum != ''">
  1242. and t.obj_name_num= #{objNameNum}
  1243. </if>
  1244. <if test="feeYear !=null and feeYear != ''">
  1245. and t.fee_year= #{feeYear}
  1246. </if>
  1247. <if test="feeMonth !=null and feeMonth != ''">
  1248. and t.fee_month= #{feeMonth}
  1249. </if>
  1250. <if test="feeId !=null and feeId != ''">
  1251. and t.fee_id= #{feeId}
  1252. </if>
  1253. <if test="configId !=null and configId != ''">
  1254. and pfc.config_id= #{configId}
  1255. </if>
  1256. <if test="objId !=null and objId != ''">
  1257. and t.obj_id= #{objId}
  1258. </if>
  1259. <if test="feeName !=null and feeName != ''">
  1260. and t.fee_name= #{feeName}
  1261. </if>
  1262. <if test="feeTypeCd != null and feeTypeCd != ''">
  1263. and pfc.fee_type_cd = #{feeTypeCd}
  1264. </if>
  1265. <if test="communityId !=null and communityId != ''">
  1266. and t.community_id= #{communityId}
  1267. </if>
  1268. <if test="startTime !=null and startTime != ''">
  1269. and pfc.start_time &gt;= #{startTime}
  1270. </if>
  1271. <if test="endTime !=null and endTime != ''">
  1272. and pfc.start_time &lt;= #{endTime}
  1273. </if>
  1274. <if test="yearMonth !=null and yearMonth != ''">
  1275. and concat(t.fee_year,lpad(t.fee_month,2,0)) = #{yearMonth}
  1276. </if>
  1277. order by t.create_time desc
  1278. </select>
  1279. <select id="queryFeeDetailCount" parameterType="Map" resultType="Map">
  1280. select count(1) count
  1281. from (
  1282. select t.obj_name objName,t.fee_name feeName,pfc.start_time
  1283. from report_fee_month_statistics t
  1284. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  1285. left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
  1286. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  1287. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  1288. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  1289. where t.status_cd = '0'
  1290. <if test="roomNum !=null and roomNum != ''">
  1291. and br.room_num= #{roomNum}
  1292. </if>
  1293. <if test="unitId !=null and unitId != ''">
  1294. and bu.unit_id= #{unitId}
  1295. </if>
  1296. <if test="floorId !=null and floorId != ''">
  1297. and f.floor_id = #{floorId}
  1298. </if>
  1299. <if test="objName !=null and objName != ''">
  1300. and t.obj_name= #{objName}
  1301. </if>
  1302. <if test="objNameNum != null and objNameNum != ''">
  1303. and t.obj_name_num= #{objNameNum}
  1304. </if>
  1305. <if test="feeYear !=null and feeYear != ''">
  1306. and t.fee_year= #{feeYear}
  1307. </if>
  1308. <if test="feeMonth !=null and feeMonth != ''">
  1309. and t.fee_month= #{feeMonth}
  1310. </if>
  1311. <if test="feeId !=null and feeId != ''">
  1312. and t.fee_id= #{feeId}
  1313. </if>
  1314. <if test="configId !=null and configId != ''">
  1315. and t.config_id= #{configId}
  1316. </if>
  1317. <if test="objId !=null and objId != ''">
  1318. and t.obj_id= #{objId}
  1319. </if>
  1320. <if test="feeName !=null and feeName != ''">
  1321. and t.fee_name= #{feeName}
  1322. </if>
  1323. <if test="communityId !=null and communityId != ''">
  1324. and t.community_id= #{communityId}
  1325. </if>
  1326. <if test="startTime !=null and startTime != ''">
  1327. and t.fee_create_time &gt;= #{startTime}
  1328. </if>
  1329. <if test="endTime !=null and endTime != ''">
  1330. and t.deadline_time &lt;= #{endTime}
  1331. </if>
  1332. <if test="feeTypeCd !=null and feeTypeCd != ''">
  1333. and pfc.fee_type_cd = #{feeTypeCd}
  1334. </if>
  1335. group by t.config_id,t.fee_name,t.fee_create_time,t.obj_id,t.obj_name,t.deadline_time
  1336. ) t
  1337. </select>
  1338. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  1339. <select id="queryFeeDetail" parameterType="Map" resultType="Map">
  1340. select t.config_id configId,t.obj_id objId,t.obj_name objName,t.obj_type objType,t.fee_name
  1341. feeName,t.fee_create_time feeCreateTime,pfa.`value`
  1342. ownerName,br.built_up_area builtUpArea ,max(t.deadline_time)
  1343. deadlineTime,max(t.create_time) createTime,max(t.update_time) updateTime,SUM(t.his_owe_amount)
  1344. hisOweAmount,SUM(t.cur_receivable_amount) curReceivableAmount,
  1345. SUM(t.cur_received_amount) curReceivedAmount,SUM(t.his_owe_received_amount)
  1346. hisOweReceivedAmount,SUM(t.pre_received_amount) preReceivedAmount,
  1347. sum(t.his_owe_amount+t.cur_receivable_amount) receivableAmount,
  1348. sum(t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount) receivedAmount,
  1349. t.obj_type objType,t.obj_name_num objNameNum
  1350. from report_fee_month_statistics t
  1351. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  1352. left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
  1353. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  1354. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  1355. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  1356. left join pay_fee_attrs pfa on pf.fee_id = pfa.fee_id and pfa.spec_cd = '390008' and pfa.status_cd ='0'
  1357. where t.status_cd = '0'
  1358. <if test="roomNum !=null and roomNum != ''">
  1359. and br.room_num= #{roomNum}
  1360. </if>
  1361. <if test="unitId !=null and unitId != ''">
  1362. and bu.unit_id= #{unitId}
  1363. </if>
  1364. <if test="floorId !=null and floorId != ''">
  1365. and f.floor_id = #{floorId}
  1366. </if>
  1367. <if test="objName !=null and objName != ''">
  1368. and t.obj_name= #{objName}
  1369. </if>
  1370. <if test="objNameNum != null and objNameNum != ''">
  1371. and t.obj_name_num= #{objNameNum}
  1372. </if>
  1373. <if test="feeYear !=null and feeYear != ''">
  1374. and t.fee_year= #{feeYear}
  1375. </if>
  1376. <if test="feeMonth !=null and feeMonth != ''">
  1377. and t.fee_month= #{feeMonth}
  1378. </if>
  1379. <if test="feeId !=null and feeId != ''">
  1380. and t.fee_id= #{feeId}
  1381. </if>
  1382. <if test="configId !=null and configId != ''">
  1383. and t.config_id= #{configId}
  1384. </if>
  1385. <if test="objId !=null and objId != ''">
  1386. and t.obj_id= #{objId}
  1387. </if>
  1388. <if test="feeName !=null and feeName != ''">
  1389. and t.fee_name= #{feeName}
  1390. </if>
  1391. <if test="communityId !=null and communityId != ''">
  1392. and t.community_id= #{communityId}
  1393. </if>
  1394. <if test="startTime !=null and startTime != ''">
  1395. and t.fee_create_time &gt;= #{startTime}
  1396. </if>
  1397. <if test="endTime !=null and endTime != ''">
  1398. and t.deadline_time &lt;= #{endTime}
  1399. </if>
  1400. <if test="feeTypeCd !=null and feeTypeCd != ''">
  1401. and pfc.fee_type_cd = #{feeTypeCd}
  1402. </if>
  1403. group by t.config_id,t.fee_name,t.fee_create_time,t.obj_id,t.obj_type,t.obj_name,pfa.`value`,br.built_up_area
  1404. order by pfa.`value`
  1405. <if test="page != -1 and page != null ">
  1406. limit #{page}, #{row}
  1407. </if>
  1408. </select>
  1409. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  1410. <select id="queryAllFeeDetail" parameterType="Map" resultType="Map">
  1411. select
  1412. SUM(t.his_owe_amount + t.cur_receivable_amount) allReceivableAmount,
  1413. SUM(t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount) allReceivedAmount,
  1414. if(SUM(t.his_owe_amount + t.cur_receivable_amount - t.cur_received_amount - t.his_owe_received_amount) &lt; 0,0,
  1415. SUM(t.his_owe_amount + t.cur_receivable_amount - t.cur_received_amount - t.his_owe_received_amount))
  1416. allOweAmount,
  1417. SUM(t.his_owe_received_amount) allHisOweReceivedAmount
  1418. from report_fee_month_statistics t
  1419. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  1420. left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
  1421. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  1422. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  1423. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  1424. where t.status_cd = '0'
  1425. <if test="roomNum !=null and roomNum != ''">
  1426. and br.room_num= #{roomNum}
  1427. </if>
  1428. <if test="unitId !=null and unitId != ''">
  1429. and bu.unit_id= #{unitId}
  1430. </if>
  1431. <if test="floorId !=null and floorId != ''">
  1432. and f.floor_id = #{floorId}
  1433. </if>
  1434. <if test="objName !=null and objName != ''">
  1435. and t.obj_name= #{objName}
  1436. </if>
  1437. <if test="objNameNum != null and objNameNum != ''">
  1438. and t.obj_name_num= #{objNameNum}
  1439. </if>
  1440. <if test="feeYear !=null and feeYear != ''">
  1441. and t.fee_year= #{feeYear}
  1442. </if>
  1443. <if test="feeMonth !=null and feeMonth != ''">
  1444. and t.fee_month= #{feeMonth}
  1445. </if>
  1446. <if test="feeId !=null and feeId != ''">
  1447. and t.fee_id= #{feeId}
  1448. </if>
  1449. <if test="configId !=null and configId != ''">
  1450. and t.config_id= #{configId}
  1451. </if>
  1452. <if test="objId !=null and objId != ''">
  1453. and t.obj_id= #{objId}
  1454. </if>
  1455. <if test="feeName !=null and feeName != ''">
  1456. and t.fee_name= #{feeName}
  1457. </if>
  1458. <if test="communityId !=null and communityId != ''">
  1459. and t.community_id= #{communityId}
  1460. </if>
  1461. <if test="startTime !=null and startTime != ''">
  1462. and t.fee_create_time &gt;= #{startTime}
  1463. </if>
  1464. <if test="endTime !=null and endTime != ''">
  1465. and t.deadline_time &lt;= #{endTime}
  1466. </if>
  1467. </select>
  1468. <select id="queryOweFeeDetailCount" parameterType="Map" resultType="Map">
  1469. select count(1) count
  1470. from (
  1471. select t.payer_obj_name objName,t.fee_name feeName,pf.end_time feeCreateTime,t.create_time
  1472. createTime,SUM(t.amount_owed) oweAmount,max(t.deadline_time) deadlineTime
  1473. from report_owe_fee t
  1474. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  1475. left join building_room br on t.payer_obj_id = br.room_id and t.payer_obj_type = '3333' and br.status_cd = '0'
  1476. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  1477. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  1478. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  1479. where 1=1
  1480. <if test="roomNum !=null and roomNum != ''">
  1481. and br.room_num= #{roomNum}
  1482. </if>
  1483. <if test="unitId !=null and unitId != ''">
  1484. and bu.unit_id= #{unitId}
  1485. </if>
  1486. <if test="floorId !=null and floorId != ''">
  1487. and f.floor_id = #{floorId}
  1488. </if>
  1489. <if test="objName !=null and objName != ''">
  1490. and t.payer_obj_name= #{objName}
  1491. </if>
  1492. <if test="feeId !=null and feeId != ''">
  1493. and t.fee_id= #{feeId}
  1494. </if>
  1495. <if test="configId !=null and configId != ''">
  1496. and t.config_id= #{configId}
  1497. </if>
  1498. <if test="objId !=null and objId != ''">
  1499. and t.payer_obj_id= #{objId}
  1500. </if>
  1501. <if test="feeName !=null and feeName != ''">
  1502. and t.fee_name= #{feeName}
  1503. </if>
  1504. <if test="communityId !=null and communityId != ''">
  1505. and t.community_id= #{communityId}
  1506. </if>
  1507. <if test="startTime !=null and startTime != ''">
  1508. and t.create_time &gt;= #{startTime}
  1509. </if>
  1510. <if test="endTime !=null and endTime != ''">
  1511. and t.create_time &lt;= #{endTime}
  1512. </if>
  1513. and t.amount_owed > 0 and pf.end_time &lt; now()
  1514. group by t.payer_obj_name ,t.fee_name ,pf.end_time ,t.create_time
  1515. HAVING oweAmount > 0
  1516. ) t
  1517. </select>
  1518. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  1519. <select id="queryOweFeeDetail" parameterType="Map" resultType="Map">
  1520. select t.payer_obj_name objName,t.fee_name feeName,pf.end_time feeCreateTime,t.update_time updateTime,
  1521. pfa.`value` ownerName,br.built_up_area builtUpArea ,SUM(t.amount_owed) oweAmount,max(t.deadline_time)
  1522. deadlineTime
  1523. from report_owe_fee t
  1524. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  1525. left join building_room br on t.payer_obj_id = br.room_id and t.payer_obj_type = '3333' and br.status_cd = '0'
  1526. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  1527. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  1528. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  1529. left join pay_fee_attrs pfa on pf.fee_id = pfa.fee_id and pfa.spec_cd = '390008' and pfa.status_cd ='0'
  1530. where 1=1
  1531. <if test="roomNum !=null and roomNum != ''">
  1532. and br.room_num= #{roomNum}
  1533. </if>
  1534. <if test="unitId !=null and unitId != ''">
  1535. and bu.unit_id= #{unitId}
  1536. </if>
  1537. <if test="unitNum !=null and unitNum != ''">
  1538. and bu.unit_num= #{unitNum}
  1539. </if>
  1540. <if test="floorId !=null and floorId != ''">
  1541. and f.floor_id = #{floorId}
  1542. </if>
  1543. <if test="floorNum !=null and floorNum != ''">
  1544. and f.floor_num = #{floorNum}
  1545. </if>
  1546. <if test="objName !=null and objName != ''">
  1547. and t.payer_obj_name= #{objName}
  1548. </if>
  1549. <if test="feeId !=null and feeId != ''">
  1550. and t.fee_id= #{feeId}
  1551. </if>
  1552. <if test="configId !=null and configId != ''">
  1553. and t.config_id= #{configId}
  1554. </if>
  1555. <if test="objId !=null and objId != ''">
  1556. and t.payer_obj_id= #{objId}
  1557. </if>
  1558. <if test="feeName !=null and feeName != ''">
  1559. and t.fee_name= #{feeName}
  1560. </if>
  1561. <if test="communityId !=null and communityId != ''">
  1562. and t.community_id= #{communityId}
  1563. </if>
  1564. <if test="startTime !=null and startTime != ''">
  1565. and t.create_time &gt;= #{startTime}
  1566. </if>
  1567. <if test="endTime !=null and endTime != ''">
  1568. and t.create_time &lt;= #{endTime}
  1569. </if>
  1570. and t.amount_owed > 0 and pf.end_time &lt; now()
  1571. group by t.payer_obj_name ,t.fee_name ,pf.end_time ,t.update_time,pfa.`value` ,br.built_up_area
  1572. HAVING oweAmount > 0
  1573. order by t.payer_obj_name
  1574. <if test="page != -1 and page != null ">
  1575. limit #{page}, #{row}
  1576. </if>
  1577. </select>
  1578. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  1579. <select id="queryOweFeeDetailMajor" parameterType="Map" resultType="Map">
  1580. select SUM(t.amount_owed) oweAmount
  1581. from report_owe_fee t
  1582. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  1583. left join building_room br on t.payer_obj_id = br.room_id and t.payer_obj_type = '3333' and br.status_cd = '0'
  1584. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  1585. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  1586. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  1587. where 1=1
  1588. <if test="roomNum !=null and roomNum != ''">
  1589. and br.room_num= #{roomNum}
  1590. </if>
  1591. <if test="unitId !=null and unitId != ''">
  1592. and bu.unit_id= #{unitId}
  1593. </if>
  1594. <if test="floorId !=null and floorId != ''">
  1595. and f.floor_id = #{floorId}
  1596. </if>
  1597. <if test="objName !=null and objName != ''">
  1598. and t.payer_obj_name= #{objName}
  1599. </if>
  1600. <if test="feeId !=null and feeId != ''">
  1601. and t.fee_id= #{feeId}
  1602. </if>
  1603. <if test="configId !=null and configId != ''">
  1604. and t.config_id= #{configId}
  1605. </if>
  1606. <if test="objId !=null and objId != ''">
  1607. and t.payer_obj_id= #{objId}
  1608. </if>
  1609. <if test="feeName !=null and feeName != ''">
  1610. and t.fee_name= #{feeName}
  1611. </if>
  1612. <if test="communityId !=null and communityId != ''">
  1613. and t.community_id= #{communityId}
  1614. </if>
  1615. <if test="startTime !=null and startTime != ''">
  1616. and t.create_time &gt;= #{startTime}
  1617. </if>
  1618. <if test="endTime !=null and endTime != ''">
  1619. and t.create_time &lt;= #{endTime}
  1620. </if>
  1621. </select>
  1622. <select id="queryPayFeeDetailCount" parameterType="Map" resultType="Map">
  1623. select count(1) count,SUM(receivedAmount) totalReceivedAmount,SUM(receivableAmount) totalReceivableAmount
  1624. from (
  1625. select pfc.fee_name feeName,f.floor_num floorNum,bu.unit_num unitNum,br.room_num roomNum,oc.car_num carNum,
  1626. pf.payer_obj_type payerObjType,t.start_time startTime,t.end_time endTime,t.create_time createTime,
  1627. t.receivable_amount receivableAmount,t.received_amount receivedAmount,d.name,d2.name feeTypeCdName,
  1628. pfc.fee_type_cd feeTypeCd,t.state,d3.name stateName
  1629. from pay_fee_detail t
  1630. left JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
  1631. left join pay_fee_config pfc on pf.config_id = pfc.config_id and pfc.status_cd = '0'
  1632. left join building_room br on pf.payer_obj_id = br.room_id and pf.payer_obj_type = '3333' and br.status_cd = '0'
  1633. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  1634. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  1635. left join owner_car oc on pf.payer_obj_id = oc.car_id and oc.car_type_cd='1001'
  1636. left join pay_fee_attrs pfa on t.fee_id = pfa.fee_id and pfa.spec_cd = '390002'
  1637. left join t_dict d on t.prime_rate = d.status_cd and d.table_name="pay_fee_detail" and
  1638. d.table_columns="prime_rate"
  1639. left join t_dict d2 on pfc.fee_type_cd = d2.status_cd and d2.table_name = "pay_fee_config" and d2.table_columns
  1640. = "fee_type_cd"
  1641. left join t_dict d3 on t.state = d3.status_cd and d3.table_name = "pay_fee_detail" and d3.table_columns =
  1642. "state"
  1643. where t.status_cd = '0' and pf.status_cd = '0'
  1644. and t.state != '1500'
  1645. <if test="roomNum !=null and roomNum != ''">
  1646. and br.room_num= #{roomNum}
  1647. </if>
  1648. <if test="unitId !=null and unitId != ''">
  1649. and bu.unit_id= #{unitId}
  1650. </if>
  1651. <if test="unitNum !=null and unitNum != ''">
  1652. and bu.unit_num= #{unitNum}
  1653. </if>
  1654. <if test="floorId !=null and floorId != ''">
  1655. and f.floor_id = #{floorId}
  1656. </if>
  1657. <if test="floorNum !=null and floorNum != ''">
  1658. and f.floor_num = #{floorNum}
  1659. </if>
  1660. <if test="objName !=null and objName != ''">
  1661. and t.obj_name= #{objName}
  1662. </if>
  1663. <if test="feeYear !=null and feeYear != ''">
  1664. and t.fee_year= #{feeYear}
  1665. </if>
  1666. <if test="feeMonth !=null and feeMonth != ''">
  1667. and t.fee_month= #{feeMonth}
  1668. </if>
  1669. <if test="feeId !=null and feeId != ''">
  1670. and t.fee_id= #{feeId}
  1671. </if>
  1672. <if test="configId !=null and configId != ''">
  1673. and pfc.config_id= #{configId}
  1674. </if>
  1675. <if test="objId !=null and objId != ''">
  1676. and pf.payer_obj_id= #{objId}
  1677. </if>
  1678. <if test="feeName !=null and feeName != ''">
  1679. and t.fee_name= #{feeName}
  1680. </if>
  1681. <if test="communityId !=null and communityId != ''">
  1682. and t.community_id= #{communityId}
  1683. </if>
  1684. <if test="primeRate != null and primeRate != ''">
  1685. and t.prime_rate = #{primeRate}
  1686. </if>
  1687. <if test="state != null and state != ''">
  1688. and t.state = #{state}
  1689. </if>
  1690. <if test="feeTypeCd != null and feeTypeCd != ''">
  1691. and pfc.fee_type_cd = #{feeTypeCd}
  1692. </if>
  1693. <if test="startTime !=null and startTime != ''">
  1694. and t.create_time &gt;= #{startTime}
  1695. </if>
  1696. <if test="endTime !=null and endTime != ''">
  1697. and t.create_time &lt;= #{endTime}
  1698. </if>
  1699. <if test="feeStartTime !=null and feeStartTime != ''">
  1700. and t.start_time &gt;= #{feeStartTime}
  1701. </if>
  1702. <if test="feeEndTime !=null and feeEndTime != ''">
  1703. and t.end_time &lt;= #{feeEndTime}
  1704. </if>
  1705. <if test="cashierId !=null and cashierId != ''">
  1706. and t.cashier_id= #{cashierId}
  1707. </if>
  1708. <if test="cashierName !=null and cashierName != ''">
  1709. and t.cashier_name= #{cashierName}
  1710. </if>
  1711. ) t
  1712. </select>
  1713. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  1714. <select id="queryPayFeeDetail" parameterType="Map" resultType="Map">
  1715. select pfc.fee_name feeName,f.floor_num floorNum,bu.unit_num unitNum,br.room_num roomNum,br.built_up_area
  1716. builtUpArea ,oc.car_num carNum,
  1717. pf.payer_obj_type payerObjType,t.start_time startTime,t.end_time endTime,t.create_time createTime,
  1718. t.receivable_amount receivableAmount,t.received_amount receivedAmount,pfa.`value`
  1719. importFeeName,t.prime_rate,d.name primeRate,fdr.discount_small_type discountSmallType,fdr.rule_name
  1720. ruleName,pfdd.discount_price discountPrice,co.contract_code contractCode,pfo.`value` ownerName,cb.o_id oId,
  1721. d2.name feeTypeCdName,pfc.fee_type_cd feeTypeCd,t.state,d3.name stateName,t.fee_id feeId,pft.`value` repairId,
  1722. t.detail_id,t.detail_id detailId,pf.payer_obj_id,pfb.value ownerId,concat(pa.num,'停车场',ps.num,'车位') psName,
  1723. fad.amount withholdAmount,t.cashier_id cashierId,t.cashier_name cashierName,t.payable_amount payableAmount,pfc.fee_flag feeFlag
  1724. from pay_fee_detail t
  1725. left JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
  1726. left join pay_fee_config pfc on pf.config_id = pfc.config_id and pfc.status_cd = '0'
  1727. left join building_room br on pf.payer_obj_id = br.room_id and pf.payer_obj_type = '3333' and br.status_cd = '0'
  1728. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  1729. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  1730. left join owner_car oc on pf.payer_obj_id = oc.car_id and oc.car_type_cd='1001'
  1731. LEFT JOIN parking_space ps on oc.ps_id = ps.ps_id and ps.status_cd = '0'
  1732. left join parking_area pa on ps.pa_id = pa.pa_id and pa.status_cd = '0'
  1733. left join pay_fee_attrs pfa on t.fee_id = pfa.fee_id and pfa.spec_cd = '390002'
  1734. left join pay_fee_attrs pfb on t.fee_id = pfb.fee_id and pfb.spec_cd = '390007'
  1735. left join pay_fee_attrs pfo on t.fee_id = pfo.fee_id and pfo.spec_cd = '390008'
  1736. left join pay_fee_attrs pft on t.fee_id = pft.fee_id and pft.spec_cd = '390001'
  1737. left join pay_fee_detail_discount pfdd on t.detail_id = pfdd.detail_id and pfdd.status_cd = '0'
  1738. left join fee_discount fd on pfdd.discount_id = fd.discount_id and fd.status_cd = '0'
  1739. left join fee_discount_rule fdr on fd.rule_id = fdr.rule_id and fdr.status_cd = '0'
  1740. left join t_dict d on t.prime_rate = d.status_cd and d.table_name="pay_fee_detail" and
  1741. d.table_columns="prime_rate"
  1742. left join t_dict d2 on pfc.fee_type_cd = d2.status_cd and d2.table_name = "pay_fee_config" and d2.table_columns
  1743. = "fee_type_cd"
  1744. left join t_dict d3 on t.state = d3.status_cd and d3.table_name = "pay_fee_detail" and d3.table_columns =
  1745. "state"
  1746. LEFT JOIN contract co on pf.payer_obj_id = co.contract_id and co.status_cd = '0' and pf.payer_obj_type='7777'
  1747. LEFT JOIN c_business cb on t.b_id = cb.b_id
  1748. left join fee_account_detail fad on t.detail_id = fad.detail_id and t.community_id = fad.community_id and
  1749. fad.status_cd = '0' and fad.state = '1002'
  1750. where t.status_cd = '0'
  1751. and pf.status_cd = '0'
  1752. and t.state != '1500'
  1753. <if test="roomNum !=null and roomNum != ''">
  1754. and br.room_num= #{roomNum}
  1755. </if>
  1756. <if test="unitId !=null and unitId != ''">
  1757. and bu.unit_id= #{unitId}
  1758. </if>
  1759. <if test="unitNum !=null and unitNum != ''">
  1760. and bu.unit_num= #{unitNum}
  1761. </if>
  1762. <if test="floorId !=null and floorId != ''">
  1763. and f.floor_id = #{floorId}
  1764. </if>
  1765. <if test="floorNum !=null and floorNum != ''">
  1766. and f.floor_num = #{floorNum}
  1767. </if>
  1768. <if test="objName !=null and objName != ''">
  1769. and t.obj_name= #{objName}
  1770. </if>
  1771. <if test="feeYear !=null and feeYear != ''">
  1772. and t.fee_year= #{feeYear}
  1773. </if>
  1774. <if test="feeMonth !=null and feeMonth != ''">
  1775. and t.fee_month= #{feeMonth}
  1776. </if>
  1777. <if test="feeId !=null and feeId != ''">
  1778. and t.fee_id= #{feeId}
  1779. </if>
  1780. <if test="configId !=null and configId != ''">
  1781. and pfc.config_id= #{configId}
  1782. </if>
  1783. <if test="objId !=null and objId != ''">
  1784. and pf.payer_obj_id = #{objId}
  1785. </if>
  1786. <if test="feeName !=null and feeName != ''">
  1787. and t.fee_name= #{feeName}
  1788. </if>
  1789. <if test="communityId !=null and communityId != ''">
  1790. and t.community_id= #{communityId}
  1791. </if>
  1792. <if test="primeRate != null and primeRate != ''">
  1793. and t.prime_rate = #{primeRate}
  1794. </if>
  1795. <if test="state != null and state != ''">
  1796. and t.state = #{state}
  1797. </if>
  1798. <if test="feeTypeCd != null and feeTypeCd != ''">
  1799. and pfc.fee_type_cd = #{feeTypeCd}
  1800. </if>
  1801. <if test="startTime !=null and startTime != ''">
  1802. and t.create_time &gt;= #{startTime}
  1803. </if>
  1804. <if test="endTime !=null and endTime != ''">
  1805. and t.create_time &lt;= #{endTime}
  1806. </if>
  1807. <if test="feeStartTime !=null and feeStartTime != ''">
  1808. and t.start_time &gt;= #{feeStartTime}
  1809. </if>
  1810. <if test="feeEndTime !=null and feeEndTime != ''">
  1811. and t.end_time &lt;= #{feeEndTime}
  1812. </if>
  1813. <if test="cashierId !=null and cashierId != ''">
  1814. and t.cashier_id= #{cashierId}
  1815. </if>
  1816. <if test="cashierName !=null and cashierName != ''">
  1817. and t.cashier_name= #{cashierName}
  1818. </if>
  1819. order by t.create_time desc
  1820. <if test="page != -1 and page != null ">
  1821. limit #{page}, #{row}
  1822. </if>
  1823. </select>
  1824. <select id="queryAllPayFeeDetail" parameterType="Map" resultType="Map">
  1825. select SUM(t.receivable_amount) allReceivableAmount,SUM(t.received_amount) allReceivedAmount
  1826. from pay_fee_detail t
  1827. left JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
  1828. left join pay_fee_config pfc on pf.config_id = pfc.config_id and pfc.status_cd = '0'
  1829. left join building_room br on pf.payer_obj_id = br.room_id and pf.payer_obj_type = '3333' and br.status_cd = '0'
  1830. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  1831. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  1832. left join owner_car oc on pf.payer_obj_id = oc.car_id and oc.status_cd = '0' and oc.car_type_cd='1001'
  1833. left join pay_fee_attrs pfa on t.fee_id = pfa.fee_id and pfa.spec_cd = '390002'
  1834. where t.status_cd = '0'
  1835. <if test="roomNum !=null and roomNum != ''">
  1836. and br.room_num= #{roomNum}
  1837. </if>
  1838. <if test="unitId !=null and unitId != ''">
  1839. and bu.unit_id= #{unitId}
  1840. </if>
  1841. <if test="unitNum !=null and unitNum != ''">
  1842. and bu.unit_num= #{unitNum}
  1843. </if>
  1844. <if test="floorId !=null and floorId != ''">
  1845. and f.floor_id = #{floorId}
  1846. </if>
  1847. <if test="floorNum !=null and floorNum != ''">
  1848. and f.floor_num = #{floorNum}
  1849. </if>
  1850. <if test="objName !=null and objName != ''">
  1851. and t.obj_name= #{objName}
  1852. </if>
  1853. <if test="feeYear !=null and feeYear != ''">
  1854. and t.fee_year= #{feeYear}
  1855. </if>
  1856. <if test="feeMonth !=null and feeMonth != ''">
  1857. and t.fee_month= #{feeMonth}
  1858. </if>
  1859. <if test="feeId !=null and feeId != ''">
  1860. and t.fee_id= #{feeId}
  1861. </if>
  1862. <if test="configId !=null and configId != ''">
  1863. and pfc.config_id= #{configId}
  1864. </if>
  1865. <if test="objId !=null and objId != ''">
  1866. and pf.payer_obj_id= #{objId}
  1867. </if>
  1868. <if test="feeName !=null and feeName != ''">
  1869. and t.fee_name= #{feeName}
  1870. </if>
  1871. <if test="communityId !=null and communityId != ''">
  1872. and t.community_id= #{communityId}
  1873. </if>
  1874. <if test="primeRate != null and primeRate != ''">
  1875. and t.prime_rate = #{primeRate}
  1876. </if>
  1877. <if test="startTime !=null and startTime != ''">
  1878. and t.create_time &gt;= #{startTime}
  1879. </if>
  1880. <if test="endTime !=null and endTime != ''">
  1881. and t.create_time &lt;= #{endTime}
  1882. </if>
  1883. </select>
  1884. <select id="queryPayFeeDetailSum" parameterType="Map" resultType="Map">
  1885. select pfc.fee_name feeName,f.floor_num floorNum,bu.unit_num unitNum,br.room_num roomNum,oc.car_num carNum,
  1886. pf.payer_obj_type payerObjType,t.start_time startTime,t.end_time endTime,t.create_time createTime,
  1887. t.receivable_amount receivableAmount,t.received_amount receivedAmount,pfa.`value`
  1888. importFeeName,t.prime_rate,d.name primeRate,fdr.discount_small_type discountSmallType,fdr.rule_name
  1889. ruleName,pfdd.discount_price,
  1890. SUM(pfdd.discount_price) discountPrice
  1891. from pay_fee_detail t
  1892. left JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
  1893. left join pay_fee_config pfc on pf.config_id = pfc.config_id and pfc.status_cd = '0'
  1894. left join building_room br on pf.payer_obj_id = br.room_id and pf.payer_obj_type = '3333' and br.status_cd = '0'
  1895. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  1896. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  1897. left join owner_car oc on pf.payer_obj_id = oc.car_id and oc.status_cd = '0' and oc.car_type_cd='1001'
  1898. left join pay_fee_attrs pfa on t.fee_id = pfa.fee_id and pfa.spec_cd = '390002'
  1899. left join pay_fee_detail_discount pfdd on t.detail_id = pfdd.detail_id and pfdd.status_cd = '0'
  1900. left join fee_discount fd on pfdd.discount_id = fd.discount_id and fd.status_cd = '0'
  1901. left join fee_discount_rule fdr on fd.rule_id = fdr.rule_id and fdr.status_cd = '0'
  1902. left join t_dict d on t.prime_rate = d.status_cd and d.table_name="pay_fee_detail" and
  1903. d.table_columns="prime_rate"
  1904. where t.status_cd = '0'
  1905. <if test="roomNum !=null and roomNum != ''">
  1906. and br.room_num= #{roomNum}
  1907. </if>
  1908. <if test="unitId !=null and unitId != ''">
  1909. and bu.unit_id= #{unitId}
  1910. </if>
  1911. <if test="unitNum !=null and unitNum != ''">
  1912. and bu.unit_num= #{unitNum}
  1913. </if>
  1914. <if test="floorId !=null and floorId != ''">
  1915. and f.floor_id = #{floorId}
  1916. </if>
  1917. <if test="floorNum !=null and floorNum != ''">
  1918. and f.floor_num = #{floorNum}
  1919. </if>
  1920. <if test="objName !=null and objName != ''">
  1921. and t.obj_name= #{objName}
  1922. </if>
  1923. <if test="feeYear !=null and feeYear != ''">
  1924. and t.fee_year= #{feeYear}
  1925. </if>
  1926. <if test="feeMonth !=null and feeMonth != ''">
  1927. and t.fee_month= #{feeMonth}
  1928. </if>
  1929. <if test="feeId !=null and feeId != ''">
  1930. and t.fee_id= #{feeId}
  1931. </if>
  1932. <if test="configId !=null and configId != ''">
  1933. and pfc.config_id= #{configId}
  1934. </if>
  1935. <if test="objId !=null and objId != ''">
  1936. and pf.payer_obj_id= #{objId}
  1937. </if>
  1938. <if test="feeName !=null and feeName != ''">
  1939. and t.fee_name= #{feeName}
  1940. </if>
  1941. <if test="communityId !=null and communityId != ''">
  1942. and t.community_id= #{communityId}
  1943. </if>
  1944. <if test="primeRate != null and primeRate != ''">
  1945. and t.prime_rate = #{primeRate}
  1946. </if>
  1947. <if test="startTime !=null and startTime != ''">
  1948. and t.create_time &gt;= #{startTime}
  1949. </if>
  1950. <if test="endTime !=null and endTime != ''">
  1951. and t.create_time &lt;= #{endTime}
  1952. </if>
  1953. group by pfc.fee_name,f.floor_num,bu.unit_num ,br.room_num ,oc.car_num ,
  1954. pf.payer_obj_type ,t.start_time ,t.end_time ,t.create_time ,
  1955. t.receivable_amount ,t.received_amount ,pfa.`value`
  1956. ,t.prime_rate,d.name ,fdr.discount_small_type ,fdr.rule_name,pfdd.discount_price
  1957. order by t.create_time desc
  1958. </select>
  1959. <select id="queryDeadlineFeeCount" parameterType="Map" resultType="Map">
  1960. select count(1) count
  1961. from pay_fee_detail_month t
  1962. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
  1963. where 1=1
  1964. and t.detail_id = '-1'
  1965. <if test="configId !=null and configId != ''">
  1966. and t.config_id = #{configId}
  1967. </if>
  1968. <if test="objName !=null and objName != ''">
  1969. and t.obj_name like CONCAT('%',#{objName},'%')
  1970. </if>
  1971. <if test="ownerName !=null and ownerName != ''">
  1972. and t.owner_name like CONCAT('%',#{ownerName},'%')
  1973. </if>
  1974. <if test="link !=null and link != ''">
  1975. and t.link = #{link}
  1976. </if>
  1977. <if test="communityId !=null and communityId != ''">
  1978. and t.community_id= #{communityId}
  1979. </if>
  1980. <if test="startTime !=null and startTime !=''">
  1981. and t.deadline_time &gt;= #{startTime}
  1982. </if>
  1983. <if test="endTime !=null and endTime != ''">
  1984. and t.deadline_time &lt;= #{endTime}
  1985. </if>
  1986. </select>
  1987. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  1988. <select id="queryDeadlineFee" parameterType="Map" resultType="Map">
  1989. select
  1990. t.obj_name objName,
  1991. pf.payer_obj_type objType,
  1992. t.fee_name feeName,
  1993. t.deadline_time deadlineTime
  1994. from pay_fee_detail_month t
  1995. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
  1996. where 1=1
  1997. and t.detail_id = '-1'
  1998. <if test="configId !=null and configId != ''">
  1999. and t.config_id = #{configId}
  2000. </if>
  2001. <if test="objName !=null and objName != ''">
  2002. and t.obj_name like CONCAT('%',#{objName},'%')
  2003. </if>
  2004. <if test="ownerName !=null and ownerName != ''">
  2005. and t.owner_name like CONCAT('%',#{ownerName},'%')
  2006. </if>
  2007. <if test="link !=null and link != ''">
  2008. and t.link = #{link}
  2009. </if>
  2010. <if test="communityId !=null and communityId != ''">
  2011. and t.community_id= #{communityId}
  2012. </if>
  2013. <if test="startTime !=null and startTime !=''">
  2014. and t.deadline_time &gt;= #{startTime}
  2015. </if>
  2016. <if test="endTime !=null and endTime != ''">
  2017. and t.deadline_time &lt;= #{endTime}
  2018. </if>
  2019. order by t.deadline_time
  2020. <if test="page != -1 and page != null ">
  2021. limit #{page}, #{row}
  2022. </if>
  2023. </select>
  2024. <select id="queryPrePaymentNewCount" parameterType="Map" resultType="Map">
  2025. select count(1) count
  2026. from (
  2027. select pfc.fee_name feeName,pfa.`value` objName,pfa1.`value` link,pfa2.`value` ownerName, t.end_time endTime ,
  2028. t.payer_obj_type payerObjType
  2029. from pay_fee t
  2030. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  2031. LEFT JOIN pay_fee_attrs pfa on t.fee_id = pfa.fee_id and pfa.spec_cd = '390012' and pfa.status_cd = '0'
  2032. LEFT JOIN pay_fee_attrs pfa1 on t.fee_id = pfa1.fee_id and pfa1.spec_cd = '390009' and pfa1.status_cd = '0'
  2033. LEFT JOIN pay_fee_attrs pfa2 on t.fee_id = pfa2.fee_id and pfa2.spec_cd = '390008' and pfa2.status_cd = '0'
  2034. where t.state = '2008001'
  2035. and t.status_cd = '0'
  2036. <if test="ownerName != null and ownerName != ''">
  2037. and pfa2.value like concat('%' #{ownerName} ,'%')
  2038. </if>
  2039. <if test="objName != null and objName != ''">
  2040. and pfa.`value` like concat('%',#{objName},'%')
  2041. </if>
  2042. <if test="link != null and link != ''">
  2043. and pfa1.`value` = #{link}
  2044. </if>
  2045. <if test="configId !=null and configId != ''">
  2046. and t.config_id = #{configId}
  2047. </if>
  2048. <if test="communityId !=null and communityId != ''">
  2049. and t.community_id= #{communityId}
  2050. </if>
  2051. <if test="startTime !=null and startTime != ''">
  2052. and t.end_time &gt;= #{startTime}
  2053. </if>
  2054. <if test="endTime !=null and endTime != ''">
  2055. and t.end_time &lt;= #{endTime}
  2056. </if>
  2057. ) t
  2058. </select>
  2059. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  2060. <select id="queryPrePayment" parameterType="Map" resultType="Map">
  2061. select pfc.fee_name feeName,pfa.`value` objName,pfa1.`value` link,pfa2.`value` ownerName, t.end_time endTime ,
  2062. t.payer_obj_type payerObjType
  2063. from pay_fee t
  2064. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  2065. LEFT JOIN pay_fee_attrs pfa on t.fee_id = pfa.fee_id and pfa.spec_cd = '390012' and pfa.status_cd = '0'
  2066. LEFT JOIN pay_fee_attrs pfa1 on t.fee_id = pfa1.fee_id and pfa1.spec_cd = '390009' and pfa1.status_cd = '0'
  2067. LEFT JOIN pay_fee_attrs pfa2 on t.fee_id = pfa2.fee_id and pfa2.spec_cd = '390008' and pfa2.status_cd = '0'
  2068. where t.state = '2008001'
  2069. and t.status_cd = '0'
  2070. <if test="ownerName != null and ownerName != ''">
  2071. and pfa2.value like concat('%' #{ownerName} ,'%')
  2072. </if>
  2073. <if test="objName != null and objName != ''">
  2074. and pfa.`value` like concat('%',#{objName},'%')
  2075. </if>
  2076. <if test="link != null and link != ''">
  2077. and pfa1.`value` = #{link}
  2078. </if>
  2079. <if test="configId !=null and configId != ''">
  2080. and t.config_id = #{configId}
  2081. </if>
  2082. <if test="communityId !=null and communityId != ''">
  2083. and t.community_id= #{communityId}
  2084. </if>
  2085. <if test="startTime !=null and startTime != ''">
  2086. and t.end_time &gt;= #{startTime}
  2087. </if>
  2088. <if test="endTime !=null and endTime != ''">
  2089. and t.end_time &lt;= #{endTime}
  2090. </if>
  2091. <if test="page != -1 and page != null ">
  2092. limit #{page}, #{row}
  2093. </if>
  2094. </select>
  2095. <select id="queryPrePaymentCount" parameterType="Map" resultType="Map">
  2096. select pfc.fee_name feeName, count(t.payer_obj_id) objCount
  2097. from pay_fee t
  2098. inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  2099. where t.state = '2008001'
  2100. and t.status_cd = '0'
  2101. and t.end_time &gt; #{startTime}
  2102. and t.end_time &lt; #{endTime}
  2103. and t.community_id = #{communityId}
  2104. group by pfc.fee_name, pfc.config_id
  2105. order by objCount
  2106. </select>
  2107. <select id="queryDeadlinePaymentCount" parameterType="Map" resultType="Map">
  2108. SELECT t.fee_name feeName, count(t.obj_id) objCount
  2109. FROM report_fee_month_statistics t
  2110. inner join pay_fee pf on t.fee_id = pf.fee_id
  2111. and pf.community_id = t.community_id and pf.status_cd = '0'
  2112. WHERE 1 = 1
  2113. AND t.status_cd = '0'
  2114. and t.community_id = #{communityId}
  2115. AND t.deadline_time &gt; #{startTime}
  2116. AND t.deadline_time &lt; #{endTime}
  2117. group by t.config_id, t.fee_name
  2118. order by objCount desc
  2119. </select>
  2120. <select id="queryOwePaymentCount" parameterType="Map" resultType="Map">
  2121. select t.fee_name feeName, count(distinct t.obj_id) objCount
  2122. from report_fee_month_statistics t
  2123. inner join pay_fee pf
  2124. on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  2125. where t.community_id = #{communityId}
  2126. and t.owe_amount > 0
  2127. group by t.config_id, t.fee_name
  2128. order by objCount desc
  2129. </select>
  2130. <select id="queryAllPaymentCount" parameterType="Map" resultType="Map">
  2131. select t.fee_name feeName, count(distinct t.obj_id) objCount
  2132. from report_fee_month_statistics t
  2133. inner join pay_fee pf
  2134. on t.fee_id = pf.fee_id and pf.community_id = t.community_id and pf.status_cd = '0'
  2135. where t.community_id = #{communityId}
  2136. group by t.config_id, t.fee_name
  2137. order by objCount desc
  2138. </select>
  2139. <select id="queryFinishOweFee" parameterType="Map" resultType="Map">
  2140. select t.config_id configId,
  2141. t.fee_id feeId,
  2142. t.statistics_id statisticsId,
  2143. t.fee_year feeYear,
  2144. fee_month feeMonth
  2145. from report_fee_month_statistics t
  2146. inner join pay_fee pf
  2147. on t.fee_id = pf.fee_id and pf.state = '2009001' and pf.community_id = #{communityId} and
  2148. pf.status_cd = '0'
  2149. where t.owe_amount > 0
  2150. and t.status_cd = '0'
  2151. and t.community_id = #{communityId} limit 100
  2152. </select>
  2153. <!-- 查询费用配置信息 add by wuxw 2018-07-03 -->
  2154. <select id="getFeeConfigInfo" parameterType="Map" resultType="Map">
  2155. select t.fee_type_cd,t.fee_type_cd feeTypeCd,t.computing_formula,t.computing_formula
  2156. computingFormula,t.additional_amount,t.additional_amount additionalAmount,t.status_cd,t.status_cd
  2157. statusCd,t.square_price,t.square_price squarePrice,t.is_default,t.is_default isDefault,t.config_id,t.config_id
  2158. configId,t.fee_flag,t.fee_flag feeFlag,t.fee_name,t.fee_name feeName,t.start_time,t.start_time
  2159. startTime,t.end_time,t.end_time endTime,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,
  2160. td1.name feeTypeCdName,td2.name feeFlagName,t.bill_type billType,t.bill_type,td3.name billTypeName,
  2161. t.payment_cd,t.payment_cycle,t.payment_cd paymentCd,t.payment_cycle paymentCycle
  2162. from pay_fee_config t,t_dict td1,t_dict td2,t_dict td3
  2163. where 1 =1
  2164. and t.fee_type_cd = td1.status_cd
  2165. and td1.table_name = 'pay_fee_config'
  2166. and td1.table_columns = 'fee_type_cd'
  2167. and t.fee_flag = td2.status_cd
  2168. and td2.table_name = 'pay_fee_config'
  2169. and td2.table_columns = 'fee_flag'
  2170. and t.bill_type = td3.status_cd
  2171. and td3.table_name = 'pay_fee_config'
  2172. and td3.table_columns = 'bill_type'
  2173. and t.is_default = 'F'
  2174. and t.status_cd = '0'
  2175. <if test="feeTypeCd !=null and feeTypeCd != ''">
  2176. and t.fee_type_cd= #{feeTypeCd}
  2177. </if>
  2178. <if test="computingFormula !=null and computingFormula != ''">
  2179. and t.computing_formula= #{computingFormula}
  2180. </if>
  2181. <if test="additionalAmount !=null and additionalAmount != ''">
  2182. and t.additional_amount= #{additionalAmount}
  2183. </if>
  2184. <if test="squarePrice !=null and squarePrice != ''">
  2185. and t.square_price= #{squarePrice}
  2186. </if>
  2187. <if test="configId !=null and configId != ''">
  2188. and t.config_id= #{configId}
  2189. </if>
  2190. <if test="feeFlag !=null and feeFlag != ''">
  2191. and t.fee_flag= #{feeFlag}
  2192. </if>
  2193. <if test="feeName !=null and feeName != ''">
  2194. and t.fee_name like '%${feeName}%'
  2195. </if>
  2196. <if test="startTime !=null ">
  2197. and t.start_time= #{startTime}
  2198. </if>
  2199. <if test="endTime !=null ">
  2200. and t.end_time= #{endTime}
  2201. </if>
  2202. <if test="valid !=null and valid == 1">
  2203. and t.end_time &gt; now()
  2204. </if>
  2205. <if test="curTime !=null ">
  2206. and t.end_time &gt; #{curTime}
  2207. and t.start_time &lt; #{curTime}
  2208. </if>
  2209. <if test="communityId !=null and communityId != ''">
  2210. and t.community_id= #{communityId}
  2211. </if>
  2212. <if test="bId !=null and bId != ''">
  2213. and t.b_id= #{bId}
  2214. </if>
  2215. <if test="paymentCd !=null and paymentCd != ''">
  2216. and t.payment_cd= #{paymentCd}
  2217. </if>
  2218. <if test="paymentCycle !=null and paymentCycle != ''">
  2219. and t.payment_cycle= #{paymentCycle}
  2220. </if>
  2221. <if test="billType !=null and billType != ''">
  2222. and t.bill_type= #{billType}
  2223. </if>
  2224. order by t.create_time desc
  2225. <if test="page != -1 and page != null ">
  2226. limit #{page}, #{row}
  2227. </if>
  2228. </select>
  2229. <select id="getRepairInfo" parameterType="Map" resultType="Map">
  2230. select r.staff_id staffId,r.staff_name staffName,r.state, t.name stateName, count(*) amount from r_repair_user r
  2231. left join t_dict t on t.table_name="r_repair_user" and t.table_columns="state" and t.status_cd=r.state
  2232. where r.state != "10005" and r.status_cd = "0"
  2233. <if test="ruId != null and ruId != ''">
  2234. and r.ru_id = #{ruId}
  2235. </if>
  2236. <if test="repairId != null and repairId != ''">
  2237. and r.repair_id = #{repairId}
  2238. </if>
  2239. <if test="communityId != null and communityId !=''">
  2240. and r.community_id = #{communityId}
  2241. </if>
  2242. <if test="bId != null and bId !=''">
  2243. and r.b_id = #{bId}
  2244. </if>
  2245. <if test="state != null and state != ''">
  2246. and r.state = #{state}
  2247. </if>
  2248. <if test="context != null and context !=''">
  2249. and r.context = #{context}
  2250. </if>
  2251. <if test="statusCd != null and statusCd != ''">
  2252. and r.status_cd = #{statusCd}
  2253. </if>
  2254. <if test="staffId != null and staffId !=''">
  2255. and r.staff_id = #{staffId}
  2256. </if>
  2257. <if test="staffName != null and staffName !=''">
  2258. and r.staff_name = #{staffName}
  2259. </if>
  2260. <if test="preStaffId != null and preStaffId !=''">
  2261. and r.pre_staff_id = #{preStaffId}
  2262. </if>
  2263. <if test="preStaffName != null and preStaffName !=''">
  2264. and r.pre_staff_name = #{preStaffName}
  2265. </if>
  2266. <if test="beginStartTime != null and beginStartTime !=''">
  2267. and r.start_time &gt;= #{beginStartTime}
  2268. </if>
  2269. <if test="beginEndTime != null and beginEndTime !=''">
  2270. and r.start_time &lt;= #{beginEndTime}
  2271. </if>
  2272. <if test="finishStartTime != null and finishStartTime !=''">
  2273. and r.end_time &gt;= #{finishStartTime}
  2274. </if>
  2275. <if test="finishEndTime != null and finishEndTime !=''">
  2276. and r.end_time &lt;= #{finishEndTime}
  2277. </if>
  2278. <if test="createTime != null and createTime !=''">
  2279. and r.create_time = #{createTime}
  2280. </if>
  2281. group by r.staff_id,r.state
  2282. order by r.create_time desc
  2283. <if test="page != -1 and page != null ">
  2284. limit #{page}, #{row}
  2285. </if>
  2286. </select>
  2287. <select id="getRepairWithOutPage" parameterType="Map" resultType="Map">
  2288. select r.staff_id staffId,r.staff_name staffName,r.state, t.name stateName,u.score, count(*) amount from
  2289. r_repair_user r
  2290. left join t_dict t on t.table_name="r_repair_user" and t.table_columns="state" and t.status_cd=r.state
  2291. left join u_user u on u.user_id = r.staff_id and u.status_cd = '0'
  2292. where r.state != '10005' and r.status_cd = '0'
  2293. <if test="ruId != null and ruId != ''">
  2294. and r.ru_id = #{ruId}
  2295. </if>
  2296. <if test="repairId != null and repairId != ''">
  2297. and r.repair_id = #{repairId}
  2298. </if>
  2299. <if test="communityId != null and communityId !=''">
  2300. and r.community_id = #{communityId}
  2301. </if>
  2302. <if test="bId != null and bId !=''">
  2303. and r.b_id = #{bId}
  2304. </if>
  2305. <if test="state != null and state != ''">
  2306. and r.state = #{state}
  2307. </if>
  2308. <if test="context != null and context !=''">
  2309. and r.context = #{context}
  2310. </if>
  2311. <if test="statusCd != null and statusCd != ''">
  2312. and r.status_cd = #{statusCd}
  2313. </if>
  2314. <if test="staffId != null and staffId !=''">
  2315. and r.staff_id = #{staffId}
  2316. </if>
  2317. <if test="staffName != null and staffName !=''">
  2318. and r.staff_name = #{staffName}
  2319. </if>
  2320. <if test="preStaffId != null and preStaffId !=''">
  2321. and r.pre_staff_id = #{preStaffId}
  2322. </if>
  2323. <if test="preStaffName != null and preStaffName !=''">
  2324. and r.pre_staff_name = #{preStaffName}
  2325. </if>
  2326. <if test="beginStartTime != null and beginStartTime !=''">
  2327. and r.start_time &gt;= #{beginStartTime}
  2328. </if>
  2329. <if test="beginEndTime != null and beginEndTime !=''">
  2330. and r.start_time &lt;= #{beginEndTime}
  2331. </if>
  2332. <if test="finishStartTime != null and finishStartTime !=''">
  2333. and r.end_time &gt;= #{finishStartTime}
  2334. </if>
  2335. <if test="finishEndTime != null and finishEndTime !=''">
  2336. and r.end_time &lt;= #{finishEndTime}
  2337. </if>
  2338. <if test="createTime != null and createTime !=''">
  2339. and r.create_time = #{createTime}
  2340. </if>
  2341. group by r.staff_id,r.state
  2342. order by r.create_time desc
  2343. </select>
  2344. <select id="queryRepairForStaff" parameterType="Map" resultType="Map">
  2345. SELECT r.staff_id staffId,r.staff_name staffName,r.state FROM r_repair_user r
  2346. inner join u_user u on u.user_id = r.staff_id and u.status_cd = '0'
  2347. WHERE r.state!='10005' AND r.state!='10009' AND r.state!='11000' AND
  2348. r.state!='12000' AND r.state != '10007' AND r.status_cd = '0' AND
  2349. r.repair_event != 'payUser' AND r.repair_event != 'startUser' AND r.staff_id != '-1'
  2350. <if test="communityId != null and communityId !=''">
  2351. and r.community_id = #{communityId}
  2352. </if>
  2353. <if test="staffId != null and staffId != ''">
  2354. and r.staff_id = #{staffId}
  2355. </if>
  2356. group by r.staff_id
  2357. order by r.create_time desc
  2358. <if test="page != -1 and page != null ">
  2359. limit #{page}, #{row}
  2360. </if>
  2361. </select>
  2362. <select id="getReceivableInformation" parameterType="Map" resultType="Map">
  2363. select a.receivableAmount,a.receivedAmount, IF(a.receivableAmount &lt;
  2364. a.oweReceivedAmount,'0',a.receivableAmount-a.oweReceivedAmount) oweAmount
  2365. from (
  2366. select sum(t.his_owe_amount+t.cur_receivable_amount)
  2367. receivableAmount,sum(t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount) receivedAmount,
  2368. sum(t.cur_received_amount+t.his_owe_received_amount) oweReceivedAmount
  2369. from report_fee_month_statistics t
  2370. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
  2371. where 1=1
  2372. and t.fee_year= #{feeYear}
  2373. and t.fee_month= #{feeMonth}
  2374. and t.community_id = #{communityId}
  2375. ) a
  2376. </select>
  2377. <select id="getFloorReceivableInformation" parameterType="Map" resultType="Map">
  2378. select a.floorNum,a.`name`,a.receivableAmount,a.receivedAmount, IF(a.receivableAmount &lt;
  2379. a.oweReceivedAmount,'0',a.receivableAmount-a.oweReceivedAmount) oweAmount
  2380. from (
  2381. select f.floor_num floorNum,f.`name`,sum(t.his_owe_amount+t.cur_receivable_amount)
  2382. receivableAmount,sum(t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount) receivedAmount,
  2383. sum(t.cur_received_amount+t.his_owe_received_amount) oweReceivedAmount
  2384. from report_fee_month_statistics t
  2385. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
  2386. inner join building_room br on br.room_id = t.obj_id and t.obj_type = '3333' and br.community_id =
  2387. t.community_id and br.status_cd = '0'
  2388. inner join building_unit bu on bu.unit_id = br.unit_id and bu.status_cd = '0'
  2389. inner join f_floor f on f.floor_id = bu.floor_id and f.status_cd = '0'
  2390. where 1=1
  2391. and t.fee_year= #{feeYear}
  2392. and t.fee_month= #{feeMonth}
  2393. and t.community_id = #{communityId}
  2394. group by f.floor_num ,f.`name`
  2395. ) a
  2396. </select>
  2397. <select id="getFeeConfigReceivableInformation" parameterType="Map" resultType="Map">
  2398. select a.feeName,a.receivableAmount,a.receivedAmount, IF(a.receivableAmount &lt;
  2399. a.oweReceivedAmount,'0',a.receivableAmount-a.oweReceivedAmount) oweAmount
  2400. from (
  2401. select t.fee_name feeName,sum(t.his_owe_amount+t.cur_receivable_amount)
  2402. receivableAmount,sum(t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount) receivedAmount,
  2403. sum(t.cur_received_amount+t.his_owe_received_amount) oweReceivedAmount
  2404. from report_fee_month_statistics t
  2405. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
  2406. left join building_room br on br.room_id = t.obj_id and t.obj_type = '3333' and br.community_id =
  2407. t.community_id and br.status_cd = '0'
  2408. left join building_unit bu on bu.unit_id = br.unit_id and bu.status_cd = '0'
  2409. left join f_floor f on f.floor_id = bu.floor_id and f.status_cd = '0'
  2410. where 1=1
  2411. and t.fee_year= #{feeYear}
  2412. and t.fee_month= #{feeMonth}
  2413. and t.community_id = #{communityId}
  2414. group by t.fee_name
  2415. ) a
  2416. </select>
  2417. <!-- 查询未收费房屋统计数量 add by wuxw 2018-07-03 -->
  2418. <select id="queryNoFeeRoomsCount" parameterType="Map" resultType="Map">
  2419. select count(1) count
  2420. from building_room t
  2421. inner join building_unit bu
  2422. on t.unit_id = bu.unit_id and bu.status_cd = '0'
  2423. inner join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  2424. where t.status_cd = '0'
  2425. and not exists (
  2426. select 1 from pay_fee pf where t.room_id = pf.payer_obj_id
  2427. and pf.status_cd = '0'
  2428. and pf.state = '2008001'
  2429. )
  2430. and t.community_id = #{communityId}
  2431. </select>
  2432. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  2433. <select id="queryNoFeeRooms" parameterType="Map" resultType="Map">
  2434. select f.floor_num floorNum,bu.unit_num unitNum,t.room_num roomNum,t.room_id roomId,bo.owner_id ownerId,bo.name
  2435. ownerName,bo.link
  2436. from building_room t
  2437. inner join building_unit bu on t.unit_id = bu.unit_id and bu.status_cd = '0'
  2438. inner join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  2439. left join building_owner_room_rel borr on borr.room_id = t.room_id and borr.status_cd ='0'
  2440. left join building_owner bo on borr.owner_id = bo.member_id and bo.status_cd = '0'
  2441. where t.status_cd = '0'
  2442. and not exists(
  2443. select 1 from pay_fee pf where t.room_id = pf.payer_obj_id and pf.status_cd = '0' and pf.state = '2008001'
  2444. )
  2445. and t.community_id = #{communityId}
  2446. order by bo.name
  2447. <if test="page != -1 and page != null ">
  2448. limit #{page}, #{row}
  2449. </if>
  2450. </select>
  2451. <!-- 查询押金 -->
  2452. <select id="queryPayFeeDeposit" parameterType="Map" resultType="Map">
  2453. select t.amount,t.income_obj_id,t.income_obj_id incomeObjId,t.fee_type_cd,t.fee_type_cd
  2454. feeTypeCd,t.start_time,t.start_time startTime,t.status_cd,t.status_cd statusCd,t.end_time,t.end_time
  2455. endTime,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.fee_id,t.fee_id feeId,t.user_id,t.user_id
  2456. userId,t.payer_obj_id,t.payer_obj_id payerObjId,pfc.square_price squarePrice,pfc.additional_amount
  2457. additionalAmount,t.fee_flag,t.fee_flag feeFlag,t.state,t.config_id,t.config_id configId,
  2458. pfc.fee_name feeName,td1.name feeTypeCdName,td2.name stateName,td3.name feeFlagName,pfc.computing_formula
  2459. computingFormula,pfc.computing_formula_text computingFormulaText,
  2460. pfc.bill_type billType,t.payer_obj_type,t.payer_obj_type payerObjType,pfc.is_default isDefault,pfc.start_time
  2461. configStartTime,pfc.end_time configEndTime,pfc.payment_cd paymentCd,pfc.payment_cycle paymentCycle,td4.name
  2462. billTypeName,t.create_time createTime,td5.name payerObjTypeName,pfd.state detailState,td6.name
  2463. detailStateName,pfa1.`value` deadlineTime
  2464. ,pfo.`value` ownerName,f.floor_num floorNum,bu.unit_num unitNum,br.room_num roomNum,oc.car_num carNum
  2465. from pay_fee t
  2466. INNER join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0' and pfc.fee_type_cd =
  2467. '888800010006'
  2468. left join pay_fee_detail pfd on t.fee_id = pfd.fee_id and pfd.status_cd = '0' and pfd.state != '1300'
  2469. left join t_dict td1 on pfc.fee_type_cd = td1.status_cd and td1.table_name = 'pay_fee_config' and
  2470. td1.table_columns = 'fee_type_cd'
  2471. left join t_dict td2 on t.state = td2.status_cd and td2.table_name = 'pay_fee' and td2.table_columns = 'state'
  2472. left join t_dict td3 on t.fee_flag = td3.status_cd and td3.table_name = 'pay_fee' and td3.table_columns =
  2473. 'fee_flag'
  2474. left join t_dict td4 on pfc.bill_type = td4.status_cd and td4.table_name = 'pay_fee_config' and
  2475. td4.table_columns = 'bill_type'
  2476. left join t_dict td5 on t.payer_obj_type = td5.status_cd and td5.table_name = 'pay_fee' and
  2477. td5.table_columns = 'payer_obj_type'
  2478. left join t_dict td6 on pfd.state = td6.status_cd and td6.table_name = 'pay_fee_detail' and
  2479. td6.table_columns = 'state'
  2480. left join pay_fee_attrs pfo on t.fee_id = pfo.fee_id and pfo.spec_cd = '390008'
  2481. LEFT JOIN pay_fee_attrs pfa1 on t.fee_id = pfa1.fee_id and pfa1.spec_cd = '390010' and pfa1.status_cd = '0'
  2482. left join building_room br on t.payer_obj_id = br.room_id and t.payer_obj_type = '3333' and br.status_cd = '0'
  2483. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  2484. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  2485. left join owner_car oc on t.payer_obj_id = oc.car_id and oc.car_type_cd='1001'
  2486. where 1 = 1
  2487. <if test="roomNum !=null and roomNum != ''">
  2488. and br.room_num= #{roomNum}
  2489. </if>
  2490. <if test="unitId !=null and unitId != ''">
  2491. and bu.unit_id= #{unitId}
  2492. </if>
  2493. <if test="floorId !=null and floorId != ''">
  2494. and f.floor_id = #{floorId}
  2495. </if>
  2496. <if test="amount != null and amount != ''">
  2497. and t.amount = #{amount}
  2498. </if>
  2499. <if test="incomeObjId != null and incomeObjId != ''">
  2500. and t.income_obj_id = #{incomeObjId}
  2501. </if>
  2502. <if test="feeTypeCd != null and feeTypeCd != ''">
  2503. and t.fee_type_cd = #{feeTypeCd}
  2504. </if>
  2505. <if test="startTime != null and startTime != ''">
  2506. and t.start_time = #{startTime}
  2507. </if>
  2508. <if test="endTime != null and endTime != ''">
  2509. and t.end_time = #{endTime}
  2510. </if>
  2511. <if test="statusCd != null and statusCd != ''">
  2512. and t.status_cd = #{statusCd}
  2513. </if>
  2514. <if test="communityId != null and communityId != ''">
  2515. and t.community_id = #{communityId}
  2516. </if>
  2517. <if test="feeId != null and feeId != ''">
  2518. and t.fee_id = #{feeId}
  2519. </if>
  2520. <if test="userId != null and userId != ''">
  2521. and t.user_id = #{userId}
  2522. </if>
  2523. <if test="payerObjId != null and payerObjId != ''">
  2524. and t.payer_obj_id = #{payerObjId}
  2525. </if>
  2526. <if test="squarePrice != null and squarePrice != ''">
  2527. and pfc.square_price = #{squarePrice}
  2528. </if>
  2529. <if test="additionalAmount != null and additionalAmount != ''">
  2530. and pfc.additional_amount = #{additionalAmount}
  2531. </if>
  2532. <if test="feeFlag != null and feeFlag != ''">
  2533. and t.fee_flag = #{feeFlag}
  2534. </if>
  2535. <if test="state != null and state != ''">
  2536. and t.state = #{state}
  2537. </if>
  2538. <if test="configId != null and configId != ''">
  2539. and t.config_id = #{configId}
  2540. </if>
  2541. <if test="feeName != null and feeName != ''">
  2542. and pfc.fee_name = #{feeName}
  2543. </if>
  2544. <if test="computingFormula != null and computingFormula != ''">
  2545. and pfc.computing_formula = #{computingFormula}
  2546. </if>
  2547. <if test="computingFormulaText != null and computingFormulaText != ''">
  2548. and pfc.computing_formula_text = #{computingFormulaText}
  2549. </if>
  2550. <if test="billType != null and billType != ''">
  2551. and pfc.bill_type = #{billType}
  2552. </if>
  2553. <if test="payerObjType != null and payerObjType != ''">
  2554. and t.payer_obj_type = #{payerObjType}
  2555. </if>
  2556. <if test="isDefault != null and isDefault != ''">
  2557. and pfc.is_default = #{isDefault}
  2558. </if>
  2559. <if test="configStartTime != null and configStartTime != ''">
  2560. and pfc.start_time = #{configStartTime}
  2561. </if>
  2562. <if test="configEndTime != null and configEndTime != ''">
  2563. and pfc.end_time = #{configEndTime}
  2564. </if>
  2565. <if test="paymentCd != null and paymentCd != ''">
  2566. and pfc.payment_cd = #{paymentCd}
  2567. </if>
  2568. <if test="paymentCycle != null and paymentCycle != ''">
  2569. and pfc.payment_cycle = #{paymentCycle}
  2570. </if>
  2571. <if test="feeStartTime != null and feeStartTime != ''">
  2572. and t.create_time &gt;= #{feeStartTime}
  2573. </if>
  2574. <if test="feeEndTime != null and feeEndTime != ''">
  2575. and t.create_time &lt;= #{feeEndTime}
  2576. </if>
  2577. <if test="detailState != null and detailState != ''">
  2578. and pfd.state = #{detailState}
  2579. </if>
  2580. order by t.create_time desc
  2581. <if test="page != -1 and page != null ">
  2582. limit #{page}, #{row}
  2583. </if>
  2584. </select>
  2585. <!-- 查询押金退费总金额 -->
  2586. <select id="queryFeeDepositAmount" parameterType="Map" resultType="Map">
  2587. select SUM(pfc.additional_amount) allAmount,pfd.state detailState
  2588. from pay_fee t
  2589. INNER join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0' and pfc.fee_type_cd =
  2590. '888800010006'
  2591. left join pay_fee_detail pfd on t.fee_id = pfd.fee_id and pfd.status_cd = '0' and pfd.state != '1300'
  2592. left join t_dict td1 on pfc.fee_type_cd = td1.status_cd and td1.table_name = 'pay_fee_config' and
  2593. td1.table_columns = 'fee_type_cd'
  2594. left join t_dict td2 on t.state = td2.status_cd and td2.table_name = 'pay_fee' and td2.table_columns = 'state'
  2595. left join t_dict td3 on t.fee_flag = td3.status_cd and td3.table_name = 'pay_fee' and td3.table_columns =
  2596. 'fee_flag'
  2597. left join t_dict td4 on pfc.bill_type = td4.status_cd and td4.table_name = 'pay_fee_config' and
  2598. td4.table_columns = 'bill_type'
  2599. left join t_dict td5 on t.payer_obj_type = td5.status_cd and td5.table_name = 'pay_fee' and
  2600. td5.table_columns = 'payer_obj_type'
  2601. left join t_dict td6 on pfd.state = td6.status_cd and td6.table_name = 'pay_fee_detail' and
  2602. td6.table_columns = 'state'
  2603. left join pay_fee_attrs pfo on t.fee_id = pfo.fee_id and pfo.spec_cd = '390008'
  2604. LEFT JOIN pay_fee_attrs pfa1 on t.fee_id = pfa1.fee_id and pfa1.spec_cd = '390010' and pfa1.status_cd = '0'
  2605. left join building_room br on t.payer_obj_id = br.room_id and t.payer_obj_type = '3333' and br.status_cd = '0'
  2606. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  2607. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  2608. left join owner_car oc on t.payer_obj_id = oc.car_id and oc.status_cd = '0' and oc.car_type_cd='1001'
  2609. where 1 = 1
  2610. <if test="roomNum !=null and roomNum != ''">
  2611. and br.room_num= #{roomNum}
  2612. </if>
  2613. <if test="unitId !=null and unitId != ''">
  2614. and bu.unit_id= #{unitId}
  2615. </if>
  2616. <if test="floorId !=null and floorId != ''">
  2617. and f.floor_id = #{floorId}
  2618. </if>
  2619. <if test="amount != null and amount != ''">
  2620. and t.amount = #{amount}
  2621. </if>
  2622. <if test="incomeObjId != null and incomeObjId != ''">
  2623. and t.income_obj_id = #{incomeObjId}
  2624. </if>
  2625. <if test="feeTypeCd != null and feeTypeCd != ''">
  2626. and t.fee_type_cd = #{feeTypeCd}
  2627. </if>
  2628. <if test="startTime != null and startTime != ''">
  2629. and t.start_time = #{startTime}
  2630. </if>
  2631. <if test="endTime != null and endTime != ''">
  2632. and t.end_time = #{endTime}
  2633. </if>
  2634. <if test="statusCd != null and statusCd != ''">
  2635. and t.status_cd = #{statusCd}
  2636. </if>
  2637. <if test="communityId != null and communityId != ''">
  2638. and t.community_id = #{communityId}
  2639. </if>
  2640. <if test="feeId != null and feeId != ''">
  2641. and t.fee_id = #{feeId}
  2642. </if>
  2643. <if test="userId != null and userId != ''">
  2644. and t.user_id = #{userId}
  2645. </if>
  2646. <if test="payerObjId != null and payerObjId != ''">
  2647. and t.payer_obj_id = #{payerObjId}
  2648. </if>
  2649. <if test="squarePrice != null and squarePrice != ''">
  2650. and pfc.square_price = #{squarePrice}
  2651. </if>
  2652. <if test="additionalAmount != null and additionalAmount != ''">
  2653. and pfc.additional_amount = #{additionalAmount}
  2654. </if>
  2655. <if test="feeFlag != null and feeFlag != ''">
  2656. and t.fee_flag = #{feeFlag}
  2657. </if>
  2658. <if test="state != null and state != ''">
  2659. and t.state = #{state}
  2660. </if>
  2661. <if test="configId != null and configId != ''">
  2662. and t.config_id = #{configId}
  2663. </if>
  2664. <if test="feeName != null and feeName != ''">
  2665. and pfc.fee_name = #{feeName}
  2666. </if>
  2667. <if test="computingFormula != null and computingFormula != ''">
  2668. and pfc.computing_formula = #{computingFormula}
  2669. </if>
  2670. <if test="computingFormulaText != null and computingFormulaText != ''">
  2671. and pfc.computing_formula_text = #{computingFormulaText}
  2672. </if>
  2673. <if test="billType != null and billType != ''">
  2674. and pfc.bill_type = #{billType}
  2675. </if>
  2676. <if test="payerObjType != null and payerObjType != ''">
  2677. and t.payer_obj_type = #{payerObjType}
  2678. </if>
  2679. <if test="isDefault != null and isDefault != ''">
  2680. and pfc.is_default = #{isDefault}
  2681. </if>
  2682. <if test="configStartTime != null and configStartTime != ''">
  2683. and pfc.start_time = #{configStartTime}
  2684. </if>
  2685. <if test="configEndTime != null and configEndTime != ''">
  2686. and pfc.end_time = #{configEndTime}
  2687. </if>
  2688. <if test="paymentCd != null and paymentCd != ''">
  2689. and pfc.payment_cd = #{paymentCd}
  2690. </if>
  2691. <if test="paymentCycle != null and paymentCycle != ''">
  2692. and pfc.payment_cycle = #{paymentCycle}
  2693. </if>
  2694. <if test="feeStartTime != null and feeStartTime != ''">
  2695. and t.create_time &gt;= #{feeStartTime}
  2696. </if>
  2697. <if test="feeEndTime != null and feeEndTime != ''">
  2698. and t.create_time &lt;= #{feeEndTime}
  2699. </if>
  2700. <if test="detailState != null and detailState != ''">
  2701. and pfd.state = #{detailState}
  2702. </if>
  2703. group by pfd.state
  2704. </select>
  2705. <select id="queryHuaningOweFeeCount" parameterType="Map" resultType="Map">
  2706. select count(1) count
  2707. from f_floor f
  2708. where 1=1
  2709. and f.community_id = #{communityId}
  2710. and f.status_cd = '0'
  2711. </select>
  2712. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  2713. <select id="queryHuaningOweFee" parameterType="Map" resultType="Map">
  2714. select
  2715. f.floor_num floorNum,
  2716. (
  2717. select ifnull(SUM(t.receivable_amount),0)
  2718. from pay_fee_detail_month t
  2719. inner join building_room br on t.obj_id = br.room_id and br.status_cd = '0'
  2720. inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  2721. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
  2722. where
  2723. 1=1
  2724. and bu.floor_id = f.floor_id
  2725. and t.community_id = f.community_id
  2726. <if test="feeTypeCd != null and feeTypeCd != ''">
  2727. and pf.fee_type_cd = #{feeTypeCd}
  2728. </if>
  2729. and t.detail_id = '-1'
  2730. and t.cur_month_time &lt;= #{endTime}
  2731. ) oweAmount,
  2732. (
  2733. select ifnull(SUM(t.receivable_amount),0)
  2734. from pay_fee_detail_month t
  2735. inner join building_room br on t.obj_id = br.room_id and br.status_cd = '0'
  2736. inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  2737. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
  2738. where
  2739. 1=1
  2740. and bu.floor_id = f.floor_id
  2741. and t.community_id = f.community_id
  2742. <if test="feeTypeCd != null and feeTypeCd != ''">
  2743. and pf.fee_type_cd = #{feeTypeCd}
  2744. </if>
  2745. and t.detail_id = '-1'
  2746. and t.cur_month_time &lt;= #{endTime}
  2747. and t.cur_month_time &gt;= #{startTime}
  2748. ) curOweAmount,
  2749. (
  2750. select ifnull(SUM(t.receivable_amount),0)
  2751. from pay_fee_detail_month t
  2752. inner join building_room br on t.obj_id = br.room_id and br.status_cd = '0'
  2753. inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  2754. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
  2755. where
  2756. 1=1
  2757. and bu.floor_id = f.floor_id
  2758. and t.community_id = f.community_id
  2759. <if test="feeTypeCd != null and feeTypeCd != ''">
  2760. and pf.fee_type_cd = #{feeTypeCd}
  2761. </if>
  2762. and t.detail_id = '-1'
  2763. and t.cur_month_time &lt; #{startTime}
  2764. ) preOweAmount
  2765. from f_floor f
  2766. where 1=1
  2767. and f.community_id = #{communityId}
  2768. and f.status_cd = '0'
  2769. </select>
  2770. <select id="queryHuaningPayFeeCount" parameterType="Map" resultType="Map">
  2771. select count(1) count
  2772. from (
  2773. select t.floor_num
  2774. from f_floor t
  2775. where 1=1
  2776. and t.community_id= #{communityId}
  2777. GROUP BY t.floor_num
  2778. ) tt
  2779. </select>
  2780. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  2781. <select id="queryHuaningPayFee" parameterType="Map" resultType="Map">
  2782. select
  2783. a.floorNum,f.receivableAmount,a.receivedAmount,b.receivedAmount1,c.receivedAmount2,d.receivedAmount3,e.receivedAmount4
  2784. from
  2785. (select t.floor_num floorNum,sum(pfd.received_amount) receivedAmount
  2786. from f_floor t
  2787. inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
  2788. inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
  2789. inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
  2790. inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
  2791. where 1=1
  2792. and t.status_cd = '0'
  2793. and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth}
  2794. and t.community_id= #{communityId}
  2795. GROUP BY floor_num
  2796. ) a,
  2797. (select t.floor_num floorNum,sum(pfdm1.received_amount ) receivedAmount1
  2798. from f_floor t
  2799. inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
  2800. inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
  2801. inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
  2802. inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
  2803. LEFT JOIN pay_fee_detail_month pfdm1 on pf.fee_id = pfdm1.fee_id and pfd.detail_id = pfdm1.detail_id and
  2804. pfdm1.status_cd = '0' and pfdm1.detail_year = #{year} and pfdm1.detail_month &lt; #{month}
  2805. where 1=1
  2806. and t.status_cd = '0'
  2807. and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth}
  2808. and t.community_id= #{communityId}
  2809. GROUP BY floor_num
  2810. ) b,
  2811. (select t.floor_num floorNum,sum(pfdm2.received_amount ) receivedAmount2
  2812. from f_floor t
  2813. inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
  2814. inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
  2815. inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
  2816. inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
  2817. LEFT JOIN pay_fee_detail_month pfdm2 on pf.fee_id = pfdm2.fee_id and pfd.detail_id = pfdm2.detail_id and
  2818. pfdm2.status_cd = '0' and pfdm2.detail_year = #{year} and pfdm2.detail_month = #{month}
  2819. where 1=1
  2820. and t.status_cd = '0'
  2821. and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth}
  2822. and t.community_id= #{communityId}
  2823. GROUP BY floor_num
  2824. ) c,
  2825. (select t.floor_num floorNum,sum(pfdm3.received_amount ) receivedAmount3
  2826. from f_floor t
  2827. inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
  2828. inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
  2829. inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
  2830. inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
  2831. LEFT JOIN pay_fee_detail_month pfdm3 on pf.fee_id = pfdm3.fee_id and pfd.detail_id = pfdm3.detail_id and
  2832. pfdm3.status_cd = '0' and pfdm3.detail_year = #{nextYear} and pfdm3.detail_month = #{nextMonth}
  2833. where 1=1
  2834. and t.status_cd = '0'
  2835. and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth}
  2836. and t.community_id= #{communityId}
  2837. GROUP BY floor_num
  2838. ) d,
  2839. (select t.floor_num floorNum,sum(pfdm4.received_amount ) receivedAmount4
  2840. from f_floor t
  2841. inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
  2842. inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
  2843. inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
  2844. inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
  2845. LEFT JOIN pay_fee_detail_month pfdm4 on pf.fee_id = pfdm4.fee_id and pfd.detail_id = pfdm4.detail_id and
  2846. pfdm4.status_cd = '0' and pfdm4.detail_year &lt; #{year}
  2847. where 1=1
  2848. and t.status_cd = '0'
  2849. and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth}
  2850. and t.community_id= #{communityId}
  2851. GROUP BY floor_num
  2852. ) e,
  2853. (select t.floor_num floorNum,SUM(rfms.receivable_amount) receivableAmount
  2854. from f_floor t
  2855. inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
  2856. inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
  2857. inner JOIN report_fee_month_statistics rfms on rfms.obj_id = br.room_id and rfms.status_cd = '0'
  2858. where t.community_id = #{communityId}
  2859. and rfms.fee_year = #{year}
  2860. and rfms.fee_month = #{month}
  2861. group by t.floor_num
  2862. ) f
  2863. where a.floorNum = b.floorNum
  2864. and b.floorNum = c.floorNum
  2865. and c.floorNum = d.floorNum
  2866. and d.floorNum = e.floorNum
  2867. and e.floorNum = f.floorNum
  2868. <if test="page != -1 and page != null ">
  2869. limit #{page}, #{row}
  2870. </if>
  2871. </select>
  2872. <select id="queryHuaningPayFeeTwoCount" parameterType="Map" resultType="Map">
  2873. select count(1) count
  2874. from (
  2875. select a.floorNum, d.receivableAmount,
  2876. a.receivedAmount, b.receivedAmount1,
  2877. c.receivedAmount2
  2878. from
  2879. (select t.floor_num floorNum, sum (pfd.received_amount) receivedAmount
  2880. from f_floor t
  2881. inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
  2882. inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
  2883. inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
  2884. inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
  2885. where 1=1
  2886. and t.status_cd = '0'
  2887. and DATE_FORMAT(pfd.create_time, '%Y-%m') = #{yearMonth}
  2888. and t.community_id= #{communityId}
  2889. GROUP BY floor_num
  2890. ) a,
  2891. (select t.floor_num floorNum, SUM (pfdm1.discount_amount) receivedAmount1
  2892. from f_floor t
  2893. inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
  2894. inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
  2895. inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
  2896. inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
  2897. LEFT JOIN pay_fee_detail_month pfdm1 on pf.fee_id = pfdm1.fee_id and pfd.detail_id = pfdm1.detail_id and
  2898. pfdm1.status_cd = '0' and pfdm1.detail_year = #{year} and pfdm1.detail_month &lt; #{month}
  2899. where 1=1
  2900. and t.status_cd = '0'
  2901. and DATE_FORMAT(pfd.create_time, '%Y-%m') = #{yearMonth}
  2902. and t.community_id= #{communityId}
  2903. GROUP BY floor_num
  2904. ) b,
  2905. (select t.floor_num floorNum, SUM (pfdm2.received_amount) receivedAmount2
  2906. from f_floor t
  2907. inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
  2908. inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
  2909. inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
  2910. inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
  2911. LEFT JOIN pay_fee_detail_month pfdm2 on pf.fee_id = pfdm2.fee_id and pfd.detail_id = pfdm2.detail_id and
  2912. pfdm2.status_cd = '0' and pfdm2.detail_year = #{year} and pfdm2.detail_month &gt; #{month}
  2913. where 1=1
  2914. and t.status_cd = '0'
  2915. and DATE_FORMAT(pfd.create_time, '%Y-%m') = #{yearMonth}
  2916. and t.community_id= #{communityId}
  2917. GROUP BY floor_num
  2918. ) c,
  2919. (select t.floor_num floorNum, SUM (rfms.owe_amount) receivableAmount
  2920. from f_floor t
  2921. inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
  2922. inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
  2923. inner JOIN report_fee_month_statistics rfms on rfms.obj_id = br.room_id and rfms.status_cd = '0'
  2924. where t.community_id= #{communityId}
  2925. group by t.floor_num
  2926. ) d
  2927. where a.floorNum = b.floorNum
  2928. and b.floorNum = c.floorNum
  2929. and c.floorNum = d.floorNum
  2930. ) tt
  2931. </select>
  2932. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  2933. <select id="queryHuaningPayFeeTwo" parameterType="Map" resultType="Map">
  2934. select a.floorNum,d.receivableAmount ,
  2935. a.receivedAmount,b.receivedAmount1,
  2936. c.receivedAmount2
  2937. from
  2938. (select t.floor_num floorNum,sum(pfd.received_amount) receivedAmount
  2939. from f_floor t
  2940. inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
  2941. inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
  2942. inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
  2943. inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
  2944. where 1=1
  2945. and t.status_cd = '0'
  2946. and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth}
  2947. and t.community_id= #{communityId}
  2948. GROUP BY floor_num
  2949. ) a,
  2950. (select t.floor_num floorNum,SUM(pfdm1.discount_amount) receivedAmount1
  2951. from f_floor t
  2952. inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
  2953. inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
  2954. inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
  2955. inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
  2956. LEFT JOIN pay_fee_detail_month pfdm1 on pf.fee_id = pfdm1.fee_id and pfd.detail_id = pfdm1.detail_id and
  2957. pfdm1.status_cd = '0' and pfdm1.detail_year = #{year} and pfdm1.detail_month &lt; #{month}
  2958. where 1=1
  2959. and t.status_cd = '0'
  2960. and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth}
  2961. and t.community_id= #{communityId}
  2962. GROUP BY floor_num
  2963. ) b,
  2964. (select t.floor_num floorNum,SUM(pfdm2.received_amount) receivedAmount2
  2965. from f_floor t
  2966. inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
  2967. inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
  2968. inner JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
  2969. inner join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
  2970. LEFT JOIN pay_fee_detail_month pfdm2 on pf.fee_id = pfdm2.fee_id and pfd.detail_id = pfdm2.detail_id and
  2971. pfdm2.status_cd = '0' and pfdm2.detail_year = #{year} and pfdm2.detail_month &gt; #{month}
  2972. where 1=1
  2973. and t.status_cd = '0'
  2974. and DATE_FORMAT(pfd.create_time,'%Y-%m') = #{yearMonth}
  2975. and t.community_id= #{communityId}
  2976. GROUP BY floor_num
  2977. ) c,
  2978. (select t.floor_num floorNum,SUM(rfms.owe_amount) receivableAmount
  2979. from f_floor t
  2980. inner JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
  2981. inner JOIN building_room br on br.unit_id = bu.unit_id and br.status_cd = '0'
  2982. inner JOIN report_fee_month_statistics rfms on rfms.obj_id = br.room_id and rfms.status_cd = '0'
  2983. where t.community_id= #{communityId}
  2984. group by t.floor_num
  2985. ) d
  2986. where a.floorNum = b.floorNum
  2987. and b.floorNum = c.floorNum
  2988. and c.floorNum = d.floorNum
  2989. <if test="page != -1 and page != null ">
  2990. limit #{page}, #{row}
  2991. </if>
  2992. </select>
  2993. <select id="queryHuaningOweFeeDetailCount" parameterType="Map" resultType="Map">
  2994. select
  2995. count(1) count
  2996. from building_room br
  2997. inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  2998. inner join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  2999. inner join report_owe_fee rof on br.room_id = rof.payer_obj_id
  3000. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
  3001. where 1=1
  3002. and br.community_id = #{communityId}
  3003. and br.status_cd = '0'
  3004. and rof.amount_owed > 0
  3005. <if test="feeTypeCd != null and feeTypeCd != ''">
  3006. and pf.fee_type_cd = #{feeTypeCd}
  3007. </if>
  3008. <if test="floorId != null and floorId != ''">
  3009. and f.floor_id = #{floorId}
  3010. </if>
  3011. </select>
  3012. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  3013. <select id="queryHuaningOweFeeDetail" parameterType="Map" resultType="Map">
  3014. select
  3015. concat(f.floor_num,'-',bu.unit_num,'-',br.room_num) roomName,
  3016. br.built_up_area builtUpArea,
  3017. rof.fee_name feeName,
  3018. rof.end_time endTime,
  3019. rof.deadline_time deadlineTime,
  3020. (
  3021. select ifnull(SUM(t.receivable_amount),0)
  3022. from pay_fee_detail_month t
  3023. where
  3024. 1=1
  3025. and t.fee_id = rof.fee_id
  3026. and t.community_id = f.community_id
  3027. and t.detail_id = '-1'
  3028. and t.cur_month_time &lt;= #{startTime}
  3029. ) oweAmount,
  3030. (
  3031. select ifnull(SUM(t.receivable_amount),0)
  3032. from pay_fee_detail_month t
  3033. where
  3034. 1=1
  3035. and t.fee_id = rof.fee_id
  3036. and t.community_id = f.community_id
  3037. and t.detail_id = '-1'
  3038. and t.cur_month_time &lt;= #{startTime}
  3039. and t.cur_month_time &gt;= #{endTime}
  3040. ) curOweAmount,
  3041. (
  3042. select ifnull(SUM(t.receivable_amount),0)
  3043. from pay_fee_detail_month t
  3044. where
  3045. 1=1
  3046. and t.fee_id = rof.fee_id
  3047. and t.community_id = f.community_id
  3048. and t.detail_id = '-1'
  3049. and t.cur_month_time &lt;= #{startTime}
  3050. ) preOweAmount
  3051. from building_room br
  3052. inner join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  3053. inner join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  3054. inner join report_owe_fee rof on br.room_id = rof.payer_obj_id
  3055. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
  3056. where 1=1
  3057. and br.community_id = #{communityId}
  3058. and br.status_cd = '0'
  3059. and rof.amount_owed > 0
  3060. <if test="feeTypeCd != null and feeTypeCd != ''">
  3061. and pf.fee_type_cd = #{feeTypeCd}
  3062. </if>
  3063. <if test="floorId != null and floorId != ''">
  3064. and f.floor_id = #{floorId}
  3065. </if>
  3066. <if test="page != -1 and page != null ">
  3067. limit #{page}, #{row}
  3068. </if>
  3069. </select>
  3070. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  3071. <select id="getReceivedAmountByMonth" parameterType="Map" resultType="Map">
  3072. select ifnull(sum(t.received_amount),0) total
  3073. from pay_fee_detail_month t
  3074. where 1=1
  3075. and t.create_time &gt; #{startTime}
  3076. and t.create_time &lt; #{endTime}
  3077. and t.fee_id = #{feeId}
  3078. <if test="flag == 1">
  3079. and concat(t.detail_year,lpad(t.detail_month,2,0)) = #{yearMonth}
  3080. </if>
  3081. <if test="flag == 2">
  3082. and concat(t.detail_year,lpad(t.detail_month,2,0)) &lt; #{yearMonth}
  3083. </if>
  3084. <if test="flag == 3">
  3085. and concat(t.detail_year,lpad(t.detail_month,2,0)) &gt; #{yearMonth}
  3086. </if>
  3087. <if test="communityId !=null and communityId != ''">
  3088. and t.community_id= #{communityId}
  3089. </if>
  3090. </select>
  3091. <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
  3092. <select id="queryRoomAndParkingSpace" parameterType="Map" resultType="Map">
  3093. select
  3094. br.room_id roomId,br.room_num roomNum,bu.unit_num unitNum,f.floor_num floorNum,t.owner_id ownerId
  3095. from building_owner_room_rel t
  3096. left join building_room br on t.room_id = br.room_id and br.status_cd = '0'
  3097. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  3098. left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  3099. where t.status_cd = '0'
  3100. and t.owner_id in
  3101. <foreach collection="ownerIds" item="item" open="(" close=")" separator=",">
  3102. #{item}
  3103. </foreach>
  3104. </select>
  3105. <!-- 查询无效费用 add by wuxw 2018-07-03 -->
  3106. <select id="queryInvalidFeeMonthStatistics" parameterType="Map" resultType="Map">
  3107. select t.fee_id feeId
  3108. from pay_fee t
  3109. inner join pay_fee_config pfc on t.config_id = pfc.config_id
  3110. inner join report_fee_month_statistics rfms on t.fee_id = rfms.fee_id and rfms.status_cd = '0'
  3111. where (t.status_cd = '1' or pfc.status_cd = '1')
  3112. and t.community_id = #{communityId}
  3113. </select>
  3114. <!--清理报表 无效数据-->
  3115. <update id="deleteInvalidFee" parameterType="Map">
  3116. delete from report_fee_month_statistics where fee_id in
  3117. <foreach collection="feeIds" item="item" open="(" close=")" separator=",">
  3118. #{item}
  3119. </foreach>
  3120. and community_id = #{communityId}
  3121. </update>
  3122. </mapper>