diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/IcHouseDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/IcHouseDao.xml index de4b58c7f7..297d15dbd3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/IcHouseDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/IcHouseDao.xml @@ -104,23 +104,21 @@ SELECT n.ID as NEIGHBOURHOODS_ID, n.NEIGHBOR_HOOD_NAME, - g.CUSTOMER_ID, + n.CUSTOMER_ID, g.id AS GRID_ID, g.PID, g.PIDS, 1 AS neighbourhoodsCount FROM ic_neighbor_hood n - LEFT JOIN customer_grid g ON n.GRID_ID = g.id + LEFT JOIN customer_grid g ON n.GRID_ID = g.id and g.DEL_FLAG = '0' AND n.CREATED_TIME < DATE_ADD( DATE_FORMAT(#{dateId},'%Y-%m-%d'), INTERVAL 1 DAY ) - AND n.DEL_FLAG = '0' - WHERE - g.DEL_FLAG = '0' + WHERE n.DEL_FLAG = '0' - AND g.CUSTOMER_ID = #{customerId} + AND n.CUSTOMER_ID = #{customerId} GROUP BY - g.CUSTOMER_ID; + n.CUSTOMER_ID,n.ID;