|
@ -52,10 +52,10 @@ |
|
|
sort |
|
|
sort |
|
|
FROM ( |
|
|
FROM ( |
|
|
SELECT * FROM badge |
|
|
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 |
|
|
UNION ALL |
|
|
SELECT * FROM badge a |
|
|
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 |
|
|
AND NOT EXISTS |
|
|
( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.ID = b.ID)) t |
|
|
( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.ID = b.ID)) t |
|
|
ORDER BY |
|
|
ORDER BY |
|
|