| | |
| | | .or() |
| | | .apply("exists (select 1 from benefit_order o " |
| | | + "join merchant m on m.id = o.merchant_id and m.deleted = 0 " |
| | | + "and m.merchant_type in ('hotel', '酒店服务') " |
| | | + "and m.merchant_type_code = 'hotel' " |
| | | + "where o.id = verify_record.order_id and o.deleted = 0)")); |
| | | if (merchantId != null) { |
| | | recordQuery.and(wrapper -> wrapper.eq("merchant_id", merchantId) |
| | |
| | | .eq("verify_status", 1) |
| | | .ge("updated_at", windowStart) |
| | | .apply("exists (select 1 from merchant m where m.id = benefit_order.merchant_id " |
| | | + "and m.deleted = 0 and m.merchant_type in ('hotel', '酒店服务'))") |
| | | + "and m.deleted = 0 and m.merchant_type_code = 'hotel')") |
| | | .apply("not exists (select 1 from verify_record r where r.order_id = benefit_order.id and r.status = 1)"); |
| | | if (merchantId != null) { |
| | | orderQuery.eq("merchant_id", merchantId); |