package com.teamid.repository;

import com.teamid.entity.OrderRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by Skye on 2017/6/3.
 */
public interface OrderRecordRepository extends JpaRepository<OrderRecord, Long> {

    List<OrderRecord> findOrderRecordsByCustomerId(long customerId);

    List<OrderRecord> findOrderRecordsByPartnerId(long partnerId);

    OrderRecord findOrderRecordByPartnerTicketId(long partnerTicketId);

    @Modifying
    @Query(value = "update order_record o set o.partnerId = ?2 where o.id = ?1"
    , nativeQuery = true)
    void modifyOrderRecordWithPartnerId(long id, long parnetId);

    @Modifying
    @Query(value = "update order_record o set o.status = ?2 where o.id = ?1"
    , nativeQuery = true)
    void modifyOrderRecordWithStatus(long id, int status);

}

@@ -666,17 +666,18 @@
 .partner
-I
+_i
 d = ?2 w

修复了OrderRecordRepository中raw sql语句中的字段错误