PayFeeAuditServiceDaoImplMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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
  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 not in ('1000','1100','1200','1300')
  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="state !=null and state != ''">
  37. and (pfa.state is null
  38. or pfa.state = #{state})
  39. </if>
  40. ORDER BY pfd.create_time desc
  41. <if test="page != -1 and page != null ">
  42. limit #{page}, #{row}
  43. </if>
  44. </select>
  45. <!-- 修改缴费审核信息 add by wuxw 2018-07-03 -->
  46. <update id="updatePayFeeAuditInfo" parameterType="Map">
  47. update pay_fee_audit t set t.status_cd = #{statusCd}
  48. <if test="newBId != null and newBId != ''">
  49. ,t.b_id = #{newBId}
  50. </if>
  51. <if test="auditUserId !=null and auditUserId != ''">
  52. , t.audit_user_id= #{auditUserId}
  53. </if>
  54. <if test="auditUserName !=null and auditUserName != ''">
  55. , t.audit_user_name= #{auditUserName}
  56. </if>
  57. <if test="feeDetailId !=null and feeDetailId != ''">
  58. , t.fee_detail_id= #{feeDetailId}
  59. </if>
  60. <if test="state !=null and state != ''">
  61. , t.state= #{state}
  62. </if>
  63. <if test="message !=null and message != ''">
  64. , t.message= #{message}
  65. </if>
  66. <if test="communityId !=null and communityId != ''">
  67. , t.community_id= #{communityId}
  68. </if>
  69. <if test="feeId !=null and feeId != ''">
  70. , t.fee_id= #{feeId}
  71. </if>
  72. where 1=1
  73. <if test="auditId !=null and auditId != ''">
  74. and t.audit_id= #{auditId}
  75. </if>
  76. </update>
  77. <!-- 查询缴费审核数量 add by wuxw 2018-07-03 -->
  78. <select id="queryPayFeeAuditsCount" parameterType="Map" resultType="Map">
  79. select count(1) count
  80. from pay_fee_detail pfd
  81. INNER JOIN pay_fee pf on pf.fee_id = pfd.fee_id and pf.community_id = pfd.community_id and pf.status_cd = '0'
  82. 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'
  83. 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'
  84. where 1=1
  85. and pfd.community_id = #{communityId}
  86. and pfd.status_cd = '0'
  87. <if test="roomId !=null and roomId != ''">
  88. and pf.payer_obj_id = #{roomId}
  89. and pf.payer_obj_type = '3333'
  90. </if>
  91. <if test="carId !=null and carId != ''">
  92. and pf.payer_obj_id = #{carId}
  93. and pf.payer_obj_type = '6666'
  94. </if>
  95. <if test="state !=null and state != ''">
  96. and (pfa.state is null
  97. or pfa.state = #{state})
  98. </if>
  99. </select>
  100. </mapper>