diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml index 3c992a4132..c6249ea224 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml @@ -33,8 +33,8 @@ IFNULL((SELECT DATE_FORMAT(CREATED_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_notice WHERE DEL_FLAG = '0' AND ORIGIN = #{attentionType} AND ID_CARD = a.ID_CARD ORDER BY CREATED_TIME DESC LIMIT 1),'') AS lastInformTime, IFNULL(v.vaccinationCount,0) AS vaccinationCount FROM ic_epidemic_special_attention a - LEFT JOIN ic_resi_user b ON a.id_card = b.id_card AND b.del_flag = '0' - LEFT JOIN (SELECT id_card ,count(1) AS vaccinationCount FROM ic_vaccine WHERE DEL_FLAG = 0 GROUP BY ID_CARD) v ON (v.ID_CARD = a.ID_CARD) + LEFT JOIN ic_resi_user b ON a.id_card = b.id_card AND b.del_flag = '0' and b.CUSTOMER_ID=a.CUSTOMER_ID + LEFT JOIN (SELECT id_card , CUSTOMER_ID, count(1) AS vaccinationCount FROM ic_vaccine WHERE DEL_FLAG = 0 GROUP BY ID_CARD, CUSTOMER_ID) v ON (v.ID_CARD = a.ID_CARD and v.CUSTOMER_ID=a.CUSTOMER_ID) WHERE a.DEL_FLAG = 0 AND a.ORG_ID = #{orgId} AND a.ATTENTION_TYPE = #{attentionType} @@ -79,7 +79,7 @@ b.HOME_ID, IFNULL((SELECT DATE_FORMAT(CREATED_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_notice WHERE DEL_FLAG = '0' AND ORIGIN = #{attentionType} AND ID_CARD = a.ID_CARD ORDER BY CREATED_TIME DESC LIMIT 1),'') AS lastInformTime FROM ic_epidemic_special_attention a - LEFT JOIN ic_resi_user b ON a.id_card = b.id_card AND b.del_flag = '0' + LEFT JOIN ic_resi_user b ON a.id_card = b.id_card AND b.del_flag = '0' and a.CUSTOMER_ID = b.CUSTOMER_ID WHERE a.DEL_FLAG = 0 AND a.ORG_ID = #{orgId} AND a.ATTENTION_TYPE = #{attentionType}