ReportFeeYearCollectionServiceDaoImplMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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="reportFeeYearCollectionServiceDaoImpl">
  6. <!-- 保存费用年收费信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveReportFeeYearCollectionInfo" parameterType="Map">
  8. insert into report_fee_year_collection(
  9. owner_link,obj_name,owner_id,fee_id,built_up_area,owner_name,config_id,obj_id,fee_name,community_id,collection_id,obj_type
  10. ) values (
  11. #{ownerLink},#{objName},#{ownerId},#{feeId},#{builtUpArea},#{ownerName},#{configId},#{objId},#{feeName},#{communityId},#{collectionId},#{objType}
  12. )
  13. </insert>
  14. <select id="getReportFeeYearCollectionInfos" parameterType="Map" resultType="Map">
  15. select t.owner_link,t.owner_link ownerLink,t.status_cd,t.status_cd statusCd,t.obj_name,t.obj_name
  16. objName,t.owner_id,t.owner_id ownerId,t.fee_id,t.fee_id feeId,t.built_up_area,t.built_up_area
  17. builtUpArea,t.owner_name,t.owner_name ownerName,t.config_id,t.config_id configId,t.obj_id,t.obj_id
  18. objId,t.fee_name,t.fee_name feeName,t.community_id,t.community_id communityId,t.collection_id,t.collection_id
  19. collectionId,t.obj_type,t.obj_type objType,rd.collection_year collectionYear,rd.receivable_amount receivableAmount,
  20. rd.relation_year relationYear,rd.received_amount receivedAmount,pfc.fee_type_cd feeTypeCd,td.name feeTypeCdName
  21. from report_fee_year_collection t
  22. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
  23. left join report_fee_year_collection_detail rd on t.collection_id = rd.collection_id and rd.status_cd = '0' and rd.community_id = t.community_id
  24. left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  25. left join t_dict td on td.status_cd = pfc.fee_type_cd and td.table_name = 'pay_fee_config' and td.table_columns = 'fee_type_cd'
  26. where 1 = 1 and rd.receivable_amount >= 0 and rd.received_amount >= 0
  27. <if test="ownerLink !=null and ownerLink != ''">
  28. and t.owner_link= #{ownerLink}
  29. </if>
  30. <if test="statusCd !=null and statusCd != ''">
  31. and t.status_cd= #{statusCd}
  32. </if>
  33. <if test="objName !=null and objName != ''">
  34. and t.obj_name= #{objName}
  35. </if>
  36. <if test="ownerId !=null and ownerId != ''">
  37. and t.owner_id= #{ownerId}
  38. </if>
  39. <if test="feeId !=null and feeId != ''">
  40. and t.fee_id= #{feeId}
  41. </if>
  42. <if test="builtUpArea !=null and builtUpArea != ''">
  43. and t.built_up_area= #{builtUpArea}
  44. </if>
  45. <if test="ownerName !=null and ownerName != ''">
  46. and t.owner_name= #{ownerName}
  47. </if>
  48. <if test="configId !=null and configId != ''">
  49. and t.config_id= #{configId}
  50. </if>
  51. <if test="objId !=null and objId != ''">
  52. and t.obj_id= #{objId}
  53. </if>
  54. <if test="feeName !=null and feeName != ''">
  55. and t.fee_name= #{feeName}
  56. </if>
  57. <if test="communityId !=null and communityId != ''">
  58. and t.community_id= #{communityId}
  59. </if>
  60. <if test="collectionId !=null and collectionId != ''">
  61. and t.collection_id= #{collectionId}
  62. </if>
  63. <if test="objType !=null and objType != ''">
  64. and t.obj_type= #{objType}
  65. </if>
  66. <if test="feeTypeCd !=null and feeTypeCd != ''">
  67. and pfc.fee_type_cd= #{feeTypeCd}
  68. </if>
  69. order by rd.relation_year
  70. </select>
  71. <!-- 查询费用年收费信息 add by wuxw 2018-07-03 -->
  72. <select id="getReportFeeYearCollectionInfo" parameterType="Map" resultType="Map">
  73. select DISTINCT t.owner_link,t.owner_link ownerLink,t.status_cd,t.status_cd statusCd,t.obj_name,t.obj_name
  74. objName,t.owner_id,t.owner_id ownerId,t.fee_id,t.fee_id feeId,t.built_up_area,t.built_up_area
  75. builtUpArea,t.owner_name,t.owner_name ownerName,t.config_id,t.config_id configId,t.obj_id,t.obj_id
  76. objId,t.fee_name,t.fee_name feeName,t.community_id,t.community_id communityId,t.collection_id,t.collection_id
  77. collectionId,t.obj_type,t.obj_type objType,pfc.fee_type_cd feeTypeCd,td.name feeTypeCdName,t.create_time
  78. from report_fee_year_collection t
  79. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
  80. left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  81. left join t_dict td on td.status_cd = pfc.fee_type_cd and td.table_name = 'pay_fee_config' and td.table_columns = 'fee_type_cd'
  82. left join report_fee_year_collection_detail rd on t.collection_id = rd.collection_id and rd.status_cd = '0' and rd.community_id = t.community_id
  83. where 1 = 1 and rd.receivable_amount >= 0 and rd.received_amount >= 0
  84. <if test="ownerLink !=null and ownerLink != ''">
  85. and t.owner_link= #{ownerLink}
  86. </if>
  87. <if test="statusCd !=null and statusCd != ''">
  88. and t.status_cd= #{statusCd}
  89. </if>
  90. <if test="objName !=null and objName != ''">
  91. and t.obj_name= #{objName}
  92. </if>
  93. <if test="ownerId !=null and ownerId != ''">
  94. and t.owner_id= #{ownerId}
  95. </if>
  96. <if test="feeId !=null and feeId != ''">
  97. and t.fee_id= #{feeId}
  98. </if>
  99. <if test="builtUpArea !=null and builtUpArea != ''">
  100. and t.built_up_area= #{builtUpArea}
  101. </if>
  102. <if test="ownerName !=null and ownerName != ''">
  103. and t.owner_name= #{ownerName}
  104. </if>
  105. <if test="configId !=null and configId != ''">
  106. and t.config_id= #{configId}
  107. </if>
  108. <if test="objId !=null and objId != ''">
  109. and t.obj_id= #{objId}
  110. </if>
  111. <if test="feeName !=null and feeName != ''">
  112. and t.fee_name= #{feeName}
  113. </if>
  114. <if test="communityId !=null and communityId != ''">
  115. and t.community_id= #{communityId}
  116. </if>
  117. <if test="collectionId !=null and collectionId != ''">
  118. and t.collection_id= #{collectionId}
  119. </if>
  120. <if test="objType !=null and objType != ''">
  121. and t.obj_type= #{objType}
  122. </if>
  123. <if test="feeTypeCd !=null and feeTypeCd != ''">
  124. and pfc.fee_type_cd= #{feeTypeCd}
  125. </if>
  126. order by t.create_time desc
  127. <if test="page != -1 and page != null ">
  128. limit #{page}, #{row}
  129. </if>
  130. </select>
  131. <!-- 修改费用年收费信息 add by wuxw 2018-07-03 -->
  132. <update id="updateReportFeeYearCollectionInfo" parameterType="Map">
  133. update report_fee_year_collection t set t.status_cd = #{statusCd}
  134. <if test="newBId != null and newBId != ''">
  135. ,t.b_id = #{newBId}
  136. </if>
  137. <if test="ownerLink !=null and ownerLink != ''">
  138. , t.owner_link= #{ownerLink}
  139. </if>
  140. <if test="objName !=null and objName != ''">
  141. , t.obj_name= #{objName}
  142. </if>
  143. <if test="ownerId !=null and ownerId != ''">
  144. , t.owner_id= #{ownerId}
  145. </if>
  146. <if test="feeId !=null and feeId != ''">
  147. , t.fee_id= #{feeId}
  148. </if>
  149. <if test="builtUpArea !=null and builtUpArea != ''">
  150. , t.built_up_area= #{builtUpArea}
  151. </if>
  152. <if test="ownerName !=null and ownerName != ''">
  153. , t.owner_name= #{ownerName}
  154. </if>
  155. <if test="configId !=null and configId != ''">
  156. , t.config_id= #{configId}
  157. </if>
  158. <if test="objId !=null and objId != ''">
  159. , t.obj_id= #{objId}
  160. </if>
  161. <if test="feeName !=null and feeName != ''">
  162. , t.fee_name= #{feeName}
  163. </if>
  164. <if test="communityId !=null and communityId != ''">
  165. , t.community_id= #{communityId}
  166. </if>
  167. <if test="objType !=null and objType != ''">
  168. , t.obj_type= #{objType}
  169. </if>
  170. where 1=1
  171. <if test="collectionId !=null and collectionId != ''">
  172. and t.collection_id= #{collectionId}
  173. </if>
  174. </update>
  175. <update id="deleteReportFeeYearCollectionInfo" parameterType="Map">
  176. update report_fee_year_collection t set t.status_cd = '1'
  177. where 1=1
  178. <if test="feeId !=null and feeId != ''">
  179. and t.fee_id= #{feeId}
  180. </if>
  181. <if test="communityId !=null and communityId != ''">
  182. and t.community_id= #{communityId}
  183. </if>
  184. <if test="collectionId !=null and collectionId != ''">
  185. and t.collection_id= #{collectionId}
  186. </if>
  187. </update>
  188. <!-- 查询费用年收费数量 add by wuxw 2018-07-03 -->
  189. <select id="queryReportFeeYearCollectionsCount" parameterType="Map" resultType="Map">
  190. select count(DISTINCT t.collection_id) count
  191. from report_fee_year_collection t
  192. inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
  193. left join report_fee_year_collection_detail rd on t.collection_id = rd.collection_id and rd.status_cd = '0' and rd.community_id = t.community_id
  194. left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
  195. where 1 = 1 and rd.receivable_amount >= 0 and rd.received_amount >= 0
  196. <if test="ownerLink !=null and ownerLink != ''">
  197. and t.owner_link= #{ownerLink}
  198. </if>
  199. <if test="statusCd !=null and statusCd != ''">
  200. and t.status_cd= #{statusCd}
  201. </if>
  202. <if test="objName !=null and objName != ''">
  203. and t.obj_name= #{objName}
  204. </if>
  205. <if test="ownerId !=null and ownerId != ''">
  206. and t.owner_id= #{ownerId}
  207. </if>
  208. <if test="feeId !=null and feeId != ''">
  209. and t.fee_id= #{feeId}
  210. </if>
  211. <if test="builtUpArea !=null and builtUpArea != ''">
  212. and t.built_up_area= #{builtUpArea}
  213. </if>
  214. <if test="ownerName !=null and ownerName != ''">
  215. and t.owner_name= #{ownerName}
  216. </if>
  217. <if test="configId !=null and configId != ''">
  218. and t.config_id= #{configId}
  219. </if>
  220. <if test="objId !=null and objId != ''">
  221. and t.obj_id= #{objId}
  222. </if>
  223. <if test="feeName !=null and feeName != ''">
  224. and t.fee_name= #{feeName}
  225. </if>
  226. <if test="communityId !=null and communityId != ''">
  227. and t.community_id= #{communityId}
  228. </if>
  229. <if test="collectionId !=null and collectionId != ''">
  230. and t.collection_id= #{collectionId}
  231. </if>
  232. <if test="objType !=null and objType != ''">
  233. and t.obj_type= #{objType}
  234. </if>
  235. </select>
  236. </mapper>