RentingPoolServiceDaoImplMapper.xml 7.9 KB

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