From 1350ff99535eadfa3fbe85f8824057232a29afd1 Mon Sep 17 00:00:00 2001 From: lichao <326994889@qq.com> Date: Fri, 14 Apr 2023 10:40:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=88=BF=E5=B1=8B=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/HouseCountPictureFormDTO.java | 4 + .../main/java/com/epmet/dao/IcHouseDao.java | 6 +- .../service/impl/IcHouseServiceImpl.java | 18 +++- .../src/main/resources/mapper/IcHouseDao.xml | 84 +++++++++++++++++-- 4 files changed, 100 insertions(+), 12 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseCountPictureFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseCountPictureFormDTO.java index e71cf1dfd6..451c5c6790 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseCountPictureFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseCountPictureFormDTO.java @@ -16,6 +16,10 @@ public class HouseCountPictureFormDTO implements Serializable { private String orgIdPath; + private String orgId; + + private String orgType; + private Date timeStart; private Date timeEnd; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java index f28987ad72..9f76843368 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java @@ -220,9 +220,9 @@ public interface IcHouseDao extends BaseDao { */ List selectGroupRentHouseList(GroupRentHouseFormDTO formDTO); - List getHousePurposeCount(@Param("orgId") String orgId, @Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd); + List getHousePurposeCount(@Param("orgId") String orgId,@Param("orgType") String orgType, @Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd); - List getHouseStatusCount(@Param("orgId") String orgId, @Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd); + List getHouseStatusCount(@Param("orgId") String orgId,@Param("orgType") String orgType, @Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd); - List getHousePictureList(@Param("orgId") String orgId, @Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd,@Param("purpose") String purpose,@Param("rentFlag") Integer rentFlag); + List getHousePictureList(@Param("orgId") String orgId,@Param("orgType") String orgType, @Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd,@Param("purpose") String purpose,@Param("rentFlag") Integer rentFlag); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java index 654304466c..c29c3b24e0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java @@ -418,7 +418,10 @@ public class IcHouseServiceImpl extends BaseServiceImplresultDTO.setTotal(resultDTO.getTotal()+result.getCount()) @@ -434,7 +437,11 @@ public class IcHouseServiceImpl extends BaseServiceImplresultDTO.setTotal(resultDTO.getTotal()+result.getCount()) @@ -447,7 +454,12 @@ public class IcHouseServiceImpl extends BaseServiceImpl getHousePictureList(HouseCountPictureFormDTO dto) { // 列表/导出查询 PageHelper.startPage(dto.getPageNo(), dto.getPageSize()); - List list = baseDao.getHousePictureList(dto.getOrgIdPath(),dto.getTimeStart(),dto.getTimeEnd(),dto.getPurpose(),dto.getRentFlag()); + + if (dto.getOrgType().equals("community") || dto.getOrgType().equals("street") ||dto.getOrgType().equals("district") ||dto.getOrgType().equals("city")){ + dto.setOrgType("agency"); + } + + List list = baseDao.getHousePictureList(dto.getOrgId(),dto.getOrgType(),dto.getTimeStart(),dto.getTimeEnd(),dto.getPurpose(),dto.getRentFlag()); list.forEach(entity->{ String[] agencyIds = entity.getOrgIdPath().split(":"); diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml index 23027ad996..b3ae7973eb 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -781,8 +781,32 @@ select count(*) as count,PURPOSE as type from ic_house where DEL_FLAG = 0 - and - ORG_ID_PATH like concat(#{orgId},'%') + + + AND neighbor_hood_id IN ( + select a.id from ic_neighbor_hood a + + inner join customer_agency b on a.agency_id = b.id and b.del_flag = '0' + inner join customer_grid c on a.grid_id = c.id and c.del_flag = '0' + where a.del_flag = '0' + and (a.agency_id = #{orgId} OR a.agency_pids LIKE CONCAT('%', #{orgId}, '%')) + ) + + + AND neighbor_hood_id IN ( + select id from ic_neighbor_hood + where del_flag = '0' + and grid_id = #{orgId} + ) + + + AND neighbor_hood_id IN ( + select id from ic_neighbor_hood + where del_flag = '0' + and id = #{orgId} + ) + + and CREATED_TIME >= #{timeStart} @@ -796,8 +820,32 @@ select count(*) as count,RENT_FLAG as type from ic_house where DEL_FLAG = 0 - and - ORG_ID_PATH like concat(#{orgId},'%') + + + AND neighbor_hood_id IN ( + select a.id from ic_neighbor_hood a + + inner join customer_agency b on a.agency_id = b.id and b.del_flag = '0' + inner join customer_grid c on a.grid_id = c.id and c.del_flag = '0' + where a.del_flag = '0' + and (a.agency_id = #{orgId} OR a.agency_pids LIKE CONCAT('%', #{orgId}, '%')) + ) + + + AND neighbor_hood_id IN ( + select id from ic_neighbor_hood + where del_flag = '0' + and grid_id = #{orgId} + ) + + + AND neighbor_hood_id IN ( + select id from ic_neighbor_hood + where del_flag = '0' + and id = #{orgId} + ) + + and CREATED_TIME >= #{timeStart} @@ -816,8 +864,32 @@ left join customer_grid grid on grid.id = hood.GRID_ID where house.DEL_FLAG = '0' - and - house.ORG_ID_PATH like concat(#{orgId},'%') + + + AND neighbor_hood_id IN ( + select a.id from ic_neighbor_hood a + + inner join customer_agency b on a.agency_id = b.id and b.del_flag = '0' + inner join customer_grid c on a.grid_id = c.id and c.del_flag = '0' + where a.del_flag = '0' + and (a.agency_id = #{orgId} OR a.agency_pids LIKE CONCAT('%', #{orgId}, '%')) + ) + + + AND neighbor_hood_id IN ( + select id from ic_neighbor_hood + where del_flag = '0' + and grid_id = #{orgId} + ) + + + AND neighbor_hood_id IN ( + select id from ic_neighbor_hood + where del_flag = '0' + and id = #{orgId} + ) + + and house.CREATED_TIME >= #{timeStart}