package com.ssj.dao.conch.conch.dao;

import com.ssj.bean.conch.conch.domain.ConchDerverUseRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * @author Mount Liu
 * @date 2019/7/30
 */
@Repository
public interface ConchDerverUseRecordDao extends JpaRepository<ConchDerverUseRecord, String>{

	/**
	 * 查询用户使用小塾记录
	 * @param userId
	 * @param derver
	 * @return
	 */
	ConchDerverUseRecord findByUserIdAndDerver(String userId, String derver);

	/**
	 * 通过结束时间查找服务
	 * @param endTime
	 * @return
	 */
	@Query(nativeQuery = true, value = "SELECT * from conch_derver_use_record where end_time regexp ?1 ")
	List<ConchDerverUseRecord> findByEndTime(String endTime);

}
