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 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, CREATED_TIME 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)
LEFT JOIN (SELECT id_card , CUSTOMER_ID, count(1) AS vaccinationCount, CREATED_TIME 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
WHERE a.DEL_FLAG = 0
AND a.ORG_ID = #{orgId}
AND concat(a.pids,':',#{orgId}) like concat('%',#{orgId},'%')
AND a.ATTENTION_TYPE = #{attentionType}
AND a.ATTENTION_TYPE = #{attentionType}
<iftest='null != name and "" != name'>
<iftest='null != name and "" != name'>
AND a.`NAME` LIKE CONCAT('%',#{name},'%')
AND a.`NAME` LIKE CONCAT('%',#{name},'%')
@ -87,7 +87,7 @@
FROM ic_epidemic_special_attention a
FROM ic_epidemic_special_attention a
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
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
WHERE a.DEL_FLAG = 0
AND a.ORG_ID = #{orgId}
AND concat(a.pids,':',#{orgId}) like concat('%',#{orgId},'%')