|
@ -53,23 +53,24 @@ |
|
|
AND a.CUSTOMER_ID = #{customerId} |
|
|
AND a.CUSTOMER_ID = #{customerId} |
|
|
AND d.CUSTOMER_ID = #{customerId} |
|
|
AND d.CUSTOMER_ID = #{customerId} |
|
|
</if> |
|
|
</if> |
|
|
<if test="agencyId != null and agencyId != ''"> |
|
|
|
|
|
AND a.AGENCY_ID = #{agencyId} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="dateId != null and dateId != ''"> |
|
|
<if test="dateId != null and dateId != ''"> |
|
|
AND a.DATE_ID = #{dateId} |
|
|
AND a.DATE_ID = #{dateId} |
|
|
</if> |
|
|
</if> |
|
|
<if test="level == 'street'"> |
|
|
<if test="level == 'street'"> |
|
|
AND a.LEVEL = 'community' |
|
|
AND a.LEVEL = 'community' |
|
|
|
|
|
AND a.PID = #{agencyId} |
|
|
</if> |
|
|
</if> |
|
|
<if test="level == 'district'"> |
|
|
<if test="level == 'district'"> |
|
|
AND a.LEVEL = 'street' |
|
|
AND a.LEVEL = 'street' |
|
|
|
|
|
AND a.PID = #{agencyId} |
|
|
</if> |
|
|
</if> |
|
|
<if test="level == 'city'"> |
|
|
<if test="level == 'city'"> |
|
|
AND a.LEVEL = 'district' |
|
|
AND a.LEVEL = 'district' |
|
|
|
|
|
AND a.PID = #{agencyId} |
|
|
</if> |
|
|
</if> |
|
|
<if test="level == 'province'"> |
|
|
<if test="level == 'province'"> |
|
|
AND a.LEVEL = 'city' |
|
|
AND a.LEVEL = 'city' |
|
|
|
|
|
AND a.PID = #{agencyId} |
|
|
</if> |
|
|
</if> |
|
|
<if test="startTime != null and startTime != ''"> |
|
|
<if test="startTime != null and startTime != ''"> |
|
|
AND DATE_FORMAT( a.DATE_ID, '%Y-%m-%d' ) >= DATE_FORMAT( #{startTime}, '%Y-%m-%d' ) |
|
|
AND DATE_FORMAT( a.DATE_ID, '%Y-%m-%d' ) >= DATE_FORMAT( #{startTime}, '%Y-%m-%d' ) |
|
@ -81,6 +82,42 @@ |
|
|
a.AGENCY_ID |
|
|
a.AGENCY_ID |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<select id="getTotal" resultType="com.epmet.dto.stats.result.FactUserHouseResultDTO"> |
|
|
|
|
|
SELECT |
|
|
|
|
|
d.AGENCY_NAME AS AGENCY_NAME, |
|
|
|
|
|
sum( NEIGHBOURHOODS_COUNT ) AS NEIGHBOURHOODS_COUNT, |
|
|
|
|
|
sum( HOUSE_COUNT ) AS HOUSE_COUNT, |
|
|
|
|
|
sum( HOUSE_SELF_COUNT ) AS HOUSE_SELF_COUNT, |
|
|
|
|
|
sum( HOUSE_LEASE_COUNT ) AS HOUSE_LEASE_COUNT, |
|
|
|
|
|
sum( HOUSE_IDLE_COUNT ) AS HOUSE_IDLE_COUNT, |
|
|
|
|
|
sum( USER_COUNT ) AS USER_COUNT, |
|
|
|
|
|
sum( USER_RESI_COUNT ) AS USER_RESI_COUNT, |
|
|
|
|
|
sum( USER_FLOAT_COUNT ) AS USER_FLOAT_COUNT, |
|
|
|
|
|
sum( HOUSE_INCR ) AS HOUSE_INCR, |
|
|
|
|
|
sum( HOUSE_MODIFY ) AS HOUSE_MODIFY, |
|
|
|
|
|
sum( USER_INCR ) AS USER_INCR, |
|
|
|
|
|
sum( USER_MODIFY ) AS USER_MODIFY |
|
|
|
|
|
FROM |
|
|
|
|
|
fact_agency_user_house_daily a |
|
|
|
|
|
LEFT JOIN dim_agency d ON d.id = a.AGENCY_ID |
|
|
|
|
|
<if test="customerId != null and customerId != ''"> |
|
|
|
|
|
AND a.CUSTOMER_ID = #{customerId} |
|
|
|
|
|
AND d.CUSTOMER_ID = #{customerId} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="agencyId != null and agencyId != ''"> |
|
|
|
|
|
AND a.AGENCY_ID = #{agencyId} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="dateId != null and dateId != ''"> |
|
|
|
|
|
AND a.DATE_ID = #{dateId} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="startTime != null and startTime != ''"> |
|
|
|
|
|
AND DATE_FORMAT( a.DATE_ID, '%Y-%m-%d' ) >= DATE_FORMAT( #{startTime}, '%Y-%m-%d' ) |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="endTime != null and endTime != ''"> |
|
|
|
|
|
AND DATE_FORMAT( a.DATE_ID, '%Y-%m-%d' ) <= DATE_FORMAT( #{endTime}, '%Y-%m-%d' ) |
|
|
|
|
|
</if> |
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
<delete id="deleteByDateId"> |
|
|
<delete id="deleteByDateId"> |
|
|
DELETE |
|
|
DELETE |
|
|
FROM |
|
|
FROM |
|
|