PropertyRightRegistrationV1ServiceDaoImplMapper.xml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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="propertyRightRegistrationV1ServiceDaoImpl">
  6. <!-- 保存房屋产权信息 add by wuxw 2018-07-03 -->
  7. <insert id="savePropertyRightRegistrationInfo" parameterType="Map">
  8. insert into property_right_registration(address, prr_id, id_card, name, link, create_user, room_id, create_time,
  9. state, remark, community_id)
  10. values (#{address}, #{prrId}, #{idCard}, #{name}, #{link}, #{createUser}, #{roomId}, #{createTime}, #{state},
  11. #{remark}, #{communityId})
  12. </insert>
  13. <!-- 查询房屋产权信息 add by wuxw 2018-07-03 -->
  14. <select id="getPropertyRightRegistrationInfo" parameterType="Map" resultType="Map">
  15. select t.address,t.prr_id,t.prr_id prrId,t.id_card,t.id_card idCard,t.name,t.link,t.create_user,t.create_user
  16. createUser,t.status_cd,t.status_cd statusCd,t.room_id,t.room_id roomId,br.room_num roomNum,bu.unit_num unitNum,
  17. fl.floor_num floorNum,bu.unit_id unitId,fl.floor_id floorId,t.state,td.name stateName,t.remark,
  18. t.community_id,t.community_id communityId
  19. from property_right_registration t
  20. left join building_room br on br.room_id = t.room_id and br.status_cd = '0'
  21. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  22. left join f_floor fl on bu.floor_id = fl.floor_id and fl.status_cd = '0'
  23. left join t_dict td on t.state = td.status_cd and td.table_name = 'property_right_registration' and
  24. table_columns = 'state'
  25. where 1 = 1
  26. <if test="address !=null and address != ''">
  27. and t.address= #{address}
  28. </if>
  29. <if test="prrId !=null and prrId != ''">
  30. and t.prr_id= #{prrId}
  31. </if>
  32. <if test="idCard !=null and idCard != ''">
  33. and t.id_card= #{idCard}
  34. </if>
  35. <if test="name !=null and name != ''">
  36. and t.name= #{name}
  37. </if>
  38. <if test="link !=null and link != ''">
  39. and t.link= #{link}
  40. </if>
  41. <if test="createUser !=null and createUser != ''">
  42. and t.create_user= #{createUser}
  43. </if>
  44. <if test="statusCd !=null and statusCd != ''">
  45. and t.status_cd= #{statusCd}
  46. </if>
  47. <if test="roomId !=null and roomId != ''">
  48. and t.room_id= #{roomId}
  49. </if>
  50. <if test="floorId !=null and floorId != ''">
  51. and fl.floor_id= #{floorId}
  52. </if>
  53. <if test="unitId !=null and unitId != ''">
  54. and bu.unit_id= #{unitId}
  55. </if>
  56. <if test="roomNum !=null and roomNum != ''">
  57. and br.room_num= #{roomNum}
  58. </if>
  59. <if test="unitNum !=null and unitNum != ''">
  60. and bu.unit_num= #{unitNum}
  61. </if>
  62. <if test="floorNum !=null and floorNum != ''">
  63. and fl.floor_num= #{floorNum}
  64. </if>
  65. <if test="state !=null and state != ''">
  66. and t.state= #{state}
  67. </if>
  68. <if test="remark !=null and remark != ''">
  69. and t.remark= #{remark}
  70. </if>
  71. <if test="communityId !=null and communityId != ''">
  72. and t.community_id= #{communityId}
  73. </if>
  74. order by t.create_time desc
  75. <if test="page != -1 and page != null ">
  76. limit #{page}, #{row}
  77. </if>
  78. </select>
  79. <!-- 修改房屋产权信息 add by wuxw 2018-07-03 -->
  80. <update id="updatePropertyRightRegistrationInfo" parameterType="Map">
  81. update property_right_registration t set t.status_cd = #{statusCd}
  82. <if test="newBId != null and newBId != ''">
  83. ,t.b_id = #{newBId}
  84. </if>
  85. <if test="address !=null and address != ''">
  86. , t.address= #{address}
  87. </if>
  88. <if test="idCard !=null and idCard != ''">
  89. , t.id_card= #{idCard}
  90. </if>
  91. <if test="name !=null and name != ''">
  92. , t.name= #{name}
  93. </if>
  94. <if test="link !=null and link != ''">
  95. , t.link= #{link}
  96. </if>
  97. <if test="createUser !=null and createUser != ''">
  98. , t.create_user= #{createUser}
  99. </if>
  100. <if test="roomId !=null and roomId != ''">
  101. , t.room_id= #{roomId}
  102. </if>
  103. <if test="state !=null and state != ''">
  104. , t.state= #{state}
  105. </if>
  106. <if test="remark !=null">
  107. , t.remark= #{remark}
  108. </if>
  109. <if test="communityId !=null and communityId != ''">
  110. , t.community_id= #{communityId}
  111. </if>
  112. where 1=1
  113. <if test="prrId !=null and prrId != ''">
  114. and t.prr_id= #{prrId}
  115. </if>
  116. </update>
  117. <!-- 查询房屋产权数量 add by wuxw 2018-07-03 -->
  118. <select id="queryPropertyRightRegistrationsCount" parameterType="Map" resultType="Map">
  119. select count(1) count
  120. from property_right_registration t
  121. left join building_room br on br.room_id = t.room_id and br.status_cd = '0'
  122. left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
  123. left join f_floor fl on bu.floor_id = fl.floor_id and fl.status_cd = '0'
  124. where 1 = 1
  125. <if test="address !=null and address != ''">
  126. and t.address= #{address}
  127. </if>
  128. <if test="prrId !=null and prrId != ''">
  129. and t.prr_id= #{prrId}
  130. </if>
  131. <if test="idCard !=null and idCard != ''">
  132. and t.id_card= #{idCard}
  133. </if>
  134. <if test="name !=null and name != ''">
  135. and t.name= #{name}
  136. </if>
  137. <if test="link !=null and link != ''">
  138. and t.link= #{link}
  139. </if>
  140. <if test="createUser !=null and createUser != ''">
  141. and t.create_user= #{createUser}
  142. </if>
  143. <if test="statusCd !=null and statusCd != ''">
  144. and t.status_cd= #{statusCd}
  145. </if>
  146. <if test="roomId !=null and roomId != ''">
  147. and t.room_id= #{roomId}
  148. </if>
  149. <if test="floorId !=null and floorId != ''">
  150. and fl.floor_id= #{floorId}
  151. </if>
  152. <if test="unitId !=null and unitId != ''">
  153. and bu.unit_id= #{unitId}
  154. </if>
  155. <if test="roomNum !=null and roomNum != ''">
  156. and br.room_num= #{roomNum}
  157. </if>
  158. <if test="unitNum !=null and unitNum != ''">
  159. and bu.unit_num= #{unitNum}
  160. </if>
  161. <if test="floorNum !=null and floorNum != ''">
  162. and fl.floor_num= #{floorNum}
  163. </if>
  164. <if test="state !=null and state != ''">
  165. and t.state= #{state}
  166. </if>
  167. <if test="remark !=null and remark != ''">
  168. and t.remark= #{remark}
  169. </if>
  170. <if test="communityId !=null and communityId != ''">
  171. and t.community_id= #{communityId}
  172. </if>
  173. </select>
  174. </mapper>