package com.cirle.scientific.dao;


import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import com.cirle.scientific.po.QkjPurchasedRecords;

@Repository
public interface QkjPurchasedRecordsDao extends PagingAndSortingRepository<QkjPurchasedRecords, Long>, JpaSpecificationExecutor<QkjPurchasedRecords> {

    @Query(value = "select mpr.* from qkj_purchased_records mpr where mpr.status=0 and mpr.obj_type=?2 and mpr.mem_card=?1 and mpr.obj_id=?3 and mpr.ispackage=?4 limit 0,1", nativeQuery = true)
    QkjPurchasedRecords findByMemCardAndObjId(String memCard, Integer objType, Integer objId, Integer ispackage);

}
