ImportFeeDetailServiceDaoImplMapper.xml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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="importFeeDetailServiceDaoImpl">
  6. <!-- 保存费用导入明细信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveImportFeeDetailInfo" parameterType="Map">
  8. insert into import_fee_detail(
  9. amount,unit_num,fee_id,floor_num,room_id,room_num,ifd_id,fee_name,start_time,
  10. end_time,state,community_id,import_fee_id,remark
  11. ) values (
  12. #{amount},#{unitNum},#{feeId},#{floorNum},#{roomId},#{roomNum},#{ifdId},#{feeName},#{startTime},
  13. #{endTime},#{state},#{communityId},#{importFeeId},#{remark}
  14. )
  15. </insert>
  16. <!-- 查询费用导入明细信息 add by wuxw 2018-07-03 -->
  17. <select id="getImportFeeDetailInfo" parameterType="Map" resultType="Map">
  18. select t.amount,t.unit_num,t.unit_num unitNum,t.status_cd,t.status_cd statusCd,t.fee_id,t.fee_id
  19. feeId,t.floor_num,t.floor_num floorNum,t.room_id,t.room_id roomId,t.room_num,t.room_num
  20. roomNum,t.ifd_id,t.ifd_id ifdId,t.fee_name,t.fee_name feeName,t.start_time,t.start_time
  21. startTime,t.end_time,t.end_time endTime,t.state,t.community_id,t.community_id communityId,
  22. t.remark
  23. from import_fee_detail t
  24. where 1 =1
  25. <if test="amount !=null and amount != ''">
  26. and t.amount= #{amount}
  27. </if>
  28. <if test="unitNum !=null and unitNum != ''">
  29. and t.unit_num= #{unitNum}
  30. </if>
  31. <if test="statusCd !=null and statusCd != ''">
  32. and t.status_cd= #{statusCd}
  33. </if>
  34. <if test="feeId !=null and feeId != ''">
  35. and t.fee_id= #{feeId}
  36. </if>
  37. <if test="floorNum !=null and floorNum != ''">
  38. and t.floor_num= #{floorNum}
  39. </if>
  40. <if test="roomId !=null and roomId != ''">
  41. and t.room_id= #{roomId}
  42. </if>
  43. <if test="roomNum !=null and roomNum != ''">
  44. and t.room_num= #{roomNum}
  45. </if>
  46. <if test="ifdId !=null and ifdId != ''">
  47. and t.ifd_id= #{ifdId}
  48. </if>
  49. <if test="feeName !=null and feeName != ''">
  50. and t.fee_name= #{feeName}
  51. </if>
  52. <if test="startTime !=null and startTime != ''">
  53. and t.start_time= #{startTime}
  54. </if>
  55. <if test="endTime !=null and endTime != ''">
  56. and t.end_time= #{endTime}
  57. </if>
  58. <if test="state !=null and state != ''">
  59. and t.state= #{state}
  60. </if>
  61. <if test="communityId !=null and communityId != ''">
  62. and t.community_id= #{communityId}
  63. </if>
  64. <if test="importFeeId !=null and importFeeId != ''">
  65. and t.import_fee_id= #{importFeeId}
  66. </if>
  67. order by t.create_time desc
  68. <if test="page != -1 and page != null ">
  69. limit #{page}, #{row}
  70. </if>
  71. </select>
  72. <!-- 修改费用导入明细信息 add by wuxw 2018-07-03 -->
  73. <update id="updateImportFeeDetailInfo" parameterType="Map">
  74. update import_fee_detail t set t.status_cd = #{statusCd}
  75. <if test="newBId != null and newBId != ''">
  76. ,t.b_id = #{newBId}
  77. </if>
  78. <if test="amount !=null and amount != ''">
  79. , t.amount= #{amount}
  80. </if>
  81. <if test="unitNum !=null and unitNum != ''">
  82. , t.unit_num= #{unitNum}
  83. </if>
  84. <if test="feeId !=null and feeId != ''">
  85. , t.fee_id= #{feeId}
  86. </if>
  87. <if test="floorNum !=null and floorNum != ''">
  88. , t.floor_num= #{floorNum}
  89. </if>
  90. <if test="roomId !=null and roomId != ''">
  91. , t.room_id= #{roomId}
  92. </if>
  93. <if test="roomNum !=null and roomNum != ''">
  94. , t.room_num= #{roomNum}
  95. </if>
  96. <if test="feeName !=null and feeName != ''">
  97. , t.fee_name= #{feeName}
  98. </if>
  99. <if test="startTime !=null and startTime != ''">
  100. , t.start_time= #{startTime}
  101. </if>
  102. <if test="endTime !=null and endTime != ''">
  103. , t.end_time= #{endTime}
  104. </if>
  105. <if test="state !=null and state != ''">
  106. , t.state= #{state}
  107. </if>
  108. <if test="communityId !=null and communityId != ''">
  109. , t.community_id= #{communityId}
  110. </if>
  111. where 1=1
  112. <if test="ifdId !=null and ifdId != ''">
  113. and t.ifd_id= #{ifdId}
  114. </if>
  115. </update>
  116. <!-- 查询费用导入明细数量 add by wuxw 2018-07-03 -->
  117. <select id="queryImportFeeDetailsCount" parameterType="Map" resultType="Map">
  118. select count(1) count
  119. from import_fee_detail t
  120. where 1 =1
  121. <if test="amount !=null and amount != ''">
  122. and t.amount= #{amount}
  123. </if>
  124. <if test="unitNum !=null and unitNum != ''">
  125. and t.unit_num= #{unitNum}
  126. </if>
  127. <if test="statusCd !=null and statusCd != ''">
  128. and t.status_cd= #{statusCd}
  129. </if>
  130. <if test="feeId !=null and feeId != ''">
  131. and t.fee_id= #{feeId}
  132. </if>
  133. <if test="floorNum !=null and floorNum != ''">
  134. and t.floor_num= #{floorNum}
  135. </if>
  136. <if test="roomId !=null and roomId != ''">
  137. and t.room_id= #{roomId}
  138. </if>
  139. <if test="roomNum !=null and roomNum != ''">
  140. and t.room_num= #{roomNum}
  141. </if>
  142. <if test="ifdId !=null and ifdId != ''">
  143. and t.ifd_id= #{ifdId}
  144. </if>
  145. <if test="feeName !=null and feeName != ''">
  146. and t.fee_name= #{feeName}
  147. </if>
  148. <if test="startTime !=null and startTime != ''">
  149. and t.start_time= #{startTime}
  150. </if>
  151. <if test="endTime !=null and endTime != ''">
  152. and t.end_time= #{endTime}
  153. </if>
  154. <if test="state !=null and state != ''">
  155. and t.state= #{state}
  156. </if>
  157. <if test="communityId !=null and communityId != ''">
  158. and t.community_id= #{communityId}
  159. </if>
  160. <if test="importFeeId !=null and importFeeId != ''">
  161. and t.import_fee_id= #{importFeeId}
  162. </if>
  163. </select>
  164. <!-- 批量插入费用 -->
  165. <insert id="saveImportFeeDetails" parameterType="Map">
  166. insert into import_fee_detail(
  167. amount,unit_num,fee_id,floor_num,room_id,room_num,ifd_id,fee_name,start_time,
  168. end_time,state,community_id,import_fee_id,remark
  169. ) values
  170. <foreach collection="importFeeDetailPos" item="item" separator=",">
  171. (#{item.amount},#{item.unitNum},#{item.feeId},#{item.floorNum},#{item.roomId},#{item.roomNum},#{item.ifdId},#{item.feeName},
  172. #{item.startTime},#{item.endTime},#{item.state},#{item.communityId},#{item.importFeeId},#{item.remark})
  173. </foreach>
  174. </insert>
  175. </mapper>