From 2024ff0127ba074adb85f860e17d12d2a546bbbf Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 30 May 2022 14:53:54 +0800 Subject: [PATCH] sql bug --- .../mapper/stats/FactGridUserHouseDailyDao.xml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridUserHouseDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridUserHouseDailyDao.xml index ca3a8ebb99..15caa333c3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridUserHouseDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridUserHouseDailyDao.xml @@ -98,21 +98,27 @@ fact_grid_user_house_daily d INNER JOIN dim_grid g ON g.id = d.GRID_ID INNER JOIN dim_agency c ON c.id = g.AGENCY_ID + WHERE d.DATE_ID = #{dateId} AND d.CUSTOMER_ID = #{customerId} - GROUP BY c.id INNER JOIN dim_agency s ON s.id = c.pid + WHERE + d.DATE_ID = #{dateId} + AND d.CUSTOMER_ID = #{customerId} GROUP BY s.id INNER JOIN dim_agency s ON s.id = c.pid INNER JOIN dim_agency di ON di.id = s.pid + WHERE + d.DATE_ID = #{dateId} + AND d.CUSTOMER_ID = #{customerId} GROUP BY di.id @@ -121,6 +127,9 @@ INNER JOIN dim_agency di ON di.id = s.pid INNER JOIN dim_agency ci ON ci.id = di.pid INNER JOIN dim_agency p ON p.id = ci.pid + WHERE + d.DATE_ID = #{dateId} + AND d.CUSTOMER_ID = #{customerId} GROUP BY ci.id @@ -129,6 +138,9 @@ INNER JOIN dim_agency di ON di.id = s.pid INNER JOIN dim_agency ci ON ci.id = di.pid INNER JOIN dim_agency p ON p.id = ci.pid + WHERE + d.DATE_ID = #{dateId} + AND d.CUSTOMER_ID = #{customerId} GROUP BY p.id