ReportFeeServiceDaoImplMapper.xml 4.0 KB

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