123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.huiju.estateagents.mapper.TaHousingResourcesMapper">
-
- <select id="listHousingResources" resultType="com.huiju.estateagents.po.TaHousingResourcesPO">
- SELECT
- t.house_id,
- t.building_id,
- t.block_id,
- t.block_name,
- t.sales_batch_id,
- t.unit_id,
- t.unit_name,
- t.floor_id,
- t.floor_name,
- t.room_id,
- t.room_name,
- t.price,
- t.heat,
- t.apartment_id,
- t.`status`,
- t.org_id,
- t2.inside_area,
- t2.building_area
- FROM
- ta_housing_resources t,
- ta_building_apartment t2
- WHERE
- t.sales_batch_id = #{salesBatchId}
- <if test="startPrice != null and startPrice != '' and endPrice != null and endPrice != ''">
- AND ( t.price BETWEEN #{startPrice} AND #{endPrice} )
- </if>
- <if test="apartmentId != null and apartmentId != ''">
- AND t.apartment_id = #{apartmentId}
- </if>
- AND t.apartment_id = t2.apartment_id
- AND t.`status` = 1
- AND t2.`status` = 1
- ORDER BY
- t.create_date DESC
- </select>
-
- <select id="listBuildApartmentBySalesBatchId" resultType="com.huiju.estateagents.entity.TaBuildingApartment">
- SELECT
- t3.apartment_id,
- t3.apartment_name,
- t3.apartment_type,
- t3.inside_area,
- t3.building_area
- FROM
- ( SELECT t.sales_batch_id, t.apartment_id FROM ta_housing_resources t WHERE t.sales_batch_id = #{salesBatchId} GROUP BY t.apartment_id ) t2
- LEFT JOIN ta_building_apartment t3 ON t2.apartment_id = t3.apartment_id
- ORDER BY
- t3.apartment_name
- </select>
-
- <update id="updateForAddHeat" parameterType="java.lang.String">
- UPDATE ta_housing_resources t
- SET t.heat = t.heat + 1
- WHERE
- t.house_id = #{houseId}
- AND t.heat >= 0
- </update>
-
- <update id="updateForSubtractHeat" parameterType="java.lang.String">
- UPDATE ta_housing_resources t
- SET t.heat = t.heat - 1
- WHERE
- t.house_id = #{houseId}
- AND t.heat > 0
- </update>
-
- <select id="getHousingDetailById" resultType="com.huiju.estateagents.po.TaHousingResourcesPO">
- SELECT
- t.house_id,
- t.building_id,
- t.block_id,
- t.block_name,
- t.sales_batch_id,
- t.unit_id,
- t.unit_name,
- t.floor_id,
- t.floor_name,
- t.room_id,
- t.room_name,
- t.price,
- t.heat,
- t.apartment_id,
- t.`status`,
- t.org_id,
- t2.inside_area,
- t2.building_area
- FROM
- ta_housing_resources t,
- ta_building_apartment t2
- WHERE
- t.house_id = #{houseId}
- AND t.apartment_id = t2.apartment_id
- AND t.`status` = 1
- AND t2.`status` = 1
- </select>
-
- </mapper>
|