BaseDataStatisticsServiceDaoImplMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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="baseDataStatisticsServiceDaoImpl">
  6. <!-- 查询房屋数 -->
  7. <select id="getRoomCount" parameterType="Map" resultType="Map">
  8. select count(1) count
  9. from building_room t
  10. inner join building_unit bu on t.unit_id = bu.unit_id and bu.status_cd = '0'
  11. inner join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  12. <if test="ownerId != null and ownerId != ''">
  13. inner join building_owner_room_rel borr on t.room_id = borr.room_id and borr.status_cd = '0'
  14. left join building_owner bo on borr.owner_id = bo.member_id and bo.status_cd = '0'
  15. </if>
  16. where 1=1
  17. and t.status_cd = '0'
  18. <if test="floorId != null and floorId != ''">
  19. and f.floor_id = #{floorId}
  20. </if>
  21. <if test="floorNum != null and floorNum != ''">
  22. and f.floor_num = #{floorNum}
  23. </if>
  24. <if test="unitNum != null and unitNum != ''">
  25. and bu.unit_num = #{unitNum}
  26. </if>
  27. <if test="roomNum != null and roomNum != ''">
  28. and t.room_num = #{roomNum}
  29. </if>
  30. <if test="roomNumLike !=null and roomNumLike != ''">
  31. and t.room_num like concat('%',#{roomNumLike},'%')
  32. </if>
  33. <if test="state !=null and state != ''">
  34. and t.state= #{state}
  35. </if>
  36. <if test="roomId != null and roomId != ''">
  37. and t.room_id = #{roomId}
  38. </if>
  39. <if test="communityId != null and communityId != ''">
  40. and t.community_id = #{communityId}
  41. </if>
  42. <if test="ownerId != null and ownerId != ''">
  43. and bo.owner_id = #{ownerId}
  44. </if>
  45. <if test="ownerName != null and ownerName != ''">
  46. and bo.`name` like concat('%',#{ownerName},'%')
  47. </if>
  48. <if test="link != null and link != ''">
  49. and bo.link = #{link}
  50. </if>
  51. </select>
  52. <!-- 查询单月欠费 -->
  53. <select id="getRoomInfo" parameterType="Map" resultType="Map">
  54. select t.fee_coefficient feeCoefficient,t.section,t.remark,t.user_id userId,
  55. t.room_id roomId,t.layer,t.built_up_area,t.built_up_area
  56. builtUpArea,t.room_num,t.room_num roomNum,t.unit_id,t.unit_id unitId,t.b_id,t.b_id
  57. bId,t.apartment,t.state,t.community_id,t.community_id communityId,t.room_type,t.room_type roomType,
  58. t.room_sub_type,t.room_rent,t.room_area,t.room_sub_type roomSubType,t.room_rent roomRent,t.room_area roomArea,
  59. f.floor_num floorNum,bu.unit_num unitNum,bo.name ownerName,bo.owner_id ownerId,bo.link
  60. from building_room t
  61. inner join building_unit bu on t.unit_id = bu.unit_id and bu.status_cd = '0'
  62. inner join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
  63. inner join building_owner_room_rel borr on t.room_id = borr.room_id and borr.status_cd = '0'
  64. left join building_owner bo on borr.owner_id = bo.member_id and bo.status_cd = '0'
  65. where 1=1
  66. <if test="floorId != null and floorId != ''">
  67. and f.floor_id = #{floorId}
  68. </if>
  69. <if test="floorNum != null and floorNum != ''">
  70. and f.floor_num = #{floorNum}
  71. </if>
  72. <if test="unitNum != null and unitNum != ''">
  73. and bu.unit_num = #{unitNum}
  74. </if>
  75. <if test="roomNum != null and roomNum != ''">
  76. and t.room_num = #{roomNum}
  77. </if>
  78. <if test="roomNumLike !=null and roomNumLike != ''">
  79. and t.room_num like concat('%',#{roomNumLike},'%')
  80. </if>
  81. <if test="state !=null and state != ''">
  82. and t.state= #{state}
  83. </if>
  84. <if test="roomId != null and roomId != ''">
  85. and t.room_id = #{roomId}
  86. </if>
  87. <if test="communityId != null and communityId != ''">
  88. and t.community_id = #{communityId}
  89. </if>
  90. <if test="ownerId != null and ownerId != ''">
  91. and bo.owner_id = #{ownerId}
  92. </if>
  93. <if test="ownerName != null and ownerName != ''">
  94. and bo.`name` like concat('%',#{ownerName},'%')
  95. </if>
  96. <if test="link != null and link != ''">
  97. and bo.link = #{link}
  98. </if>
  99. order by t.create_time desc
  100. <if test="page != -1 and page != null">
  101. limit #{page},#{row}
  102. </if>
  103. </select>
  104. </mapper>