| | |
| | | m.longitude, |
| | | m.latitude |
| | | from merchant m |
| | | join premium_topic_merchant mapping on mapping.merchant_id = m.id and mapping.deleted = 0 |
| | | where m.id = #{merchantId} |
| | | and mapping.category_key = #{categoryKey} |
| | | and m.deleted = 0 |
| | | and m.status = 1 |
| | | and (exists (select 1 from premium_topic_merchant mapping |
| | | where mapping.merchant_id = m.id |
| | | and mapping.category_key = #{categoryKey} |
| | | and mapping.deleted = 0) |
| | | or (#{categoryKey} = 'medical' and m.merchant_type in ('medical', '免费体检', 'healthCheck'))) |
| | | limit 1 |
| | | """) |
| | | Map<String, Object> selectPremiumMerchantSnapshot(@Param("merchantId") Long merchantId, @Param("categoryKey") String categoryKey); |