|
@ -32,27 +32,40 @@ |
|
|
|
|
|
|
|
|
<select id="listPage" resultType="com.epmet.dto.stats.result.FactUserHouseResultDTO"> |
|
|
<select id="listPage" resultType="com.epmet.dto.stats.result.FactUserHouseResultDTO"> |
|
|
SELECT |
|
|
SELECT |
|
|
g.*, |
|
|
g.GRID_NAME AS AGENCY_NAME, |
|
|
g.GRID_ID AS agencyId, |
|
|
max( NEIGHBOURHOODS_COUNT ) AS NEIGHBOURHOODS_COUNT, |
|
|
d.GRID_NAME AS agencyName |
|
|
max( HOUSE_COUNT ) AS HOUSE_COUNT, |
|
|
|
|
|
max( HOUSE_SELF_COUNT ) AS HOUSE_SELF_COUNT, |
|
|
|
|
|
max( HOUSE_LEASE_COUNT ) AS HOUSE_LEASE_COUNT, |
|
|
|
|
|
max( HOUSE_IDLE_COUNT ) AS HOUSE_IDLE_COUNT, |
|
|
|
|
|
max( USER_COUNT ) AS USER_COUNT, |
|
|
|
|
|
max( USER_RESI_COUNT ) AS USER_RESI_COUNT, |
|
|
|
|
|
max( USER_FLOAT_COUNT ) AS USER_FLOAT_COUNT, |
|
|
|
|
|
max( HOUSE_INCR ) AS HOUSE_INCR, |
|
|
|
|
|
max( HOUSE_MODIFY ) AS HOUSE_MODIFY, |
|
|
|
|
|
max( USER_INCR ) AS USER_INCR, |
|
|
|
|
|
max( USER_MODIFY ) AS USER_MODIFY |
|
|
FROM |
|
|
FROM |
|
|
fact_grid_user_house_daily g |
|
|
fact_grid_user_house_daily d |
|
|
LEFT JOIN dim_grid d ON d.id = g.GRID_ID |
|
|
LEFT JOIN dim_grid g ON g.id = d.GRID_ID |
|
|
<if test="customerId != null and customerId != ''"> |
|
|
<if test="customerId != null and customerId != ''"> |
|
|
AND g.CUSTOMER_ID = #{customerId} |
|
|
AND g.CUSTOMER_ID = #{customerId} |
|
|
AND d.CUSTOMER_ID = #{customerId} |
|
|
AND d.CUSTOMER_ID = #{customerId} |
|
|
</if> |
|
|
</if> |
|
|
<if test="agencyId != null and agencyId != ''"> |
|
|
<if test="agencyId != null and agencyId != ''"> |
|
|
AND g.GRID_ID = #{agencyId} |
|
|
AND d.GRID_ID = #{agencyId} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="dateId != null and dateId != ''"> |
|
|
|
|
|
AND d.DATE_ID = #{dateId} |
|
|
</if> |
|
|
</if> |
|
|
<if test="startTime != null and startTime != ''"> |
|
|
<if test="startTime != null and startTime != ''"> |
|
|
AND g.DATE_ID >= #{startTime} |
|
|
AND DATE_FORMAT( d.DATE_ID, '%Y-%m-%d' ) >= DATE_FORMAT( #{startTime}, '%Y-%m-%d' ) |
|
|
</if> |
|
|
</if> |
|
|
<if test="endTime != null and endTime != ''"> |
|
|
<if test="endTime != null and endTime != ''"> |
|
|
AND g.DATE_ID <= #{endTime} |
|
|
AND DATE_FORMAT( d.DATE_ID, '%Y-%m-%d' ) <= DATE_FORMAT( #{endTime}, '%Y-%m-%d' ) |
|
|
</if> |
|
|
</if> |
|
|
ORDER BY |
|
|
GROUP BY |
|
|
g.CREATED_TIME DESC |
|
|
GRID_ID |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<select id="statAgency" resultType="com.epmet.dto.stats.result.FactUserHouseResultDTO"> |
|
|
<select id="statAgency" resultType="com.epmet.dto.stats.result.FactUserHouseResultDTO"> |
|
|