From 6cd85296280a30b222b62a4b6f246da33f7cceaa Mon Sep 17 00:00:00 2001 From: songyunpeng Date: Mon, 31 Aug 2020 09:01:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=85=E6=B0=91=E4=BF=A1=E6=81=AF=E9=87=87?= =?UTF-8?q?=E9=9B=86-=E5=AE=B6=E5=BA=AD=E4=BF=A1=E6=81=AF=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/commons/tools/utils/ExcelUtils.java | 69 +++++++- .../esua/epdc/dto/HouseBusinessInfoDTO.java | 5 + .../elink/esua/epdc/dto/HouseResidentDTO.java | 4 + .../epdc/dto/PopulationInfoOverviewDTO.java | 74 +++++++++ .../epdc/dto/PopulationInformationDTO.java | 12 ++ .../HouseBusinessInfoController.java | 4 +- .../HousingInformationController.java | 77 ++++++++- .../PopulationInformationController.java | 55 +++++++ .../esua/epdc/dao/HouseBusinessInfoDao.java | 13 +- .../elink/esua/epdc/dao/HouseResidentDao.java | 2 +- .../epdc/dao/PopulationInformationDao.java | 17 ++ .../esua/epdc/entity/HouseResidentEntity.java | 4 + .../excel/BasePopulationInformationExcel.java | 154 ++++++++++++++++++ .../excel/BaseResidentInformationExcel.java | 53 ++++++ .../epdc/excel/FamilyInformationExcel.java | 50 ++++++ .../epdc/excel/HouseBusinessInfoExcel.java | 35 +--- .../excel/populationMotorVehicleExcel.java | 43 +++++ .../service/HouseBusinessInfoService.java | 8 + .../service/PopulationInformationService.java | 26 +++ .../impl/HouseBusinessInfoServiceImpl.java | 10 +- .../impl/HouseResidentServiceImpl.java | 15 +- .../PopulationInformationServiceImpl.java | 22 ++- .../resources/mapper/HouseBusinessInfoDao.xml | 24 +++ .../resources/mapper/HouseResidentDao.xml | 8 +- .../mapper/PopulationInformationDao.xml | 32 +++- 25 files changed, 768 insertions(+), 48 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PopulationInfoOverviewDTO.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/BasePopulationInformationExcel.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/BaseResidentInformationExcel.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/FamilyInformationExcel.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/populationMotorVehicleExcel.java diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/ExcelUtils.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/ExcelUtils.java index f451aa62..1921e11b 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/ExcelUtils.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/ExcelUtils.java @@ -10,6 +10,8 @@ package com.elink.esua.epdc.commons.tools.utils; import cn.afterturn.easypoi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import com.elink.esua.epdc.commons.tools.exception.RenException; import org.apache.commons.lang3.StringUtils; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; @@ -19,10 +21,7 @@ import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.List; +import java.util.*; /** * Excel工具类 @@ -80,4 +79,66 @@ public class ExcelUtils { exportExcel(response, fileName, targetList, targetClass); } + + + /** + * Excel导出,先sourceList转换成List,再导出 + * + * @param response response + * @param fileName 文件名 + * @param sourceList 原数据List + * @param sheetNames sheet名字列表 + */ + public static void exportExcelToTargetWithSheets(HttpServletResponse response, String fileName, List sheetNames, + List> targetClassList,List... sourceList) throws Exception { + if(sheetNames.size()!=targetClassList.size() && targetClassList.size()!=sourceList.length){ + throw new RenException("参数传递出错"); + } + // 将sheets使用得map进行包装 + List> sheetsList = new ArrayList<>(); + for (int i = 0;i deptDataMap = new HashMap<>(4); + ExportParams exportParams = new ExportParams(); + exportParams.setSheetName(sheetNames.get(i)); + deptDataMap.put("title", exportParams); + // 模版导出对应得实体类型 + deptDataMap.put("entity", targetClassList.get(i)); + // sheet中要填充得数据 + deptDataMap.put("data", sourceList[i]); + sheetsList.add(deptDataMap); + } + exportExcelWithSheets(response,fileName,sheetsList); + + } + + + + /** + * 多sheetExcel导出 + * + * @param response response + * @param fileName 文件名 + * @param sheetsList 多sheet组装 + */ + public static void exportExcelWithSheets(HttpServletResponse response, String fileName, List> sheetsList) throws IOException { + + if(StringUtils.isBlank(fileName)){ + //当前日期 + fileName = DateUtils.format(new Date()); + } + Workbook workbook = null; + try { + workbook = ExcelExportUtil.exportExcel(sheetsList, ExcelType.HSSF); + } catch (Exception ex) { + workbook = ExcelExportUtil.exportExcel(sheetsList, ExcelType.XSSF); + } + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-Type", "application/vnd.ms-excel"); + response.setHeader("Content-Disposition", + "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") + ".xls"); + ServletOutputStream out = response.getOutputStream(); + workbook.write(out); + out.flush(); + out.close(); + } } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/HouseBusinessInfoDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/HouseBusinessInfoDTO.java index 66911913..c30f35d8 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/HouseBusinessInfoDTO.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/HouseBusinessInfoDTO.java @@ -94,4 +94,9 @@ public class HouseBusinessInfoDTO implements Serializable { */ private Date updatedTime; + /** + * 辖区范围 + */ + private String gridName; + } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/HouseResidentDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/HouseResidentDTO.java index 7bccde94..c63e88de 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/HouseResidentDTO.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/HouseResidentDTO.java @@ -43,6 +43,10 @@ public class HouseResidentDTO implements Serializable { * 房屋ID */ private String houseId; + /** + * 户主ID + */ + private String houseHeadId; /** * 居民ID diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PopulationInfoOverviewDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PopulationInfoOverviewDTO.java new file mode 100644 index 00000000..2a8b243d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PopulationInfoOverviewDTO.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 居民信息统计数据 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +public class PopulationInfoOverviewDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 自住数量 + */ + private Integer sinceTheLiving; + /** + * 租赁数量 + */ + private Integer rent; + /** + * 经营数量 + */ + private Integer business; + /** + * 在岗数量 + */ + private Integer employment; + /** + * 失业数量 + */ + private Integer unemployment; + /** + * 房屋数量 + */ + private Integer houseNum; + /** + * 人口数量 + */ + private Integer populationNum; + /** + * 机动车数量 + */ + private Integer motorVehicleNum; + /** + * 党员 + */ + private Integer partyMemberNum; + + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PopulationInformationDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PopulationInformationDTO.java index ae980b21..2a1bf37d 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PopulationInformationDTO.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PopulationInformationDTO.java @@ -239,6 +239,10 @@ public class PopulationInformationDTO implements Serializable { */ private String residentId; /** + * 户主ID + */ + private String houseHeadId; + /** * 房屋ID */ private String houseId; @@ -257,4 +261,12 @@ public class PopulationInformationDTO implements Serializable { */ private String gridNames; + /** + * 房屋地址 ,隔开 + */ + private String houseAddress; + + + + } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/HouseBusinessInfoController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/HouseBusinessInfoController.java index d980eac3..7faa763d 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/HouseBusinessInfoController.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/HouseBusinessInfoController.java @@ -51,7 +51,7 @@ public class HouseBusinessInfoController { @GetMapping("page") public Result> page(@RequestParam Map params){ - PageData page = houseBusinessInfoService.page(params); + PageData page = houseBusinessInfoService.listPage(params); return new Result>().ok(page); } @@ -88,7 +88,7 @@ public class HouseBusinessInfoController { @GetMapping("export") public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { List list = houseBusinessInfoService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, HouseBusinessInfoExcel.class); + ExcelUtils.exportExcelToTarget(response, "经营信息", list, HouseBusinessInfoExcel.class); } } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/HousingInformationController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/HousingInformationController.java index eaf1cd87..d80fdcc2 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/HousingInformationController.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/HousingInformationController.java @@ -23,15 +23,19 @@ import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.validator.AssertUtils; import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; -import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; import com.elink.esua.epdc.dto.HousingInformationDTO; +import com.elink.esua.epdc.excel.BasePopulationInformationExcel; +import com.elink.esua.epdc.excel.BaseResidentInformationExcel; import com.elink.esua.epdc.excel.HousingInformationExcel; import com.elink.esua.epdc.service.HousingInformationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import java.math.BigDecimal; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -89,4 +93,75 @@ public class HousingInformationController { ExcelUtils.exportExcelToTarget(response, null, list, HousingInformationExcel.class); } + /** + * @Description 导出模板 + * @Author songyunpeng + * @Date 2020/8/27 + * @Param [params, response] + * @return void + **/ + @GetMapping("exportModule") + public void exportModule(@RequestParam Map params, HttpServletResponse response) throws Exception { + List basePopulationInformationExcels = new ArrayList<>(1); + List baseResidentInformationExcels = new ArrayList<>(1); + BasePopulationInformationExcel basePopulationInformationExcel = new BasePopulationInformationExcel(); + basePopulationInformationExcel.setHouseAddress("XX家园XX号楼XX单元XXX"); + basePopulationInformationExcel.setBuyingTime("2020-02-02"); + basePopulationInformationExcel.setHouseArea(new BigDecimal("0")); + basePopulationInformationExcel.setPropertyOwner(""); + basePopulationInformationExcel.setPropertyOwnerIdentityNo(""); + basePopulationInformationExcel.setPropertyOwnerMobile(""); + basePopulationInformationExcel.setHouseUse(""); + basePopulationInformationExcel.setTenantName(""); + basePopulationInformationExcel.setTenantPhone(""); + basePopulationInformationExcel.setTenantIdentityNo(""); + basePopulationInformationExcel.setEnterpriseName(""); + basePopulationInformationExcel.setSocialUniformCode(""); + basePopulationInformationExcel.setLegalRepresentative(""); + basePopulationInformationExcel.setEnterprisePhone(""); + basePopulationInformationExcel.setResidentsName(""); + basePopulationInformationExcel.setResidentsSex(""); + basePopulationInformationExcel.setResidentsNation(""); + basePopulationInformationExcel.setEducationLevel(""); + basePopulationInformationExcel.setPoliticsStatus(""); + basePopulationInformationExcel.setJoinTime("2020-02-02"); + basePopulationInformationExcel.setOrganizationalRelationshipLocation(""); + basePopulationInformationExcel.setResidentsIdentityNo(""); + basePopulationInformationExcel.setResidentsPhone(""); + basePopulationInformationExcel.setBodyStatus(""); + basePopulationInformationExcel.setMaritalStatus(""); + basePopulationInformationExcel.setAccountType(""); + basePopulationInformationExcel.setMilitaryService(""); + basePopulationInformationExcel.setHouseholdRegistrationPlace(""); + basePopulationInformationExcel.setEmploymentStatus(""); + basePopulationInformationExcel.setCurrentEmployer(""); + basePopulationInformationExcel.setCurrentEmployerAddress(""); + basePopulationInformationExcel.setUnemploymentReason(""); + basePopulationInformationExcel.setReemploymentPermit(""); + basePopulationInformationExcel.setUnemploymentRegister(""); + basePopulationInformationExcel.setUnemploymentRegisterTime("2020-02-02"); + basePopulationInformationExcel.setFamilyCategory(""); + basePopulationInformationExcel.setHelpStatus(""); + basePopulationInformationExcel.setMotorVehicleNum(0); + basePopulationInformationExcel.setMotorVehicleCategory(""); + basePopulationInformationExcel.setDogStatus(""); + BaseResidentInformationExcel baseResidentInformationExcel = new BaseResidentInformationExcel(); + baseResidentInformationExcel.setResidentsIdentityNo(""); + baseResidentInformationExcel.setHouseHeadRelation(""); + baseResidentInformationExcel.setResidentsName(""); + baseResidentInformationExcel.setResidentsSex(""); + baseResidentInformationExcel.setResidentsNation(""); + baseResidentInformationExcel.setCurrentEmployer(""); + baseResidentInformationExcel.setCurrentAddress(""); + basePopulationInformationExcels.add(basePopulationInformationExcel); + baseResidentInformationExcels.add(baseResidentInformationExcel); + List> classes = new ArrayList<>(2); + classes.add(basePopulationInformationExcel.getClass()); + classes.add(baseResidentInformationExcel.getClass()); + List sheetNames = new ArrayList<>(2); + sheetNames.add("房屋信息和户主信息"); + sheetNames.add("居民信息"); + ExcelUtils.exportExcelToTargetWithSheets(response, "居民信息录入模板",sheetNames,classes,basePopulationInformationExcels,baseResidentInformationExcels); + } + } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/PopulationInformationController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/PopulationInformationController.java index 3400c266..f761526e 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/PopulationInformationController.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/PopulationInformationController.java @@ -26,8 +26,11 @@ import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.dto.PopulationInfoOverviewDTO; import com.elink.esua.epdc.dto.PopulationInformationDTO; +import com.elink.esua.epdc.excel.FamilyInformationExcel; import com.elink.esua.epdc.excel.PopulationInformationExcel; +import com.elink.esua.epdc.excel.populationMotorVehicleExcel; import com.elink.esua.epdc.service.PopulationInformationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -109,5 +112,57 @@ public class PopulationInformationController { } return new Result(); } + /** + * @Description 获取机动车信息列表 + * @Author songyunpeng + * @Date 2020/8/26 + * @Param [params] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + @GetMapping("motorVehicle/page") + public Result> motorVehiclePage(@RequestParam Map params){ + PageData page = populationInformationService.motorVehiclePage(params); + return new Result>().ok(page); + } + /** + * @Description 机动车信息列表导出 + * @Author songyunpeng + * @Date 2020/8/26 + * @Param [params, response] + * @return void + **/ + @GetMapping("motorVehicle/export") + public void motorVehicleExport(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = populationInformationService.motorVehicleList(params); + ExcelUtils.exportExcelToTarget(response, "机动车信息", list, populationMotorVehicleExcel.class); + } + /** + * @Description 家庭信息导出 + * @Author songyunpeng + * @Date 2020/8/28 + * @Param [params, response] + * @return void + **/ + @GetMapping("getFamily/export") + public void getFamilyExport(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = populationInformationService.list(params); + ExcelUtils.exportExcelToTarget(response, "家庭信息", list, FamilyInformationExcel.class); + } + + + + + /** + * @Description 获取居民信息采集总览数据 + * @Author songyunpeng + * @Date 2020/8/27 + * @Param [] + * @return com.elink.esua.epdc.dto.PopulationInfoOverviewDTO + **/ + @GetMapping("getPopulationInfoOverview") + public PopulationInfoOverviewDTO getPopulationInfoOverview() { + return populationInformationService.getPopulationInfoOverview(); + } + } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/HouseBusinessInfoDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/HouseBusinessInfoDao.java index 369cb278..ac725701 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/HouseBusinessInfoDao.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/HouseBusinessInfoDao.java @@ -18,9 +18,13 @@ package com.elink.esua.epdc.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.HouseBusinessInfoDTO; import com.elink.esua.epdc.entity.HouseBusinessInfoEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; +import java.util.Map; + /** * 房屋经营信息表 * @@ -29,5 +33,12 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface HouseBusinessInfoDao extends BaseDao { - + /** + * @Description 前端列表 + * @Author songyunpeng + * @Date 2020/8/26 + * @Param [params] + * @return java.util.List + **/ + List selectHouseBusinessInfoDTO(Map params); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/HouseResidentDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/HouseResidentDao.java index 27d79685..deddb218 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/HouseResidentDao.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/HouseResidentDao.java @@ -35,7 +35,7 @@ import java.util.Map; @Mapper public interface HouseResidentDao extends BaseDao { /** - * @Description 根据房子ID查询居住人信息 + * @Description 根据户主ID查询居住人信息 * @Author songyunpeng * @Date 2020/8/21 * @Param [params] diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PopulationInformationDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PopulationInformationDao.java index ef2838d3..594f69a7 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PopulationInformationDao.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PopulationInformationDao.java @@ -18,6 +18,7 @@ package com.elink.esua.epdc.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.PopulationInfoOverviewDTO; import com.elink.esua.epdc.dto.PopulationInformationDTO; import com.elink.esua.epdc.entity.PopulationInformationEntity; import org.apache.ibatis.annotations.Mapper; @@ -67,4 +68,20 @@ public interface PopulationInformationDao extends BaseDao **/ PopulationInformationDTO selectDetailOfPopulationInformationDTO(@Param("id") String id); + /** + * @Description 获取机动车列表信息 + * @Author songyunpeng + * @Date 2020/8/26 + * @Param [params] + * @return java.util.List + **/ + List motorVehiclePage(Map params); + /** + * @Description 获取居民信息采集总览数据 + * @Author songyunpeng + * @Date 2020/8/27 + * @Param [] + * @return com.elink.esua.epdc.dto.PopulationInfoOverviewDTO + **/ + PopulationInfoOverviewDTO getPopulationInfoOverview(); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/HouseResidentEntity.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/HouseResidentEntity.java index 07fbd2c5..d406ce11 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/HouseResidentEntity.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/HouseResidentEntity.java @@ -39,6 +39,10 @@ public class HouseResidentEntity extends BaseEpdcEntity { * 房屋ID */ private String houseId; + /** + * 户主ID + */ + private String houseHeadId; /** * 居民ID diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/BasePopulationInformationExcel.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/BasePopulationInformationExcel.java new file mode 100644 index 00000000..8bae7307 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/BasePopulationInformationExcel.java @@ -0,0 +1,154 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 人口信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +public class BasePopulationInformationExcel { + + @Excel(name = "房屋地址") + private String houseAddress; + + @Excel(name = "购房时间") + private String buyingTime; + + @Excel(name = "房屋面积") + private BigDecimal houseArea; + + @Excel(name = "产权人姓名") + private String propertyOwner; + + @Excel(name = "产权人身份证号") + private String propertyOwnerIdentityNo; + + @Excel(name = "联系电话") + private String propertyOwnerMobile; + + @Excel(name = "房屋用途",replace = {"自住_0","租赁_1","经营_2"}) + private String houseUse; + + @Excel(name = "承租人姓名") + private String tenantName; + + @Excel(name = "承租人电话") + private String tenantPhone; + + @Excel(name = "承租人身份证号") + private String tenantIdentityNo; + + @Excel(name = "企业名称") + private String enterpriseName; + + @Excel(name = "社会统一代码") + private String socialUniformCode; + + @Excel(name = "法人代表") + private String legalRepresentative; + + @Excel(name = "电话") + private String enterprisePhone; + + @Excel(name = "户主姓名") + private String residentsName; + + @Excel(name = "性别",replace = {"女_0","男_1"}) + private String residentsSex; + + @Excel(name = "民族") + private String residentsNation; + + @Excel(name = "文化程度") + private String educationLevel; + + @Excel(name = "政治面貌",replace = {"群众_0","党员_1"}) + private String politicsStatus; + + @Excel(name = "入党时间") + private String joinTime; + + @Excel(name = "组织关系所在地") + private String organizationalRelationshipLocation; + + @Excel(name = "身份证号码") + private String residentsIdentityNo; + + @Excel(name = "联系电话") + private String residentsPhone; + + @Excel(name = "身体状况",replace = {"病残_0","健康_1"}) + private String bodyStatus; + + @Excel(name = "婚姻状况",replace = {"未婚_0","已婚_1"}) + private String maritalStatus; + + @Excel(name = "户口类型",replace = {"城镇_0","农业_1"}) + private String accountType; + + @Excel(name = "服兵役",replace = {"否_0","是_1"}) + private String militaryService; + + @Excel(name = "户籍地") + private String householdRegistrationPlace; + + @Excel(name = "就业情况",replace = {"在岗_0","就业_1"}) + private String employmentStatus; + + @Excel(name = "现工作单位") + private String currentEmployer; + + @Excel(name = "现单位地址") + private String currentEmployerAddress; + + @Excel(name = "失业原因",replace = {"原单位破产_0","解除合同_1","效益不好_2","减员_3","其他_4"}) + private String unemploymentReason; + + @Excel(name = "再就业优惠证",replace = {"无_0","有_1"}) + private String reemploymentPermit; + + @Excel(name = "失业登记",replace = {"否_0","是_1"}) + private String unemploymentRegister; + + @Excel(name = "失业登记时间") + private String unemploymentRegisterTime; + + @Excel(name = "家庭类别",replace = {"普通家庭_0","军烈_2","优抚_3","困难家庭_6"}) + private String familyCategory; + + @Excel(name = "救助情况",replace = {"低保_0","大病_1","廉租_2","教育_3","临时_4","其他_5"}) + private String helpStatus; + + @Excel(name = "机动车数量") + private Integer motorVehicleNum; + + @Excel(name = "机动车类型",replace = {"轿车_0","摩托_1","其他_2"}) + private String motorVehicleCategory; + + @Excel(name = "宠物犬状况",replace = {"无_0","有_1"}) + private String dogStatus; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/BaseResidentInformationExcel.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/BaseResidentInformationExcel.java new file mode 100644 index 00000000..2e7879e9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/BaseResidentInformationExcel.java @@ -0,0 +1,53 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * 人口信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +public class BaseResidentInformationExcel { + + @Excel(name = "户主身份证号码") + private String residentsIdentityNo; + + @Excel(name = "与户主关系",replace = {"子女_0","夫妻_1","其他_2","父母_3"}) + private String houseHeadRelation; + + @Excel(name = "户主姓名") + private String residentsName; + + @Excel(name = "性别",replace = {"女_0","男_1"}) + private String residentsSex; + + @Excel(name = "民族") + private String residentsNation; + + @Excel(name = "现工作单位") + private String currentEmployer; + + @Excel(name = "现居住地") + private String currentAddress; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/FamilyInformationExcel.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/FamilyInformationExcel.java new file mode 100644 index 00000000..506faff9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/FamilyInformationExcel.java @@ -0,0 +1,50 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * 人口信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +public class FamilyInformationExcel { + + @Excel(name = "所属辖区") + private String gridNames; + + @Excel(name = "户主姓名") + private String residentsName; + + @Excel(name = "救助情况",replace = {"低保_0", "大病_1","廉租_2","教育_3","临时_4","其他_5"}) + private String helpStatus; + + + @Excel(name = "家庭类别",replace = {"普通家庭_0", "军烈家庭_1","优抚家庭_2","困难家庭_3"}) + private String familyCategory; + + @Excel(name = "家庭住址") + private String houseAddress; + + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/HouseBusinessInfoExcel.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/HouseBusinessInfoExcel.java index c1e873cb..f5e5bb6d 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/HouseBusinessInfoExcel.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/HouseBusinessInfoExcel.java @@ -20,8 +20,6 @@ package com.elink.esua.epdc.excel; import cn.afterturn.easypoi.excel.annotation.Excel; import lombok.Data; -import java.util.Date; - /** * 房屋经营信息表 * @@ -31,41 +29,26 @@ import java.util.Date; @Data public class HouseBusinessInfoExcel { - @Excel(name = "主键") - private String id; - - @Excel(name = "企业名称") - private String enterpriseName; - - @Excel(name = "社会统一代码") - private String socialUniformCode; + @Excel(name = "辖区范围") + private String gridName; - @Excel(name = "法人代表") + @Excel(name = "经营者姓名") private String legalRepresentative; - @Excel(name = "电话") + + @Excel(name = "联系电话") private String enterprisePhone; - @Excel(name = "房屋ID") - private String houseId; + @Excel(name = "企业名称") + private String enterpriseName; - @Excel(name = "删除标识 (0:否 1:是)") - private String delFlag; + @Excel(name = "企业注册号") + private String socialUniformCode; - @Excel(name = "乐观锁") - private Integer revision; - @Excel(name = "创建人") - private String createdBy; - @Excel(name = "创建时间") - private Date createdTime; - @Excel(name = "更新人") - private String updatedBy; - @Excel(name = "更新时间") - private Date updatedTime; } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/populationMotorVehicleExcel.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/populationMotorVehicleExcel.java new file mode 100644 index 00000000..a4647f15 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/populationMotorVehicleExcel.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * 人口信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +public class populationMotorVehicleExcel { + + + @Excel(name = "车主姓名") + private String residentsName; + + @Excel(name = "联系电话") + private String residentsPhone; + + @Excel(name = "机动车类型",replace = {"轿车_0", "摩托_1","其他_2"}) + private String motorVehicleCategory; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/HouseBusinessInfoService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/HouseBusinessInfoService.java index 78c07e5d..c4fc6c8c 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/HouseBusinessInfoService.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/HouseBusinessInfoService.java @@ -101,4 +101,12 @@ public interface HouseBusinessInfoService extends BaseService + **/ + PageData listPage(Map params); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PopulationInformationService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PopulationInformationService.java index d1992675..d2ff2ed8 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PopulationInformationService.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PopulationInformationService.java @@ -20,6 +20,7 @@ package com.elink.esua.epdc.service; import com.elink.esua.epdc.commons.mybatis.service.BaseService; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.PopulationInfoOverviewDTO; import com.elink.esua.epdc.dto.PopulationInformationDTO; import com.elink.esua.epdc.entity.PopulationInformationEntity; @@ -117,4 +118,29 @@ public interface PopulationInformationService extends BaseService **/ PageData listPage(Map params); + /** + * @Description 获取机动车列表信息 + * @Author songyunpeng + * @Date 2020/8/26 + * @Param [params] + * @return com.elink.esua.epdc.commons.tools.page.PageData + **/ + PageData motorVehiclePage(Map params); + + /** + * @Description 获取机动车列表信息 --导出查询 + * @Author songyunpeng + * @Date 2020/8/26 + * @Param [params] + * @return com.elink.esua.epdc.commons.tools.page.PageData + **/ + List motorVehicleList(Map params); + /** + * @Description 获取居民信息采集总览数据 + * @Author songyunpeng + * @Date 2020/8/28 + * @Param [] + * @return com.elink.esua.epdc.dto.PopulationInfoOverviewDTO + **/ + PopulationInfoOverviewDTO getPopulationInfoOverview(); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HouseBusinessInfoServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HouseBusinessInfoServiceImpl.java index 9f47695c..23698d63 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HouseBusinessInfoServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HouseBusinessInfoServiceImpl.java @@ -61,9 +61,7 @@ public class HouseBusinessInfoServiceImpl extends BaseServiceImpl list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, HouseBusinessInfoDTO.class); + return baseDao.selectHouseBusinessInfoDTO(params); } private QueryWrapper getWrapper(Map params){ @@ -113,4 +111,10 @@ public class HouseBusinessInfoServiceImpl extends BaseServiceImpl listPage(Map params) { + IPage page = getPage(params); + List list = baseDao.selectHouseBusinessInfoDTO(params); + return new PageData<>(list, page.getTotal()); } + } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HouseResidentServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HouseResidentServiceImpl.java index 52850e21..01fa0c2f 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HouseResidentServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HouseResidentServiceImpl.java @@ -326,6 +326,9 @@ public class HouseResidentServiceImpl extends BaseServiceImpl listPage(Map params) { IPage page = getPage(params); + PopulationInformationDTO populationInformationDTO = populationInformationService.getHouseHeadInfo(params.get("houseId") + ""); + params.put("houseHeadId",populationInformationDTO.getId()); List list = baseDao.selectListOfPopulationInformationDTO(params); return new PageData<>(list, page.getTotal()); } @@ -341,8 +346,13 @@ public class HouseResidentServiceImpl extends BaseServiceImpl list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, PopulationInformationDTO.class); + return baseDao.selectListOfPopulationInformationDTO(params); } private QueryWrapper getWrapper(Map params){ @@ -196,4 +195,21 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl(list, page.getTotal()); } + @Override + public PageData motorVehiclePage(Map params) { + IPage page = getPage(params); + List list = baseDao.motorVehiclePage(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public List motorVehicleList(Map params) { + return baseDao.motorVehiclePage(params); + } + + @Override + public PopulationInfoOverviewDTO getPopulationInfoOverview() { + return baseDao.getPopulationInfoOverview(); + } + } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/HouseBusinessInfoDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/HouseBusinessInfoDao.xml index 9a99f23e..10d27fd2 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/HouseBusinessInfoDao.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/HouseBusinessInfoDao.xml @@ -17,6 +17,30 @@ + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/HouseResidentDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/HouseResidentDao.xml index 6167e9e9..42860784 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/HouseResidentDao.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/HouseResidentDao.xml @@ -30,9 +30,10 @@ t.RESIDENTS_PHONE, t.CURRENT_EMPLOYER, t.CURRENT_ADDRESS, - t1.HOUSE_HEAD_RELATION + t1.HOUSE_HEAD_RELATION, + t1.HOUSE_HEAD_ID from epdc_population_information t left join epdc_house_resident t1 on t1.RESIDENT_ID = t.ID - where t.DEL_FLAG ='0' and t1.DEL_FLAG ='0' and t1.IS_HOUSE_HEAD = '0' and t1.HOUSE_ID = #{houseId} + where t.DEL_FLAG ='0' and t1.DEL_FLAG ='0' and t1.IS_HOUSE_HEAD = '0' and t1.HOUSE_HEAD_ID = #{houseHeadId} order by t1.CREATED_TIME desc diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PopulationInformationDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PopulationInformationDao.xml index 22a26d73..85d48e97 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PopulationInformationDao.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PopulationInformationDao.xml @@ -90,11 +90,11 @@ resultType="com.elink.esua.epdc.dto.PopulationInformationDTO"> select t.ID,t.RESIDENTS_NAME,t.RESIDENTS_SEX,t.RESIDENTS_PHONE,t.RESIDENTS_IDENTITY_NO,t.RESIDENTS_NATION,t.HOUSEHOLD_REGISTRATION_PLACE, - group_concat(substring_index(t2.ALL_DEPT_NAMES,'-',-1)) as gridNames + group_concat(substring_index(t2.ALL_DEPT_NAMES,'-',-1)) as gridNames,t.HELP_STATUS,t.FAMILY_CATEGORY,group_concat(t2.HOUSE_ADDRESS) as houseAddress from epdc_population_information t left join epdc_house_resident t1 on t.ID = t1.RESIDENT_ID left join epdc_housing_information t2 on t1.HOUSE_ID = t2.ID - where t.DEL_FLAG ='0' and t1.DEL_FLAG ='0' and t2.DEL_FLAG ='0' and t.RESIDENTS_IDENTITY_NO is not null + where t.DEL_FLAG ='0' and t1.DEL_FLAG ='0' and t2.DEL_FLAG ='0' and t.RESIDENTS_IDENTITY_NO is not null and t.RESIDENTS_IDENTITY_NO != '' AND (find_in_set(#{streetId},t2.PARENT_DEPT_IDS) OR find_in_set(#{streetId},t2.ALL_DEPT_IDS)) @@ -110,6 +110,8 @@ and t.RESIDENTS_NAME like concat('%',#{residentsName},'%') and t.RESIDENTS_PHONE like concat('%',#{residentsPhone},'%') and t.RESIDENTS_IDENTITY_NO like concat('%',#{residentsIdentityNo},'%') + and FAMILY_CATEGORY = #{familyCategory} + and HELP_STATUS = #{helpStatus} group by t.ID order by t.CREATED_TIME desc @@ -138,6 +140,32 @@ left join epdc_housing_information t2 on t1.HOUSE_ID = t2.ID where t.DEL_FLAG ='0' and t1.DEL_FLAG ='0' and t2.DEL_FLAG ='0' and t.ID = #{id}; + + \ No newline at end of file