|
|
@@ -23,39 +23,49 @@
|
|
|
status,rent_range,create_time,
|
|
|
update_time
|
|
|
</sql>
|
|
|
- <select id="getList" resultType="com.zksy.controller.property.vo.ASimplifiedHouseInfoVo">
|
|
|
- select a.*,b.area from a_simplified_house_info a LEFT JOIN a_house_info_detail b ON a.id = b.simplified_house_id
|
|
|
+ <select id="getListPage" resultType="com.zksy.controller.property.vo.ASimplifiedHouseInfoVo">
|
|
|
+ SELECT a.*, b.area
|
|
|
+ FROM a_simplified_house_info a
|
|
|
+ LEFT JOIN a_house_info_detail b ON a.id = b.simplified_house_id
|
|
|
<where>
|
|
|
<if test="entity.building != null and entity.building != ''">
|
|
|
- and a.building = #{entity.building}
|
|
|
+ AND a.building = #{entity.building}
|
|
|
</if>
|
|
|
- <if test="entity.houseName != null and entity.houseName != ''">
|
|
|
- and a.floor like concat('%',#{entity.floor},'%')
|
|
|
+ <if test="entity.floor != null and entity.floor != ''">
|
|
|
+ AND a.floor LIKE CONCAT(#{entity.floor}, '%')
|
|
|
</if>
|
|
|
- <if test="entity.rentRangeMin != null and entity.rentRangeMin != ''" >
|
|
|
- and a.rent_range >= #{entity.rentRangeMin}
|
|
|
+ <if test="entity.rentRangeMin != null">
|
|
|
+ AND a.rent_range >= COALESCE(#{entity.rentRangeMin}, a.rent_range)
|
|
|
</if>
|
|
|
- <if test="entity.rentRangeMax != null and entity.rentRangeMax != ''">
|
|
|
- and a.rent_range <= #{entity.rentRangeMax}
|
|
|
+ <if test="entity.rentRangeMax != null">
|
|
|
+ AND a.rent_range <= COALESCE(#{entity.rentRangeMax}, a.rent_range)
|
|
|
</if>
|
|
|
- <if test="entity.areaMin != null and entity.areaMin != ''">
|
|
|
- and b.area >= #{entity.areaMin}
|
|
|
+ <if test="entity.areaMin != null">
|
|
|
+ AND b.area >= COALESCE(#{entity.areaMin}, b.area)
|
|
|
</if>
|
|
|
- <if test="entity.areaMax != null and entity.areaMax != ''">
|
|
|
- and b.area <= #{entity.areaMax}
|
|
|
+ <if test="entity.areaMax != null">
|
|
|
+ AND b.area <= COALESCE(#{entity.areaMax}, b.area)
|
|
|
</if>
|
|
|
</where>
|
|
|
- <if test="entity.sortSearch != null and entity.sortSearch != '' and entity.sortSearch = '1'">
|
|
|
- order by a.rent_range desc
|
|
|
- </if>
|
|
|
- <if test="entity.sortSearch != null and entity.sortSearch != '' and entity.sortSearch = '2'">
|
|
|
- order by a.rent_range asc
|
|
|
- </if>
|
|
|
- <if test="entity.sortSearch != null and entity.sortSearch != '' and entity.sortSearch = '3'">
|
|
|
- order by b.area desc
|
|
|
- </if>
|
|
|
- <if test="entity.sortSearch != null and entity.sortSearch != '' and entity.sortSearch = '4'">
|
|
|
- order by b.area asc
|
|
|
+ <choose>
|
|
|
+ <when test="entity.sortSearch == '1'">
|
|
|
+ ORDER BY a.rent_range DESC
|
|
|
+ </when>
|
|
|
+ <when test="entity.sortSearch == '2'">
|
|
|
+ ORDER BY a.rent_range ASC
|
|
|
+ </when>
|
|
|
+ <when test="entity.sortSearch == '3'">
|
|
|
+ ORDER BY b.area DESC
|
|
|
+ </when>
|
|
|
+ <when test="entity.sortSearch == '4'">
|
|
|
+ ORDER BY b.area ASC
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ ORDER BY a.create_time DESC
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ <if test="offset != null and limit != null">
|
|
|
+ LIMIT #{offset}, #{limit}
|
|
|
</if>
|
|
|
|
|
|
</select>
|