diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml index dfb53c3363..74183a1073 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml @@ -52,10 +52,10 @@ sort FROM ( SELECT * FROM badge - WHERE CUSTOMER_ID = #{customerId} AND DEL_FLAG = '0' + WHERE CUSTOMER_ID = #{customerId} AND DEL_FLAG = '0' AND BADGE_STATUS = 'online' UNION ALL SELECT * FROM badge a - WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0' AND BADGE_STATUS = 'online' + WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0' AND NOT EXISTS ( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.ID = b.ID)) t ORDER BY