From b49d1bfec645b94eabf2762e63299e40bae47cce Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 31 Mar 2022 16:10:02 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E7=96=AB=E4=BF=A1=E6=81=AF=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/EpidemicPreventionFormDTO.java | 3 +++ .../main/resources/mapper/IcResiUserDao.xml | 24 +++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EpidemicPreventionFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EpidemicPreventionFormDTO.java index d848f1e545..9685df941a 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EpidemicPreventionFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EpidemicPreventionFormDTO.java @@ -64,4 +64,7 @@ public class EpidemicPreventionFormDTO extends PageFormDTO implements Serializab * 核酸检测次数 */ private Integer natCount; + + private String startDate; + private String endDate; } 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 ca26c6bf4e..425a17d3c3 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 @@ -656,8 +656,28 @@ IFNULL( c.count, 0 ) AS natCount FROM ic_resi_user a - LEFT JOIN ( SELECT ID_CARD, count( id ) AS count FROM ic_resi_vaccine WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} GROUP BY ID_CARD ) b ON a.ID_CARD = b.ID_CARD - LEFT JOIN ( SELECT ID_CARD, count( id ) AS count FROM ic_nat WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} GROUP BY ID_CARD ) c ON a.ID_CARD = c.ID_CARD + LEFT JOIN ( + SELECT ID_CARD, count( id ) AS count + FROM ic_resi_vaccine + WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} + + AND DATE_FORMAT(INOCULATE_TIME,"%Y-%m-%d") > #{startDate} + + + AND DATE_FORMAT(INOCULATE_TIME,"%Y-%m-%d") < #{endDate} + + GROUP BY ID_CARD ) b ON a.ID_CARD = b.ID_CARD + LEFT JOIN ( + SELECT ID_CARD, count( id ) AS count + FROM ic_nat + WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} + + AND DATE_FORMAT(NAT_TIME,"%Y-%m-%d") > #{startDate} + + + AND DATE_FORMAT(NAT_TIME,"%Y-%m-%d") < #{endDate} + + GROUP BY ID_CARD ) c ON a.ID_CARD = c.ID_CARD WHERE a.DEL_FLAG = '0'