ReportCommunityServiceDaoImplMapper.xml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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="reportCommunityServiceDaoImpl">
  6. <!-- 查询房屋个数 add by wuxw 2018-07-03 -->
  7. <select id="getRoomCount" parameterType="com.java110.dto.report.ReportRoomDto" resultType="Map">
  8. select count(1) count
  9. from building_room t
  10. where t.status_cd = '0'
  11. <if test="state !=null and state != ''">
  12. and t.state= #{state}
  13. </if>
  14. <if test="communityId !=null and communityId != ''">
  15. and t.community_id= #{communityId}
  16. </if>
  17. </select>
  18. <!-- 查询 房屋 楼栋 单元 业主 -->
  19. <select id="getRoomFloorUnitAndOwner" parameterType="com.java110.dto.report.ReportRoomDto"
  20. resultType="com.java110.dto.report.ReportRoomDto">
  21. select t.apartment,t.built_up_area builtUpArea,t.community_id communityId,t.create_time createTime,
  22. t.fee_coefficient feeCoefficient,t.layer,t.room_id roomId,t.room_num roomNum,t.section,
  23. t.state,bu.unit_id unitId,bu.unit_num unitNum,ff.floor_id floorId,ff.floor_num floorNum,
  24. bo.age,bo.id_card idCard,bo.link,bo.member_id memberId,bo.`name`,bo.`name` ownerName,bo.owner_id ownerId,t.room_type roomType,
  25. t.room_sub_type roomSubType,t.room_rent roomRent,t.room_area roomArea
  26. from building_room t
  27. INNER JOIN building_unit bu on t.unit_id = bu.unit_id and bu.status_cd = '0'
  28. inner join f_floor ff on bu.floor_id = ff.floor_id and ff.status_cd = '0'
  29. LEFT JOIN building_owner_room_rel borr on t.room_id = borr.room_id and borr.status_cd = '0'
  30. left join building_owner bo on borr.owner_id = bo.member_id and bo.status_cd = '0'
  31. where t.status_cd = '0'
  32. <if test="state !=null and state != ''">
  33. and t.state= #{state}
  34. </if>
  35. <if test="communityId !=null and communityId != ''">
  36. and t.community_id= #{communityId}
  37. </if>
  38. <if test="page != -1 and page != null ">
  39. limit #{page}, #{row}
  40. </if>
  41. </select>
  42. <select id="queryRoomStructures" parameterType="Map" resultType="Map">
  43. select t.apartment,t.built_up_area builtUpArea,t.community_id communityId,t.create_time createTime,
  44. t.fee_coefficient feeCoefficient,t.layer,t.room_id roomId,t.room_num roomNum,t.section,
  45. t.state,bu.unit_id unitId,bu.unit_num unitNum,ff.floor_id floorId,ff.floor_num floorNum,
  46. bo.age,bo.id_card idCard,bo.link,bo.member_id memberId,bo.`name`,bo.`name` ownerName,bo.owner_id ownerId,t.room_type roomType,
  47. t.room_sub_type roomSubType,t.room_rent roomRent,t.room_area roomArea,
  48. (
  49. select if (SUM(rof.amount_owed)!='',SUM(rof.amount_owed),0) from report_owe_fee rof where rof.payer_obj_id = t.room_id and rof.payer_obj_type = '3333'
  50. ) oweAmount
  51. from building_room t
  52. INNER JOIN building_unit bu on t.unit_id = bu.unit_id and bu.status_cd = '0'
  53. inner join f_floor ff on bu.floor_id = ff.floor_id and ff.status_cd = '0'
  54. LEFT JOIN building_owner_room_rel borr on t.room_id = borr.room_id and borr.status_cd = '0'
  55. left join building_owner bo on borr.owner_id = bo.member_id and bo.status_cd = '0'
  56. where t.status_cd = '0'
  57. and t.community_id = #{communityId}
  58. and bu.unit_id = #{unitId}
  59. </select>
  60. <!-- 查询房屋个数 add by wuxw 2018-07-03 -->
  61. <select id="getCarCount" parameterType="com.java110.dto.report.ReportCarDto" resultType="Map">
  62. select count(1) count
  63. from owner_car t
  64. where t.status_cd = '0'
  65. <if test="state !=null and state != ''">
  66. and t.state= #{state}
  67. </if>
  68. <if test="communityId !=null and communityId != ''">
  69. and t.community_id= #{communityId}
  70. </if>
  71. </select>
  72. <!-- 查询 房屋 楼栋 单元 业主 -->
  73. <select id="getCarParkingSpace" parameterType="com.java110.dto.report.ReportCarDto"
  74. resultType="com.java110.dto.report.ReportCarDto">
  75. select t.car_brand carBrand,t.car_color carColor,t.car_id carId,t.car_num carNum,t.car_type carType,
  76. t.community_id communityId,bo.`name` ownerName,bo.id_card idCard,bo.link,bo.owner_id ownerId,ps.ps_id psId,
  77. ps.num,pa.pa_id paId,pa.num areaNum,ps.state,t.start_time startTime,t.end_time endTime
  78. from owner_car t
  79. INNER JOIN building_owner bo on t.owner_id = bo.member_id and t.status_cd = '0'
  80. left join parking_space ps on t.ps_id = ps.ps_id and ps.status_cd = '0'
  81. left join parking_area pa on ps.pa_id = pa.pa_id and pa.status_cd = '0'
  82. where t.status_cd = '0'
  83. <if test="state !=null and state != ''">
  84. and t.state= #{state}
  85. </if>
  86. <if test="communityId !=null and communityId != ''">
  87. and t.community_id= #{communityId}
  88. </if>
  89. <if test="page != -1 and page != null ">
  90. limit #{page}, #{row}
  91. </if>
  92. </select>
  93. <!-- 查询小区信息 add by wuxw 2018-07-03 -->
  94. <select id="getCommunitys" parameterType="Map" resultType="Map">
  95. select t.address,t.nearby_landmarks,t.nearby_landmarks nearbyLandmarks,
  96. t.city_code,t.city_code cityCode,t.name,t.status_cd,t.status_cd statusCd,t.tel,
  97. t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.map_y,t.map_y mapY,
  98. t.map_x,t.map_x mapX,t.state,ca.area_code areaCode,ca.area_name areaName,
  99. ca.parent_area_code parentAreaCode,ca.parent_area_name parentAreaName,
  100. t.community_area communityArea
  101. from s_community t,city_area ca
  102. where t.status_cd = '0'
  103. and t.city_code = ca.area_code
  104. and ca.status_cd = '0'
  105. <if test="address !=null and address != ''">
  106. and t.address= #{address}
  107. </if>
  108. <if test="nearbyLandmarks !=null and nearbyLandmarks != ''">
  109. and t.nearby_landmarks= #{nearbyLandmarks}
  110. </if>
  111. <if test="cityCode !=null and cityCode != ''">
  112. and t.city_code= #{cityCode}
  113. </if>
  114. <if test="name !=null and name != ''">
  115. and t.name like concat('%',#{name},'%')
  116. </if>
  117. <if test="statusCd !=null and statusCd != ''">
  118. and t.status_cd= #{statusCd}
  119. </if>
  120. <if test="communityId !=null and communityId != ''">
  121. and t.community_id= #{communityId}
  122. </if>
  123. <if test="communityIds !=null">
  124. and t.community_id in
  125. <foreach collection="communityIds" item="item" open="(" close=")" separator=",">
  126. #{item}
  127. </foreach>
  128. </if>
  129. <if test="bId !=null and bId != ''">
  130. and t.b_id= #{bId}
  131. </if>
  132. <if test="mapY !=null and mapY != ''">
  133. and t.map_y= #{mapY}
  134. </if>
  135. <if test="mapX !=null and mapX != ''">
  136. and t.map_x= #{mapX}
  137. </if>
  138. <if test="state !=null and state != ''">
  139. and t.state= #{state}
  140. </if>
  141. order by t.create_time ASC
  142. <if test="page != -1 and page != null ">
  143. limit #{page}, #{row}
  144. </if>
  145. </select>
  146. </mapper>