FeeReceiptDetailServiceDaoImplMapper.xml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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="feeReceiptDetailServiceDaoImpl">
  6. <!-- 保存收据明细信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveFeeReceiptDetailInfo" parameterType="Map">
  8. insert into fee_receipt_detail(
  9. area,amount,fee_name,detail_id,start_time,end_time,community_id,receipt_id,fee_id,cycle,square_price
  10. ) values (
  11. #{area},#{amount},#{feeName},#{detailId},#{startTime},#{endTime},#{communityId},#{receiptId},#{feeId},#{cycle},#{squarePrice}
  12. )
  13. </insert>
  14. <!-- 批量插入费用 -->
  15. <insert id="saveFeeReceiptDetails" parameterType="Map">
  16. insert into fee_receipt_detail(
  17. area,amount,fee_name,detail_id,start_time,end_time,community_id,receipt_id,fee_id,cycle,square_price )
  18. VALUES
  19. <foreach collection="feeReceiptDetailPos" item="item" separator=",">
  20. (#{item.area},#{item.amount},#{item.feeName},#{item.detailId},#{item.startTime},#{item.endTime},
  21. #{item.communityId},#{item.receiptId},#{item.feeId},#{item.cycle},#{item.squarePrice})
  22. </foreach>
  23. </insert>
  24. <!-- 查询收据明细信息 add by wuxw 2018-07-03 -->
  25. <select id="getFeeReceiptDetailInfo" parameterType="Map" resultType="Map">
  26. select t.area,t.amount,t.fee_name,t.fee_name feeName,t.detail_id,t.detail_id detailId,t.start_time,t.start_time
  27. startTime,t.status_cd,t.status_cd statusCd,t.end_time,t.end_time endTime,t.community_id,t.community_id
  28. communityId,t.receipt_id,t.receipt_id receiptId,t.fee_id,t.fee_id feeId,t.cycle,t.square_price squarePrice,
  29. pfd.remark,pf.fee_flag feeFlag,mw.pre_degrees preDegrees,mw.cur_degrees curDegrees,d.name primeRate
  30. from fee_receipt_detail t
  31. left join pay_fee_detail pfd on t.detail_id = pfd.detail_id and pfd.status_cd = '0' and t.community_id =
  32. pfd.community_id
  33. left join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' and t.community_id = pf.community_id
  34. LEFT JOIN meter_water mw on t.fee_id = mw.fee_id and mw.status_cd = '0' and t.community_id = mw.community_id
  35. left join t_dict d on pfd.prime_rate = d.status_cd and d.table_name="pay_fee_detail" and d.table_columns='prime_rate'
  36. where 1 =1
  37. <if test="area !=null and area != ''">
  38. and t.area= #{area}
  39. </if>
  40. <if test="amount !=null and amount != ''">
  41. and t.amount= #{amount}
  42. </if>
  43. <if test="feeName !=null and feeName != ''">
  44. and t.fee_name= #{feeName}
  45. </if>
  46. <if test="detailId !=null and detailId != ''">
  47. and t.detail_id= #{detailId}
  48. </if>
  49. <if test="detailIds !=null ">
  50. and t.detail_id in
  51. <foreach collection="detailIds" item="item" open="(" close=")" separator=",">
  52. #{item}
  53. </foreach>
  54. </if>
  55. <if test="startTime !=null and startTime != ''">
  56. and t.start_time= #{startTime}
  57. </if>
  58. <if test="statusCd !=null and statusCd != ''">
  59. and t.status_cd= #{statusCd}
  60. </if>
  61. <if test="endTime !=null and endTime != ''">
  62. and t.end_time= #{endTime}
  63. </if>
  64. <if test="communityId !=null and communityId != ''">
  65. and t.community_id= #{communityId}
  66. </if>
  67. <if test="receiptId !=null and receiptId != ''">
  68. and t.receipt_id= #{receiptId}
  69. </if>
  70. <if test="receiptIds !=null">
  71. and t.receipt_id in
  72. <foreach collection="receiptIds" item="item" open="(" close=")" separator=",">
  73. #{item}
  74. </foreach>
  75. </if>
  76. <if test="feeId !=null and feeId != ''">
  77. and t.fee_id= #{feeId}
  78. </if>
  79. <if test="cycle !=null and cycle != ''">
  80. and t.cycle= #{cycle}
  81. </if>
  82. order by t.create_time desc
  83. <if test="page != -1 and page != null ">
  84. limit #{page}, #{row}
  85. </if>
  86. </select>
  87. <!-- 修改收据明细信息 add by wuxw 2018-07-03 -->
  88. <update id="updateFeeReceiptDetailInfo" parameterType="Map">
  89. update fee_receipt_detail t set t.status_cd = #{statusCd}
  90. <if test="newBId != null and newBId != ''">
  91. ,t.b_id = #{newBId}
  92. </if>
  93. <if test="area !=null and area != ''">
  94. , t.area= #{area}
  95. </if>
  96. <if test="amount !=null and amount != ''">
  97. , t.amount= #{amount}
  98. </if>
  99. <if test="feeName !=null and feeName != ''">
  100. , t.fee_name= #{feeName}
  101. </if>
  102. <if test="detailId !=null and detailId != ''">
  103. , t.detail_id= #{detailId}
  104. </if>
  105. <if test="startTime !=null and startTime != ''">
  106. , t.start_time= #{startTime}
  107. </if>
  108. <if test="endTime !=null and endTime != ''">
  109. , t.end_time= #{endTime}
  110. </if>
  111. <if test="communityId !=null and communityId != ''">
  112. , t.community_id= #{communityId}
  113. </if>
  114. <if test="feeId !=null and feeId != ''">
  115. , t.fee_id= #{feeId}
  116. </if>
  117. <if test="cycle !=null and cycle != ''">
  118. , t.cycle= #{cycle}
  119. </if>
  120. where 1=1
  121. <if test="receiptId !=null and receiptId != ''">
  122. and t.receipt_id= #{receiptId}
  123. </if>
  124. </update>
  125. <!-- 查询收据明细数量 add by wuxw 2018-07-03 -->
  126. <select id="queryFeeReceiptDetailsCount" parameterType="Map" resultType="Map">
  127. select count(1) count
  128. from fee_receipt_detail t
  129. where 1 =1
  130. <if test="area !=null and area != ''">
  131. and t.area= #{area}
  132. </if>
  133. <if test="amount !=null and amount != ''">
  134. and t.amount= #{amount}
  135. </if>
  136. <if test="feeName !=null and feeName != ''">
  137. and t.fee_name= #{feeName}
  138. </if>
  139. <if test="detailId !=null and detailId != ''">
  140. and t.detail_id= #{detailId}
  141. </if>
  142. <if test="startTime !=null and startTime != ''">
  143. and t.start_time= #{startTime}
  144. </if>
  145. <if test="statusCd !=null and statusCd != ''">
  146. and t.status_cd= #{statusCd}
  147. </if>
  148. <if test="endTime !=null and endTime != ''">
  149. and t.end_time= #{endTime}
  150. </if>
  151. <if test="communityId !=null and communityId != ''">
  152. and t.community_id= #{communityId}
  153. </if>
  154. <if test="receiptId !=null and receiptId != ''">
  155. and t.receipt_id= #{receiptId}
  156. </if>
  157. <if test="receiptIds !=null">
  158. and t.receipt_id in
  159. <foreach collection="receiptIds" item="item" open="(" close=")" separator=",">
  160. #{item}
  161. </foreach>
  162. </if>
  163. <if test="detailIds !=null">
  164. and t.detail_id in
  165. <foreach collection="detailIds" item="item" open="(" close=")" separator=",">
  166. #{item}
  167. </foreach>
  168. </if>
  169. <if test="feeId !=null and feeId != ''">
  170. and t.fee_id= #{feeId}
  171. </if>
  172. <if test="cycle !=null and cycle != ''">
  173. and t.cycle= #{cycle}
  174. </if>
  175. </select>
  176. </mapper>