RentingPoolServiceDaoImplMapper.xml 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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="rentingPoolServiceDaoImpl">
  6. <!-- 保存房屋出租信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveRentingPoolInfo" parameterType="Map">
  8. insert into renting_pool(
  9. latitude,owner_tel,renting_config_id,renting_desc,renting_title,check_in,renting_id,room_id,payment_type,owner_name,
  10. price,state,community_id,longitude,community_name
  11. ) values (
  12. #{latitude},#{ownerTel},#{rentingConfigId},#{rentingDesc},#{rentingTitle},#{checkIn},#{rentingId},#{roomId},
  13. #{paymentType},#{ownerName},#{price},#{state},#{communityId},#{longitude},#{communityName}
  14. )
  15. </insert>
  16. <!-- 查询房屋出租信息 add by wuxw 2018-07-03 -->
  17. <select id="getRentingPoolInfo" parameterType="Map" resultType="Map">
  18. select t.latitude,t.owner_tel,t.owner_tel ownerTel,t.renting_config_id,t.renting_config_id
  19. rentingConfigId,t.renting_desc,t.renting_desc rentingDesc,t.status_cd,t.status_cd
  20. statusCd,t.renting_title,t.renting_title rentingTitle,t.check_in,t.check_in
  21. checkIn,t.renting_id,t.renting_id rentingId,t.room_id,t.room_id roomId,t.payment_type,t.payment_type
  22. paymentType,t.owner_name,t.owner_name ownerName,t.price,t.state,t.community_id,t.community_id
  23. communityId,t.longitude,td.name stateName,td2.name paymentTypeName,rc.renting_type rentingType,
  24. rc.service_owner_rate serviceOwnerRate,rc.service_tenant_rate serviceTenantRate,rc.admin_separate_rate adminSeparateRate,
  25. rc.proxy_separate_rate proxySeparateRate,rc.property_separate_rate propertySeparateRate,rc.service_price servicePrice,rc.renting_formula rentingFormula,
  26. t.community_name communityName
  27. from renting_pool t
  28. left join t_dict td on td.status_cd = t.state and td.table_name = 'renting_pool' and td.table_columns = 'state'
  29. left join t_dict td2 on td2.status_cd = t.payment_type and td2.table_name = 'renting_pool' and td2.table_columns = 'payment_type'
  30. left join renting_config rc on t.renting_config_id = rc.renting_config_id and rc.status_cd = '0'
  31. where 1 =1
  32. <if test="latitude !=null and latitude != ''">
  33. and t.latitude= #{latitude}
  34. </if>
  35. <if test="ownerTel !=null and ownerTel != ''">
  36. and t.owner_tel= #{ownerTel}
  37. </if>
  38. <if test="rentingConfigId !=null and rentingConfigId != ''">
  39. and t.renting_config_id= #{rentingConfigId}
  40. </if>
  41. <if test="rentingDesc !=null and rentingDesc != ''">
  42. and t.renting_desc= #{rentingDesc}
  43. </if>
  44. <if test="statusCd !=null and statusCd != ''">
  45. and t.status_cd= #{statusCd}
  46. </if>
  47. <if test="rentingTitle !=null and rentingTitle != ''">
  48. and t.renting_title= #{rentingTitle}
  49. </if>
  50. <if test="checkIn !=null and checkIn != ''">
  51. and t.check_in= #{checkIn}
  52. </if>
  53. <if test="rentingId !=null and rentingId != ''">
  54. and t.renting_id= #{rentingId}
  55. </if>
  56. <if test="roomId !=null and roomId != ''">
  57. and t.room_id= #{roomId}
  58. </if>
  59. <if test="paymentType !=null and paymentType != ''">
  60. and t.payment_type= #{paymentType}
  61. </if>
  62. <if test="ownerName !=null and ownerName != ''">
  63. and t.owner_name= #{ownerName}
  64. </if>
  65. <if test="price !=null and price != ''">
  66. and t.price= #{price}
  67. </if>
  68. <if test="state !=null and state != ''">
  69. and t.state= #{state}
  70. </if>
  71. <if test="rentingType !=null and rentingType != ''">
  72. and rc.renting_type= #{rentingType}
  73. </if>
  74. <if test="states !=null ">
  75. and t.state in
  76. <foreach collection="states" item="item" index="index" open="(" close=")" separator=",">
  77. #{item}
  78. </foreach>
  79. </if>
  80. <if test="communityId !=null and communityId != ''">
  81. and t.community_id= #{communityId}
  82. </if>
  83. <if test="communityName !=null and communityName != ''">
  84. and t.community_name like concat('%',#{communityName},'%')
  85. </if>
  86. <if test="longitude !=null and longitude != ''">
  87. and t.longitude= #{longitude}
  88. </if>
  89. order by t.create_time desc
  90. <if test="page != -1 and page != null ">
  91. limit #{page}, #{row}
  92. </if>
  93. </select>
  94. <!-- 修改房屋出租信息 add by wuxw 2018-07-03 -->
  95. <update id="updateRentingPoolInfo" parameterType="Map">
  96. update renting_pool t set t.status_cd = #{statusCd}
  97. <if test="newBId != null and newBId != ''">
  98. ,t.b_id = #{newBId}
  99. </if>
  100. <if test="latitude !=null and latitude != ''">
  101. , t.latitude= #{latitude}
  102. </if>
  103. <if test="ownerTel !=null and ownerTel != ''">
  104. , t.owner_tel= #{ownerTel}
  105. </if>
  106. <if test="rentingConfigId !=null and rentingConfigId != ''">
  107. , t.renting_config_id= #{rentingConfigId}
  108. </if>
  109. <if test="rentingDesc !=null and rentingDesc != ''">
  110. , t.renting_desc= #{rentingDesc}
  111. </if>
  112. <if test="rentingTitle !=null and rentingTitle != ''">
  113. , t.renting_title= #{rentingTitle}
  114. </if>
  115. <if test="checkIn !=null and checkIn != ''">
  116. , t.check_in= #{checkIn}
  117. </if>
  118. <if test="roomId !=null and roomId != ''">
  119. , t.room_id= #{roomId}
  120. </if>
  121. <if test="paymentType !=null and paymentType != ''">
  122. , t.payment_type= #{paymentType}
  123. </if>
  124. <if test="ownerName !=null and ownerName != ''">
  125. , t.owner_name= #{ownerName}
  126. </if>
  127. <if test="price !=null and price != ''">
  128. , t.price= #{price}
  129. </if>
  130. <if test="state !=null and state != ''">
  131. , t.state= #{state}
  132. </if>
  133. <if test="communityId !=null and communityId != ''">
  134. , t.community_id= #{communityId}
  135. </if>
  136. <if test="longitude !=null and longitude != ''">
  137. , t.longitude= #{longitude}
  138. </if>
  139. where 1=1
  140. <if test="rentingId !=null and rentingId != ''">
  141. and t.renting_id= #{rentingId}
  142. </if>
  143. </update>
  144. <!-- 查询房屋出租数量 add by wuxw 2018-07-03 -->
  145. <select id="queryRentingPoolsCount" parameterType="Map" resultType="Map">
  146. select count(1) count
  147. from renting_pool t
  148. left join t_dict td on td.status_cd = t.state and td.table_name = 'renting_pool' and td.table_columns = 'state'
  149. left join t_dict td2 on td2.status_cd = t.payment_type and td2.table_name = 'renting_pool' and td2.table_columns = 'payment_type'
  150. left join renting_config rc on t.renting_config_id = rc.renting_config_id and rc.status_cd = '0'
  151. where 1 =1
  152. <if test="latitude !=null and latitude != ''">
  153. and t.latitude= #{latitude}
  154. </if>
  155. <if test="ownerTel !=null and ownerTel != ''">
  156. and t.owner_tel= #{ownerTel}
  157. </if>
  158. <if test="rentingConfigId !=null and rentingConfigId != ''">
  159. and t.renting_config_id= #{rentingConfigId}
  160. </if>
  161. <if test="rentingDesc !=null and rentingDesc != ''">
  162. and t.renting_desc= #{rentingDesc}
  163. </if>
  164. <if test="statusCd !=null and statusCd != ''">
  165. and t.status_cd= #{statusCd}
  166. </if>
  167. <if test="rentingTitle !=null and rentingTitle != ''">
  168. and t.renting_title= #{rentingTitle}
  169. </if>
  170. <if test="checkIn !=null and checkIn != ''">
  171. and t.check_in= #{checkIn}
  172. </if>
  173. <if test="rentingId !=null and rentingId != ''">
  174. and t.renting_id= #{rentingId}
  175. </if>
  176. <if test="roomId !=null and roomId != ''">
  177. and t.room_id= #{roomId}
  178. </if>
  179. <if test="paymentType !=null and paymentType != ''">
  180. and t.payment_type= #{paymentType}
  181. </if>
  182. <if test="ownerName !=null and ownerName != ''">
  183. and t.owner_name= #{ownerName}
  184. </if>
  185. <if test="price !=null and price != ''">
  186. and t.price= #{price}
  187. </if>
  188. <if test="state !=null and state != ''">
  189. and t.state= #{state}
  190. </if>
  191. <if test="rentingType !=null and rentingType != ''">
  192. and rc.renting_type= #{rentingType}
  193. </if>
  194. <if test="states !=null ">
  195. and t.state in
  196. <foreach collection="states" item="item" index="index" open="(" close=")" separator=",">
  197. #{item}
  198. </foreach>
  199. </if>
  200. <if test="communityId !=null and communityId != ''">
  201. and t.community_id= #{communityId}
  202. </if>
  203. <if test="communityName !=null and communityName != ''">
  204. and t.community_name like concat('%',#{communityName},'%')
  205. </if>
  206. <if test="longitude !=null and longitude != ''">
  207. and t.longitude= #{longitude}
  208. </if>
  209. </select>
  210. </mapper>