package com.carmaintenance.repository;

import com.carmaintenance.entity.ServiceOrder;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

/**
 * 维保工单Repository
 */
@Repository
public interface ServiceOrderRepository extends JpaRepository<ServiceOrder, Integer> {

    Optional<ServiceOrder> findByOrderNo(String orderNo);

    List<ServiceOrder> findByCustomerId(Integer customerId);

    List<ServiceOrder> findByVehicleId(Integer vehicleId);

    List<ServiceOrder> findByStaffId(Integer staffId);

    List<ServiceOrder> findByStatus(ServiceOrder.OrderStatus status);
}
