PayFeeAuditServiceDaoImplMapper.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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="payFeeAuditServiceDaoImpl">
  6. <!-- 保存缴费审核信息 add by wuxw 2018-07-03 -->
  7. <insert id="savePayFeeAuditInfo" parameterType="Map">
  8. insert into pay_fee_audit(
  9. audit_user_id,audit_user_name,fee_detail_id,state,message,community_id,fee_id,audit_id
  10. ) values (
  11. #{auditUserId},#{auditUserName},#{feeDetailId},#{state},#{message},#{communityId},#{feeId},#{auditId}
  12. )
  13. </insert>
  14. <!-- 查询缴费审核信息 add by wuxw 2018-07-03 -->
  15. <select id="getPayFeeAuditInfo" parameterType="Map" resultType="Map">
  16. select pf.payer_obj_id payerObjId,pf.payer_obj_type payerObjType,pfc.fee_name feeName,
  17. pfd.cycles,pfd.start_time startTime,pfd.end_time endTime,pfd.receivable_amount receivableAmount,
  18. pfd.received_amount receivedAmount,pfd.create_time createTime,pfa.state,pfa.message,pfd.remark,
  19. pfa.audit_user_name auditUserName,pfd.b_id bId,pf.fee_id feeId,pf.community_id communityId,pfd.detail_id detailId
  20. from pay_fee_detail pfd
  21. INNER JOIN pay_fee pf on pf.fee_id = pfd.fee_id and pf.community_id = pfd.community_id and pf.status_cd = '0'
  22. inner join pay_fee_config pfc on pf.config_id = pfc.config_id and pf.community_id = pfc.community_id and pfc.status_cd = '0'
  23. left join pay_fee_audit pfa on pf.fee_id = pfa.fee_id and pfd.detail_id = pfa.fee_detail_id and pfa.status_cd = '0'
  24. where 1=1
  25. and pfd.community_id = #{communityId}
  26. and pfd.status_cd = '0'
  27. and pfd.state = '1400'
  28. <if test="roomId !=null and roomId != ''">
  29. and pf.payer_obj_id = #{roomId}
  30. and pf.payer_obj_type = '3333'
  31. </if>
  32. <if test="carId !=null and carId != ''">
  33. and pf.payer_obj_id = #{carId}
  34. and pf.payer_obj_type = '6666'
  35. </if>
  36. <if test="payerObjId !=null and payerObjId != ''">
  37. and pf.payer_obj_id = #{payerObjId}
  38. </if>
  39. <if test="payerObjType !=null and payerObjType != ''">
  40. and pf.payer_obj_type = #{payerObjType}
  41. </if>
  42. <if test="state !=null and state != '1010'">
  43. and pfa.state = #{state}
  44. </if>
  45. <if test="state !=null and state == '1010'">
  46. and pfa.state is null
  47. </if>
  48. ORDER BY pfd.create_time desc
  49. <if test="page != -1 and page != null ">
  50. limit #{page}, #{row}
  51. </if>
  52. </select>
  53. <!-- 修改缴费审核信息 add by wuxw 2018-07-03 -->
  54. <update id="updatePayFeeAuditInfo" parameterType="Map">
  55. update pay_fee_audit t set t.status_cd = #{statusCd}
  56. <if test="newBId != null and newBId != ''">
  57. ,t.b_id = #{newBId}
  58. </if>
  59. <if test="auditUserId !=null and auditUserId != ''">
  60. , t.audit_user_id= #{auditUserId}
  61. </if>
  62. <if test="auditUserName !=null and auditUserName != ''">
  63. , t.audit_user_name= #{auditUserName}
  64. </if>
  65. <if test="feeDetailId !=null and feeDetailId != ''">
  66. , t.fee_detail_id= #{feeDetailId}
  67. </if>
  68. <if test="state !=null and state != ''">
  69. , t.state= #{state}
  70. </if>
  71. <if test="message !=null and message != ''">
  72. , t.message= #{message}
  73. </if>
  74. <if test="communityId !=null and communityId != ''">
  75. , t.community_id= #{communityId}
  76. </if>
  77. <if test="feeId !=null and feeId != ''">
  78. , t.fee_id= #{feeId}
  79. </if>
  80. where 1=1
  81. <if test="auditId !=null and auditId != ''">
  82. and t.audit_id= #{auditId}
  83. </if>
  84. </update>
  85. <!-- 查询缴费审核数量 add by wuxw 2018-07-03 -->
  86. <select id="queryPayFeeAuditsCount" parameterType="Map" resultType="Map">
  87. select count(1) count
  88. from pay_fee_detail pfd
  89. INNER JOIN pay_fee pf on pf.fee_id = pfd.fee_id and pf.community_id = pfd.community_id and pf.status_cd = '0'
  90. inner join pay_fee_config pfc on pf.config_id = pfc.config_id and pf.community_id = pfc.community_id and pfc.status_cd = '0'
  91. left join pay_fee_audit pfa on pf.fee_id = pfa.fee_id and pfd.detail_id = pfa.fee_detail_id and pfa.status_cd = '0'
  92. where 1=1
  93. and pfd.community_id = #{communityId}
  94. and pfd.status_cd = '0'
  95. and pfd.state = '1400'
  96. <if test="roomId !=null and roomId != ''">
  97. and pf.payer_obj_id = #{roomId}
  98. and pf.payer_obj_type = '3333'
  99. </if>
  100. <if test="carId !=null and carId != ''">
  101. and pf.payer_obj_id = #{carId}
  102. and pf.payer_obj_type = '6666'
  103. </if>
  104. <if test="payerObjId !=null and payerObjId != ''">
  105. and pf.payer_obj_id = #{payerObjId}
  106. </if>
  107. <if test="payerObjType !=null and payerObjType != ''">
  108. and pf.payer_obj_type = #{payerObjType}
  109. </if>
  110. <if test="state !=null and state != '1010'">
  111. and pfa.state = #{state}
  112. </if>
  113. <if test="state !=null and state == '1010'">
  114. and pfa.state is null
  115. </if>
  116. </select>
  117. </mapper>