ReportFeeServiceDaoImplMapper.xml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. </select>
  18. <!-- 查询房屋个数 add by wuxw 2018-07-03 -->
  19. <select id="getFeeCount" parameterType="com.java110.dto.report.ReportFeeDto" resultType="Map">
  20. select count(1) count
  21. from pay_fee t
  22. where t.status_cd = '0'
  23. <if test="payerObjId !=null and payerObjId != ''">
  24. and t.payer_obj_id = #{payerObjId}
  25. </if>
  26. <if test="payerObjType !=null and payerObjType != ''">
  27. and t.payer_obj_type= #{payerObjType}
  28. </if>
  29. </select>
  30. <!-- 查询 费用 -->
  31. <select id="getFees" parameterType="com.java110.dto.report.ReportFeeDto"
  32. resultType="com.java110.dto.report.ReportFeeDto">
  33. select pfc.fee_name,pfc.start_time configStartTime,pfc.end_time configEndTime,pfc.config_id configId,pfc.fee_type_cd feeTypeCd,
  34. pfc.additional_amount additionalAmount,pfc.bill_type billType,pfc.computing_formula computingFormula,pfc.payment_cd paymentCd,
  35. pfc.payment_cycle paymentCycle,pfc.square_price squarePrice,pfc.fee_flag feeFlag,t.payer_obj_id payerObjId,t.payer_obj_type payerObjType,
  36. 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,
  37. br.room_id roomId,br.room_num roomNum,oc.car_num carNum,ss.store_id storeId,ss.`name` storeName,ss.store_type_cd storeTypeCd
  38. from pay_fee t
  39. INNER JOIN pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  40. left join building_room br on t.payer_obj_id = br.room_id and t.payer_obj_type = '3333' and br.status_cd = '0'
  41. left join owner_car oc on t.payer_obj_id = oc.car_id and t.payer_obj_type = '6666' and oc.status_cd = '0'
  42. left join s_store ss on t.income_obj_id = ss.store_id and ss.status_cd = '0'
  43. where t.status_cd = '0'
  44. <if test="state !=null and state != ''">
  45. and t.state= #{state}
  46. </if>
  47. <if test="payerObjId !=null and payerObjId != ''">
  48. and t.payer_obj_id= #{payerObjId}
  49. </if>
  50. <if test="payerObjType !=null and payerObjType != ''">
  51. and t.payer_obj_type= #{payerObjType}
  52. </if>
  53. <if test="communityId !=null and communityId != ''">
  54. and t.community_id= #{communityId}
  55. </if>
  56. <if test="page != -1 and page != null ">
  57. limit #{page}, #{row}
  58. </if>
  59. </select>
  60. </mapper>