From 221b500a8673d3a44779674f5e17338108a2fbad Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 12 Apr 2023 12:47:44 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=83=9F=E5=8F=B0=E5=B1=85=E6=B0=91?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/resi/ResiPortrayalCommonFormDTO.java | 14 +++- .../result/resi/ResiPortrayalDetailDTO.java | 51 ++++++++++++ .../controller/IcResiUserController.java | 18 +++++ .../java/com/epmet/dao/IcResiUserDao.java | 15 ++++ .../com/epmet/service/IcResiUserService.java | 16 +++- .../service/impl/IcResiUserServiceImpl.java | 49 ++++++++++++ .../main/resources/mapper/IcResiUserDao.xml | 77 +++++++++++++++++-- 7 files changed, 230 insertions(+), 10 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/resi/ResiPortrayalDetailDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/resi/ResiPortrayalCommonFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/resi/ResiPortrayalCommonFormDTO.java index 9679258c91..d5f763ceb4 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/resi/ResiPortrayalCommonFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/resi/ResiPortrayalCommonFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.form.resi; +import com.epmet.commons.tools.dto.form.PageFormDTO; import lombok.Data; /** @@ -8,7 +9,7 @@ import lombok.Data; * @Date 2023/4/11 17:03 */ @Data -public class ResiPortrayalCommonFormDTO { +public class ResiPortrayalCommonFormDTO extends PageFormDTO { /** * /gov/org/customeragency/agencygridtree返回的agencyId */ @@ -17,5 +18,16 @@ public class ResiPortrayalCommonFormDTO { * /gov/org/customeragency/agencygridtree返回level=grid时,orgType:grid;其他情况orgType:agency */ private String orgType; + + /** + * 查询居民列表 + * 年龄饼图/学历饼图返回的code + */ + private String code; + /** + * 学历:education + * 年龄:age + */ + private String codeType; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/resi/ResiPortrayalDetailDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/resi/ResiPortrayalDetailDTO.java new file mode 100644 index 0000000000..a2f606cb3a --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/resi/ResiPortrayalDetailDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.result.resi; + +import lombok.Data; + +/** + * @Description 烟台居民画像,居民列表 + * @Author yzm + * @Date 2023/4/12 10:10 + */ +@Data +public class ResiPortrayalDetailDTO { + /** + * 居民id + */ + private String icResiUserId; + /** + * 姓名 + */ + private String name; + /** + * 手机号 + */ + private String mobile; + /** + * 性别:1男;2女;0未知 + */ + private String gender; + /** + * 性别名称 + */ + private String genderName; + /** + * 身份证 + */ + private String idCard; + /** + * 年龄 + */ + private Integer age; + /** + * 学历key + */ + private String educationCode; + /** + * 学历 + */ + private String educationName; + + private String birthday; +} + diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index b06cd27b4e..15c9688fe1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -63,6 +63,7 @@ import com.epmet.dto.form.resi.ResiPortrayalCommonFormDTO; import com.epmet.dto.result.*; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.resi.IcResiNonDynamicResultDTO; +import com.epmet.dto.result.resi.ResiPortrayalDetailDTO; import com.epmet.dto.result.resi.ResiPortrayalResultDTO; import com.epmet.enums.IcResiUserTableEnum; import com.epmet.excel.PartyMemberAgeExportExcel; @@ -1555,5 +1556,22 @@ public class IcResiUserController implements ResultDataResolver { return new Result>().ok(icResiUserService.queryEducationDistribute(tokenDto.getCustomerId(),tokenDto.getUserId(),formDTO.getOrgId(), formDTO.getOrgType())); } + /** + * 烟台需求:https://modao.cc/app/DUshpXWirii6amoDQsb8OP#screen=slfbvoz5w4z9f98 + * 居民画像,居民列表 + * + * @param tokenDto + * @param formDTO + * @return + */ + @MaskResponse(fieldNames = {"mobile", "idCard"},fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD}) + @PostMapping("portrayal-list") + public Result> queryPortrayalResiList(@LoginUser TokenDto tokenDto, @RequestBody ResiPortrayalCommonFormDTO formDTO) { + return new Result>().ok(icResiUserService.queryPortrayalResiList(tokenDto.getCustomerId(), tokenDto.getUserId(), + formDTO.getPageNo(), formDTO.getPageSize(), + formDTO.getOrgId(), formDTO.getOrgType(), + formDTO.getCodeType(), + formDTO.getCode())); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index a351127c33..f69b949563 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -24,6 +24,7 @@ import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.IcVolunteerPolyDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.dto.result.resi.ResiPortrayalDetailDTO; import com.epmet.dto.result.resi.ResiPortrayalResultDTO; import com.epmet.entity.IcResiUserEntity; import org.apache.ibatis.annotations.MapKey; @@ -466,4 +467,18 @@ public interface IcResiUserDao extends BaseDao { List selectAgeAgeDistribute(@Param("customerId") String customerId, @Param("orgId") String orgId, @Param("orgType") String orgType); + + /** + * @param customerId + * @param orgId + * @param orgType + * @param codeType 学历:education 年龄:age + * @param code + * @return 居民画像,居民列表 + */ + List selectPortrayalResiList(@Param("customerId") String customerId, + @Param("orgId") String orgId, + @Param("orgType") String orgType, + @Param("codeType")String codeType, + @Param("code") String code); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java index 98b9e2acf1..c43853500a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java @@ -28,6 +28,7 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.resi.IcResiNonDynamicResultDTO; +import com.epmet.dto.result.resi.ResiPortrayalDetailDTO; import com.epmet.dto.result.resi.ResiPortrayalResultDTO; import com.epmet.entity.IcResiUserEntity; import com.epmet.excel.support.ExportResiUserItemDTO; @@ -554,7 +555,7 @@ public interface IcResiUserService extends BaseService { * @param orgType * @return */ - List queryAgeDistribute(String customerId,String staffId,String orgId, String orgType); + List queryAgeDistribute(String customerId, String staffId, String orgId, String orgType); /** * 烟台需求:https://modao.cc/app/DUshpXWirii6amoDQsb8OP#screen=slfbvoz5w4z9f98 @@ -565,5 +566,16 @@ public interface IcResiUserService extends BaseService { * @param orgType agency/grid * @return */ - List queryEducationDistribute(String customerId,String staffId,String orgId, String orgType); + List queryEducationDistribute(String customerId, String staffId, String orgId, String orgType); + + /** + * 烟台需求:https://modao.cc/app/DUshpXWirii6amoDQsb8OP#screen=slfbvoz5w4z9f98 + * 居民画像,居民列表 + * + * @return + */ + PageData queryPortrayalResiList(String customerId, String staffId, + Integer pageNo, Integer pageSize, + String orgId, String orgType, + String codeType,String code); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index b6bd46e8fa..97867f7508 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -62,6 +62,7 @@ import com.epmet.dto.result.*; import com.epmet.dto.result.demand.IcResiDemandDictDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.resi.IcResiNonDynamicResultDTO; +import com.epmet.dto.result.resi.ResiPortrayalDetailDTO; import com.epmet.dto.result.resi.ResiPortrayalResultDTO; import com.epmet.entity.*; import com.epmet.enums.RenHuConditionEnum; @@ -3932,14 +3933,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl queryPortrayalResiList(String customerId, String staffId, + Integer pageNo, Integer pageSize, + String orgId, String orgType, + String codeType, + String code) { + // 获取文化程度字典 + DictListFormDTO dictFormDTO = new DictListFormDTO(); + dictFormDTO.setDictType(DictTypeEnum.EDUCATION.getCode()); + Result> dictResult = epmetAdminOpenFeignClient.dictList(dictFormDTO); + if (!dictResult.success() || CollectionUtils.isEmpty(dictResult.getData())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "学历字典获取失败", "学历字典获取失败"); + } + Map educationMap = dictResult.getData().stream().collect(Collectors.toMap(DictListResultDTO::getValue, DictListResultDTO::getLabel)); + + if (StringUtils.isBlank(orgId)) { + orgId = CustomerStaffRedis.getStaffInfo(customerId, staffId).getAgencyId(); + orgType = OrgTypeEnum.AGENCY.getCode(); + } + PageHelper.startPage(pageNo, pageSize); + List list = baseDao.selectPortrayalResiList(customerId, orgId, orgType,codeType, code); + list.forEach(resi -> { + // 学历名称 + resi.setEducationName(educationMap.get(resi.getEducationCode())); + }); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal(), pageSize); + } + } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 107980a03c..3ca4f4c8cc 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -1546,13 +1546,13 @@ from ( SELECT u.ID, - YEAR(NOW())-SUBSTR(u.ID_CARD, 7, 4) as age, + YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) as age, ( - case when YEAR(NOW())-SUBSTR(u.ID_CARD, 7, 4) < 50 then '0' - when YEAR(NOW())-SUBSTR(u.ID_CARD, 7, 4) >=50 and YEAR(NOW())-SUBSTR(u.ID_CARD, 7, 4) <=59 then '1' - when YEAR(NOW())-SUBSTR(u.ID_CARD, 7, 4) >=60 and YEAR(NOW())-SUBSTR(u.ID_CARD, 7, 4) <=69 then '2' - when YEAR(NOW())-SUBSTR(u.ID_CARD, 7, 4) >=70 and YEAR(NOW())-SUBSTR(u.ID_CARD, 7, 4) <=79 then '3' - when YEAR(NOW())-SUBSTR(u.ID_CARD, 7, 4) >=80 then '4' + case when YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) < 50 then '0' + when YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) >=50 and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) <=59 then '1' + when YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) >=60 and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) <=69 then '2' + when YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) >=70 and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) <=79 then '3' + when YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) >=80 then '4' end ) as `code` FROM @@ -1560,8 +1560,9 @@ WHERE u.DEL_FLAG = '0' AND u.CUSTOMER_ID = #{customerId} - AND u.ID_CARD IS NOT NULL and u.`STATUS`='0' + and u.BIRTHDAY is not null + and u.BIRTHDAY !='' AND ( u.AGENCY_ID = #{orgId} OR u.PIDS LIKE concat('%',#{orgId},'%') ) @@ -1571,4 +1572,66 @@ )temp group by temp.`code` + + + From 45a7faa6c1a376aae2b6fbe8bbe3770257432c37 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 12 Apr 2023 13:25:44 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E7=83=9F=E5=8F=B0=E5=B1=85=E6=B0=91?= =?UTF-8?q?=E5=88=97=E8=A1=A8daochu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/resi/ResiPortrayalDetailDTO.java | 25 +++++++++- .../controller/IcResiUserController.java | 50 +++++++++++++++++-- 2 files changed, 71 insertions(+), 4 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/resi/ResiPortrayalDetailDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/resi/ResiPortrayalDetailDTO.java index a2f606cb3a..e002b95d5d 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/resi/ResiPortrayalDetailDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/resi/ResiPortrayalDetailDTO.java @@ -1,5 +1,8 @@ package com.epmet.dto.result.resi; +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; import lombok.Data; /** @@ -12,40 +15,60 @@ public class ResiPortrayalDetailDTO { /** * 居民id */ + @ExcelIgnore private String icResiUserId; /** * 姓名 */ + @ExcelProperty(value = "姓名") + @ColumnWidth(25) private String name; /** * 手机号 */ + @ExcelProperty(value = "手机号") + @ColumnWidth(25) private String mobile; /** * 性别:1男;2女;0未知 */ + @ExcelIgnore private String gender; /** * 性别名称 */ + @ExcelProperty(value = "性别") + @ColumnWidth(25) private String genderName; /** * 身份证 */ + @ExcelProperty(value = "身份证号") + @ColumnWidth(25) private String idCard; + + @ExcelProperty(value = "出生日期") + @ColumnWidth(25) + private String birthday; + /** * 年龄 */ + @ExcelProperty(value = "年龄") + @ColumnWidth(10) private Integer age; /** * 学历key */ + @ExcelIgnore private String educationCode; /** * 学历 */ + @ExcelProperty(value = "学历") + @ColumnWidth(25) private String educationName; - private String birthday; + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index 15c9688fe1..68aef04cda 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -466,7 +466,6 @@ public class IcResiUserController implements ResultDataResolver { /** * desc: 导出居民信息 * - * @param customerId * @param tokenDto * @param pageFormDTO * @param response @@ -621,7 +620,6 @@ public class IcResiUserController implements ResultDataResolver { * * @param tokenDto * @param pageFormDTO - * @param response * @return void * @author LiuJanJun * @date 2021/11/19 4:24 下午 @@ -1452,7 +1450,6 @@ public class IcResiUserController implements ResultDataResolver { /** * Desc: 居民首次进入小程序,可以根据输入身份证信息查询在数字社区居民信息中的网格,匹配不成功提示 - * @param tokenDto * @param formDTO * @author zxc * @date 2022/8/5 11:17 @@ -1574,4 +1571,51 @@ public class IcResiUserController implements ResultDataResolver { formDTO.getCode())); } + /** + * 11、导出列表数据 + * + * @param response + * @param formDTO + * @throws Exception + */ + @PostMapping("portrayal-listexport") + public void exportMonitoringEquipment(HttpServletResponse response, + @RequestBody ResiPortrayalCommonFormDTO formDTO) throws Exception { + formDTO.setIsPage(false); + ExcelWriter excelWriter = null; + formDTO.setPageNo(NumConstant.ONE); + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + try { + String fileName = "居民画像-居民列表" + DateUtils.format(new Date()) + ".xlsx"; + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), ResiPortrayalDetailDTO.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + PageData data = null; + List list = null; + do { + // 默认查询本组织及下级 + data = icResiUserService.queryPortrayalResiList(EpmetRequestHolder.getLoginUserCustomerId(),EpmetRequestHolder.getLoginUserId(), + formDTO.getPageNo(),formDTO.getPageSize(), + formDTO.getOrgId(),formDTO.getOrgType(), + formDTO.getCodeType(),formDTO.getCode()); + list = data.getList(); + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + excelWriter.write(list, writeSheet); + } while (org.apache.commons.collections4.CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + log.error("居民画像-居民列表export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + } From 82db8148f669060094416d291a753ba0062a190c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 12 Apr 2023 14:36:47 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=94=BB=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/IcResiUserDao.xml | 44 ++++++++----------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 3ca4f4c8cc..aa43c3eea9 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -125,6 +125,8 @@ + and ${subCondition.tableName}.${subCondition.columnName} is not null + and ${subCondition.tableName}.${subCondition.columnName} !='' and ${subCondition.tableName}.${subCondition.columnName} between #{subCondition.columnValue[0]} and #{subCondition.columnValue[1]} @@ -180,6 +182,8 @@ + and ${subCondition.tableName}.${subCondition.columnName} is not null + and ${subCondition.tableName}.${subCondition.columnName} !='' and ${subCondition.tableName}.${subCondition.columnName} between #{subCondition.columnValue[0]} and #{subCondition.columnValue[1]} @@ -1548,11 +1552,11 @@ u.ID, YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) as age, ( - case when YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) < 50 then '0' - when YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) >=50 and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) <=59 then '1' - when YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) >=60 and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) <=69 then '2' - when YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) >=70 and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) <=79 then '3' - when YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) >=80 then '4' + case when u.BIRTHDAY > DATE_SUB(CURDATE(),INTERVAL 50 year) then '0' + when u.BIRTHDAY BETWEEN DATE_SUB(CURDATE(),INTERVAL 59 year) AND DATE_SUB(CURDATE(),INTERVAL 50 year) then '1' + when u.BIRTHDAY BETWEEN DATE_SUB(CURDATE(),INTERVAL 69 year) AND DATE_SUB(CURDATE(),INTERVAL 60 year) then '2' + when u.BIRTHDAY BETWEEN DATE_SUB(CURDATE(),INTERVAL 79 year) AND DATE_SUB(CURDATE(),INTERVAL 70 year) then '3' + when u.BIRTHDAY <= DATE_SUB(CURDATE(),INTERVAL 80 year) then '4' end ) as `code` FROM @@ -1606,30 +1610,20 @@ - - and u.BIRTHDAY is not null - and u.BIRTHDAY !='' - and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) < 50 + + and u.BIRTHDAY > DATE_SUB(CURDATE(),INTERVAL 50 year) - - and u.BIRTHDAY is not null - and u.BIRTHDAY !='' - and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) >=50 and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) <=59 + + and u.BIRTHDAY BETWEEN DATE_SUB(CURDATE(),INTERVAL 59 year) AND DATE_SUB(CURDATE(),INTERVAL 50 year) - - and u.BIRTHDAY is not null - and u.BIRTHDAY !='' - and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) >=60 and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) <=69 + + and u.BIRTHDAY BETWEEN DATE_SUB(CURDATE(),INTERVAL 69 year) AND DATE_SUB(CURDATE(),INTERVAL 60 year) - - and u.BIRTHDAY is not null - and u.BIRTHDAY !='' - and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) >=70 and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) <=79 + + and u.BIRTHDAY BETWEEN DATE_SUB(CURDATE(),INTERVAL 79 year) AND DATE_SUB(CURDATE(),INTERVAL 70 year) - - and u.BIRTHDAY is not null - and u.BIRTHDAY !='' - and YEAR(NOW())-SUBSTR(u.BIRTHDAY, 1, 4) >=80 + + and u.BIRTHDAY <= DATE_SUB(CURDATE(),INTERVAL 80 year) order by u.ID asc From d94b5bf94cb5ffcb835d604a667666a2273cfdc4 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 12 Apr 2023 15:56:34 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=94=BB=E5=83=8Fdc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcResiUserDao.xml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index aa43c3eea9..ec82b7ce45 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -127,7 +127,12 @@ and ${subCondition.tableName}.${subCondition.columnName} is not null and ${subCondition.tableName}.${subCondition.columnName} !='' - and ${subCondition.tableName}.${subCondition.columnName} between #{subCondition.columnValue[0]} and #{subCondition.columnValue[1]} + + and ${subCondition.tableName}.${subCondition.columnName} >= #{subCondition.columnValue[0]} + + + and ${subCondition.tableName}.${subCondition.columnName} <= #{subCondition.columnValue[1]} + @@ -184,7 +189,12 @@ and ${subCondition.tableName}.${subCondition.columnName} is not null and ${subCondition.tableName}.${subCondition.columnName} !='' - and ${subCondition.tableName}.${subCondition.columnName} between #{subCondition.columnValue[0]} and #{subCondition.columnValue[1]} + + and ${subCondition.tableName}.${subCondition.columnName} >= #{subCondition.columnValue[0]} + + + and ${subCondition.tableName}.${subCondition.columnName} <= #{subCondition.columnValue[1]} +