ReportFeeServiceDaoImplMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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="reportFeeServiceDaoImpl">
  6. <!-- 查询实收金额 -->
  7. <select id="getFeeReceivedAmount" parameterType="com.java110.dto.report.ReportFeeDetailDto" resultType="Map">
  8. select SUM(t.received_amount) receivedAmount
  9. from pay_fee_detail t
  10. <if test="configId != null and configId != ''">
  11. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
  12. </if>
  13. where 1=1
  14. <if test="configId != null and configId != ''">
  15. and pf.config_id = #{configId}
  16. and pf.payer_obj_id = #{payerObjId}
  17. </if>
  18. <if test="feeId !=null and feeId != ''">
  19. and t.fee_id = #{feeId}
  20. </if>
  21. <if test="startTime != null">
  22. and t.create_time &gt; #{startTime}
  23. </if>
  24. <if test="endTime != null">
  25. and t.create_time &lt; #{endTime}
  26. </if>
  27. <if test="curStartYear != null and curStartYear != ''">
  28. and DATE_FORMAT(t.start_time,'%Y') = #{curStartYear}
  29. </if>
  30. <if test="curEndYear != null and curEndYear != ''">
  31. and DATE_FORMAT(DATE_SUB(t.end_time,INTERVAL 1 DAY),'%Y') = #{curEndYear}
  32. </if>
  33. </select>
  34. <!-- 查询房屋个数 add by wuxw 2018-07-03 -->
  35. <select id="getFeeCount" parameterType="com.java110.dto.report.ReportFeeDto" resultType="Map">
  36. select count(1) count
  37. from pay_fee t
  38. where t.status_cd = '0'
  39. <if test="payerObjId !=null and payerObjId != ''">
  40. and t.payer_obj_id = #{payerObjId}
  41. </if>
  42. <if test="payerObjType !=null and payerObjType != ''">
  43. and t.payer_obj_type= #{payerObjType}
  44. </if>
  45. </select>
  46. <!-- 查询 费用 -->
  47. <select id="getFees" parameterType="com.java110.dto.report.ReportFeeDto"
  48. resultType="com.java110.dto.report.ReportFeeDto">
  49. select pfc.fee_name feeName,pfc.start_time configStartTime,pfc.end_time configEndTime,pfc.config_id
  50. configId,pfc.fee_type_cd feeTypeCd,
  51. pfc.additional_amount additionalAmount,pfc.bill_type billType,pfc.computing_formula
  52. computingFormula,pfc.computing_formula_text computingFormulaText,
  53. pfc.payment_cd paymentCd,
  54. pfc.payment_cycle paymentCycle,pfc.square_price squarePrice,pfc.fee_flag feeFlag,t.payer_obj_id
  55. payerObjId,t.payer_obj_type payerObjType,
  56. t.amount,t.create_time createTime,t.end_time endTime,t.fee_id feeId,t.income_obj_id incomeObjId,t.start_time
  57. startTime,t.state,
  58. br.room_id roomId,br.room_num roomNum,oc.car_num carNum,ss.store_id storeId,ss.`name` storeName,ss.store_type_cd
  59. storeTypeCd,
  60. t.community_id communityId,pfa.value importFeeName,ifd.end_time importFeeEndTime,mw.cur_degrees
  61. curDegrees,mw.pre_degrees preDegrees,
  62. mw.pre_reading_time preReadingTime,mw.cur_reading_time curReadingTime
  63. from pay_fee t
  64. INNER JOIN pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  65. left join building_room br on t.payer_obj_id = br.room_id and t.payer_obj_type = '3333' and br.status_cd = '0'
  66. left join owner_car oc on t.payer_obj_id = oc.car_id and t.payer_obj_type = '6666' and oc.status_cd = '0' and
  67. oc.car_type_cd='1001'
  68. left join s_store ss on t.income_obj_id = ss.store_id and ss.status_cd = '0'
  69. LEFT JOIN pay_fee_attrs pfa on t.fee_id = pfa.fee_id and pfa.spec_cd = '390002' and pfa.status_cd = '0'
  70. left join import_fee_detail ifd on t.fee_id = ifd.fee_id and ifd.status_cd = '0' and t.fee_flag = '2006012'
  71. LEFT JOIN meter_water mw on t.fee_id = mw.fee_id and mw.status_cd = '0' and mw.community_id = t.community_id
  72. where t.status_cd = '0'
  73. <if test="state !=null and state != ''">
  74. and t.state= #{state}
  75. </if>
  76. <if test="payerObjId !=null and payerObjId != ''">
  77. and t.payer_obj_id= #{payerObjId}
  78. </if>
  79. <if test="payerObjType !=null and payerObjType != ''">
  80. and t.payer_obj_type= #{payerObjType}
  81. </if>
  82. <if test="communityId !=null and communityId != ''">
  83. and t.community_id= #{communityId}
  84. </if>
  85. <if test="feeFlag !=null and feeFlag != ''">
  86. and t.fee_flag= #{feeFlag}
  87. </if>
  88. <if test="page != -1 and page != null ">
  89. limit #{page}, #{row}
  90. </if>
  91. </select>
  92. </mapper>