@ -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