Commit fc2c1b76 authored by lixuan's avatar lixuan

feat: 房源

parent 34ac25bf
Pipeline #144705 failed with stages
in 28 minutes and 26 seconds
...@@ -105,4 +105,6 @@ public class HouseResourcePage { ...@@ -105,4 +105,6 @@ public class HouseResourcePage {
private String industryClassification; private String industryClassification;
private Boolean gs; private Boolean gs;
private BigDecimal dayPrice;
} }
...@@ -57,4 +57,8 @@ public class HouseResourcePageQuery extends PageDomain { ...@@ -57,4 +57,8 @@ public class HouseResourcePageQuery extends PageDomain {
private boolean zyzyFlag; private boolean zyzyFlag;
private String fourOrHouseNumber; private String fourOrHouseNumber;
private BigDecimal dayPriceMin;
private BigDecimal dayPriceMax;
} }
...@@ -114,60 +114,68 @@ ...@@ -114,60 +114,68 @@
</foreach> </foreach>
</insert> </insert>
<select id="selectPage" resultType="com.ruoyi.system.domain.house.vo.HouseResourcePage"> <resultMap id="pageResultMap" type="com.ruoyi.system.domain.house.vo.HouseResourcePage">
<result column="dayPrice" property="dayPrice" javaType="java.math.BigDecimal"/>
<result column="income" property="income" javaType="java.math.BigDecimal"/>
</resultMap>
<select id="selectPage" resultMap="pageResultMap">
SELECT SELECT
t2.wg_name AS wgName4, t2.wg_name AS wgName4,
t1.*, t1.*,
SUM(t4.year_sell) AS income, SUM(t4.year_sell) AS income,
t3.nature, t3.nature,
t3.industry_classification t3.industry_classification,
ROUND(t1.unit_price * 10000 / 365 / t1.house_area, 1) AS dayPrice
FROM FROM
house_resource t1 house_resource t1
LEFT JOIN grid_region t2 ON t2.wg_code = t1.four LEFT JOIN grid_region t2 ON t2.wg_code = t1.four
LEFT JOIN business_entity_info t3 ON t1.id = t3.house_resource_id LEFT JOIN business_entity_info t3 ON t1.id = t3.house_resource_id
LEFT JOIN business_entity_sell t4 ON t4.business_entity_info_id = t3.id LEFT JOIN business_entity_sell t4 ON t4.business_entity_info_id = t3.id
<where> where t1.rental_unit = 5 and t1.unit_price is not null
<if test="query.wgType != null"> <if test="query.wgType != null">
and t1.type = #{query.wgType} and t1.type = #{query.wgType}
</if> </if>
<if test="query.two != null and query.two != ''"> <if test="query.two != null and query.two != ''">
and t1.two = #{query.two} and t1.two = #{query.two}
</if> </if>
<if test="query.three != null and query.three != ''"> <if test="query.three != null and query.three != ''">
and t1.three = #{query.three} and t1.three = #{query.three}
</if> </if>
<if test="query.four != null and query.four != ''"> <if test="query.four != null and query.four != ''">
and t1.four = #{query.four} and t1.four = #{query.four}
</if> </if>
<if test="query.houseResourceAttribute != null"> <if test="query.houseResourceAttribute != null">
and t1.house_resource_attribute = #{query.houseResourceAttribute} and t1.house_resource_attribute = #{query.houseResourceAttribute}
</if> </if>
<if test="query.hireStatus != null"> <if test="query.hireStatus != null">
and t1.hire_status = #{query.hireStatus} and t1.hire_status = #{query.hireStatus}
</if> </if>
<if test="query.houseNumber != null and query.houseNumber != ''"> <if test="query.houseNumber != null and query.houseNumber != ''">
and t1.house_number like concat('%', #{query.houseNumber}, '%') and t1.house_number like concat('%', #{query.houseNumber}, '%')
</if> </if>
<if test="query.houseAreaMin != null and query.houseAreaMin != '' and query.houseAreaMax != null and query.houseAreaMax != ''"> <if test="query.houseAreaMin != null and query.houseAreaMin != '' and query.houseAreaMax != null and query.houseAreaMax != ''">
and t1.house_area <![CDATA[ >= ]]> #{query.houseAreaMin} and t1.house_area <![CDATA[ <= ]]> #{query.houseAreaMax} and t1.house_area <![CDATA[ >= ]]> #{query.houseAreaMin} and t1.house_area <![CDATA[ <= ]]> #{query.houseAreaMax}
</if> </if>
<if test="query.houseResourceType != null"> <if test="query.houseResourceType != null">
and t1.house_resource_type = #{query.houseResourceType} and t1.house_resource_type = #{query.houseResourceType}
</if> </if>
<if test="query.name != null and query.name != ''"> <if test="query.name != null and query.name != ''">
and t3.name like concat('%', #{query.name}, '%') and t3.name like concat('%', #{query.name}, '%')
</if> </if>
<if test="query.yearSellMin != null and query.yearSellMin != '' and query.yearSellMax != null and query.yearSellMax != ''"> <if test="query.yearSellMin != null and query.yearSellMin != '' and query.yearSellMax != null and query.yearSellMax != ''">
and t4.year_sell <![CDATA[ >= ]]> #{query.yearSellMin} and t4.year_sell <![CDATA[ <= ]]> #{query.yearSellMax} and t4.year_sell <![CDATA[ >= ]]> #{query.yearSellMin} and t4.year_sell <![CDATA[ <= ]]> #{query.yearSellMax}
</if> </if>
<if test="query.wgCodes != null and query.wgCodes.size() > 0"> <if test="query.wgCodes != null and query.wgCodes.size() > 0">
and t1.two in and t1.two in
<foreach item="item" index="index" collection="query.wgCodes" open="(" separator="," close=")"> <foreach item="item" index="index" collection="query.wgCodes" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
</where>
GROUP BY t1.id GROUP BY t1.id
<if test="query.dayPriceMin != null and query.dayPriceMin != '' and query.dayPriceMax != null and query.dayPriceMax != ''">
having dayPrice <![CDATA[ >= ]]> #{query.dayPriceMin} and dayPrice <![CDATA[ <= ]]> #{query.dayPriceMax}
</if>
</select> </select>
<select id="selectProfileGraph" resultType="com.ruoyi.system.domain.house.vo.HouseResourcePage"> <select id="selectProfileGraph" resultType="com.ruoyi.system.domain.house.vo.HouseResourcePage">
SELECT SELECT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment