| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.tourguide.modules.order.entity.TourOrderRefund; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | public interface TourOrderRefundMapper extends BaseMapper<TourOrderRefund> { |
| | |
| | | "ORDER BY COALESCE(refund_time, created_at) DESC, id DESC") |
| | | List<TourOrderRefund> selectByOrderId(Long orderId); |
| | | |
| | | @Select({ |
| | | "<script>", |
| | | "SELECT * FROM tour_order_refund WHERE deleted = 0 AND order_id IN", |
| | | "<foreach collection='orderIds' item='orderId' open='(' separator=',' close=')'>#{orderId}</foreach>", |
| | | "ORDER BY COALESCE(refund_time, created_at) DESC, id DESC", |
| | | "</script>" |
| | | }) |
| | | List<TourOrderRefund> selectByOrderIds(@Param("orderIds") Collection<Long> orderIds); |
| | | |
| | | @Select("SELECT * FROM tour_order_refund WHERE refund_order_no = #{refundOrderNo} " + |
| | | "AND deleted = 0 LIMIT 1 FOR UPDATE") |
| | | TourOrderRefund selectByRefundOrderNoForUpdate(String refundOrderNo); |