diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/controller/EpidemicUserInfoController.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/controller/EpidemicUserInfoController.java index 304d568..eedca60 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/controller/EpidemicUserInfoController.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/controller/EpidemicUserInfoController.java @@ -116,4 +116,9 @@ public class EpidemicUserInfoController { return new Result(); } + @GetMapping("updateAge") + public Result updateAge() { + return epidemicUserInfoService.updateAge(); + } + } diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dao/EpidemicUserInfoDao.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dao/EpidemicUserInfoDao.java index 6cf0c89..be66877 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dao/EpidemicUserInfoDao.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dao/EpidemicUserInfoDao.java @@ -126,4 +126,14 @@ public interface EpidemicUserInfoDao extends BaseDao { * @date 2021/4/30 10:06 */ List selectAllUserInfo(); + + /** + * 更新年龄信息 + * + * @param + * @return void + * @author zhy + * @date 2021/5/11 10:06 + */ + void updateUserAge(); } \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/EpidemicUserInfoService.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/EpidemicUserInfoService.java index 442e22d..a2221d0 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/EpidemicUserInfoService.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/EpidemicUserInfoService.java @@ -110,4 +110,14 @@ public interface EpidemicUserInfoService extends CrudService @@ -91,73 +90,11 @@ and uir.GRID_NAME like '%${gridName}%' - - and - - - ( - ( - YEAR (now()) - YEAR (substring(ui.ID_CARD, 7, 8)) - ) BETWEEN 0 - AND 18 - ) - - - ( - ( - YEAR (now()) - YEAR (substring(ui.ID_CARD, 7, 8)) - ) BETWEEN 19 - AND 19 - ) - - - ( - ( - YEAR (now()) - YEAR (substring(ui.ID_CARD, 7, 8)) - ) BETWEEN 20 - AND 29 - ) - - - ( - ( - YEAR (now()) - YEAR (substring(ui.ID_CARD, 7, 8)) - ) BETWEEN 30 - AND 39 - ) - - - ( - ( - YEAR (now()) - YEAR (substring(ui.ID_CARD, 7, 8)) - ) BETWEEN 40 - AND 49 - ) - - - ( - ( - YEAR (now()) - YEAR (substring(ui.ID_CARD, 7, 8)) - ) BETWEEN 50 - AND 59 - ) - - - ( - ( - YEAR (now()) - YEAR (substring(ui.ID_CARD, 7, 8)) - ) >= 60 - ) - - + + and ui.AGE >= #{ageStart} - - and - - - vi.COMPANY_ID = #{companyItem} - - + + and ui.AGE <= #{ageEnd} and ui.VACCINATION_NUM = 0 @@ -400,4 +337,19 @@ WHERE ui.DEL_FLAG = '0' + + + UPDATE epidemic_user_info + SET age = IFNULL( + ( + YEAR (now()) - YEAR (substring(ID_CARD, 7, 8)) + ), + 0 + ) + WHERE + DEL_FLAG = '0' + AND ID_CARD IS NOT NULL + AND REVISION = 0 + AND LENGTH(ID_CARD) = 18 + \ No newline at end of file